powerpc backend for the scale compiler
DESCRIPTION
PowerPC Backend for the Scale Compiler. Julia Gilinets and Katie Coons CRA-W DMP Program Summer, 2004. Distributed Mentor Program (DMP). Increase the number of women in graduate school in computer science Involve women in research Interact with graduate students and professors - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/1.jpg)
1
PowerPC Backend for the Scale Compiler
Julia Gilinets and Katie Coons
CRA-W DMP Program
Summer, 2004
![Page 2: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/2.jpg)
2
Distributed Mentor Program (DMP)
Increase the number of women in graduate school in computer science
Involve women in research Interact with graduate students and
professors Work with successful researchers
![Page 3: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/3.jpg)
3
Synopsis Goals and motivation Scale compiler overview Project status Challenges we have encountered Impact and future work
![Page 4: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/4.jpg)
4
Goals Implement a backend for the Scale
compiler for the PowerPC architecture for Mac OS X and Linux
Experience the graduate school environment
Gain research experience Senior thesis topics and research
![Page 5: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/5.jpg)
5
Why is DMP Important to Graduate Students? You can help encourage qualified
women to seek a graduate education, possibly at UT
You can serve as a role model You can positively influence the lives of
DMP students
![Page 6: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/6.jpg)
6
A Scalable Compiler for Analytical Experiments (SCALE)
Framework for research in compiler optimizations
Modular Flexible Optimized Target multiple architectures
![Page 7: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/7.jpg)
7
SCALE Data Flow Diagram
![Page 8: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/8.jpg)
8
Ratio of Scale to Native Execution Time
![Page 9: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/9.jpg)
9
Motivation Existing backends: Alpha (dead), Sparc
(dying), TRIPS (doesn’t exist yet) PowerPC is an existing architecture that
will, hopefully, last Experience working as a team Experience working as a part of a much
larger project
![Page 10: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/10.jpg)
10
What We Have Accomplished Setting up the stack frame Function calls Basic flow control Structures - Passing, returning Integer and floating point arithmetic Conversions - int to real and real to int Arrays Position Independent Code for Mac OsX
![Page 11: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/11.jpg)
11
Challenges Different ABIs Position-independent code Source control Learning multiple ISAs Corner cases
![Page 12: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/12.jpg)
12
Stack Frame - Linux
![Page 13: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/13.jpg)
13
Stack Frame - Mac OS X
![Page 14: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/14.jpg)
14
Stack Frame Comparison
fp reg save area (optional)
ireg save area (optional)
Padding (optional)
Local storage (optional)
24(r1) Parameter area (>= 8 words)
20(r1) TOC save area
16(r1) Link editor doubleword
12(r1) Compiler doubleword
8(r1) Link register (LR) save
4(r1) Condition register (CR) save
0(r1) ptr to callee’s stack
Mac OS X
fp reg save area (optional)
ireg save area (optional)
CR save area (optional)
Local storage (optional)
8(r1) Parameter area (optional)
4(r1) Link register (LR) save
0(r1) ptr to callee’s stack
Linux
SP
![Page 15: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/15.jpg)
15
Register Usage Comparison
Reg Usage Callee Save
r0 Prolog/epilog No
r1 Stack pointer Yes
r2 TOC pointer Yes
r3-r4 1/2 para/return No
r5-r10 3-8th integer para No
r11 Env.pointer No
r12 Used by global linkage
No
r13-31 Global int registers Yes
Reg Usage Callee Save
r0 Prolog/epilog No
r1 Stack pointer Yes
r2 TOC pointer Yes
r3-r4 1/2 para/return No
r5-r10 3-8th integer para No
r11-r12 Func linkage regs No
r13 Small data area ptr No
r14-r30 Global int registers Yes
r31 Global/env. pointer Yes
Mac OS X Linux
![Page 16: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/16.jpg)
16
Position-Independent Code (PIC) Required for external linkage in Mac OS
X Inhibits debugging if not implemented -
no printf! No precedent in Scale Compiler
![Page 17: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/17.jpg)
17
Call to printf - Linux
bl printf
![Page 18: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/18.jpg)
18
Call to printf - Mac OS X
bl L_printf$stub
.data
.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 .align 2L_printf$stub: .indirect_symbol _printf mflr r0 bcl 20,31,L0$_printf
![Page 19: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/19.jpg)
19
Call to printf - Mac OS X
L0$_printf: mflr r11 addis r11,r11,ha16(L_printf$lazy_ptr-L0$_printf) mtlr r0 lwzu r12,lo16(L_printf$lazy_ptr-L0$_printf)(r11) mtctr r12 bctr.data.lazy_symbol_pointerL_printf$lazy_ptr: .indirect_symbol _printf .long dyld_stub_binding_helper
![Page 20: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/20.jpg)
20
Tasks Remaining Position-independent code (completed) Variable-length argument lists Passing structs as arguments
on stack (completed) Exponential, bit complement,
remainder, absolute value expressions Extensive testing
![Page 21: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/21.jpg)
21
Outside of the Scale Compiler Research meetings - Speedway and
TRIPS Reading research papers Research for senior thesis topics Meetings and lunches with Kathryn First Bytes
![Page 22: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/22.jpg)
22
Things We’ve Learned Take initiative Read papers in your field Don’t be intimidated Don’t be afraid to ask questions Take advantage of the little time you
have with your professors
![Page 23: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/23.jpg)
23
Grad Students Have Helped! Technical help - accounts, environment
setup Weekly research meetings Helped us feel comfortable in this
environment Receiving your respect and
encouragement has been vital
![Page 24: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/24.jpg)
24
Re-Cap … CRA-W DMP program helps women
consider graduate education in computer science
The role of current graduate students and faculty is vital in making this program succeed
![Page 25: PowerPC Backend for the Scale Compiler](https://reader036.vdocument.in/reader036/viewer/2022062518/568149fe550346895db72db0/html5/thumbnails/25.jpg)
25
Re-Cap Helped achieve Scale project goals Provided Scale backend for a lasting
architecture Future of PowerPC backend uncertain!