Compiling Java for the Propeller
My spare time is pretty limited these days -- work takes up a lot of it. On the up-side, I got promoted.
Over the past few months, some of my spare time has been spent designing a Java compiler that targets the Parallax Propeller. A few hand-coded mockups have convinced me that it's feasible -- the only thing between that and making it a reality are the past 50 years of compiler research, which I never learned. :-)
So, I've spent time surfing Citeseer and gathering data. Between what I've learned and my Propeller experience, I've set some parameters for the first version: it will compile to Large Memory Model code rather than a custom interpreter, and will consume Java class files.
As of this evening I've got a prototype working, and have compiled/assembled/uploaded my first binary. The bullet points are as follows:
Here's sample input and output from one of my test suites
And the output, in propasm syntax (a superset of Parallax):
The "call #prim_foo" instructions are calls to LMM kernel traps; plenty of other people have explained Propeller LMM in detail elsewhere, I won't repeat it. My code generator inlines LMM primitives in some cases, as it's done with jump here.
Some details of the calling conventions are apparent in the output: incoming arguments start at r0, and the returned value comes back in r0. These registers are real-live Propeller registers inside the LMM kernel, and I suspect I'll have room for a lot of them -- 32 or more -- so I'm using a RISC-like register calling convention, with link register.
Assuming work doesn't interfere, I'll post more as it develops.
Over the past few months, some of my spare time has been spent designing a Java compiler that targets the Parallax Propeller. A few hand-coded mockups have convinced me that it's feasible -- the only thing between that and making it a reality are the past 50 years of compiler research, which I never learned. :-)
So, I've spent time surfing Citeseer and gathering data. Between what I've learned and my Propeller experience, I've set some parameters for the first version: it will compile to Large Memory Model code rather than a custom interpreter, and will consume Java class files.
As of this evening I've got a prototype working, and have compiled/assembled/uploaded my first binary. The bullet points are as follows:
- Converts Java 6 JVML to n-address linear IR using abstract evaluation. Assumes input is verifiable, which lets me skip some checking. (Why Java 6? Because it generates nice frame attributes and doesn't use jsr.)
- Operates almost exclusively in SSA (actually CSSA).
- Performs register allocation in SSA form, using a crippled-but-developing version of Pereira's algorithm. I've modified it to deal more gracefully with the Propeller's CISC-like two-address architecture.
- Provides limited scalar optimizations -- the ones I've gotten around to writing. Copy folding, constant propagation, jump-to-flow-control elimination, etc.
- Fantastically crappy code generator for now -- literally
printf
-based with no intelligent layout or peephole optimizations, as you'll see in the samples below. - None of the fun stuff, like garbage collection, works yet.
Here's sample input and output from one of my test suites
public class Input0 {
public int function(int x) {
int y = 0;
while (y < x) {
y ++;
}
return y;
}
}
And the output, in propasm syntax (a superset of Parallax):
method_function
L12893404
mov r2, #0
rdlong PC, PC ' inlined jmp
long @@L23063136
L26210109
add r2, #1
rdlong PC, PC ' inlined jmp
long @@L23063136
L23063136
' [int r2:1] <- phi ssa.BasicBlock@c4bcdc:[int c0:0] ssa.BasicBlock@18fef3d:[int r2:2]
cmps r2, r1 wc wz
call #prim_lt
long @@L26210109
long @@L25763215
L25763215
mov r0, r2
call #prim_return
The "call #prim_foo" instructions are calls to LMM kernel traps; plenty of other people have explained Propeller LMM in detail elsewhere, I won't repeat it. My code generator inlines LMM primitives in some cases, as it's done with jump here.
Some details of the calling conventions are apparent in the output: incoming arguments start at r0, and the returned value comes back in r0. These registers are real-live Propeller registers inside the LMM kernel, and I suspect I'll have room for a lot of them -- 32 or more -- so I'm using a RISC-like register calling convention, with link register.
Assuming work doesn't interfere, I'll post more as it develops.
25 Comments:
This comment has been removed by the author.
By Unknown, at 2:23 AM
I personally thought this was one of the top 1 million blog posts that I have ever read, keep up the fabulous work.vietnamese brides
By Unknown, at 10:26 PM
This article is very helpfull. I was looking for this info and it will help me on my business. thanks a lot
Hadoop Training Institute in Noida
By ciitnoida, at 12:23 AM
Some details of the business conventions area unit apparent within the output: incoming arguments begin at r0, and also the came back price comes back in r0. These registers area unit real-live propellor registers within the LMM kernel, and that i suspect i will have space for loads of them Best executive search firms.
By Zaigham Khan, at 12:35 AM
شركة تنظيف شقق بالمدينة المنورة شركة تنظيف شقق بالمدينة المنورة
شركة تنظيف سجاد بالرياض شركة تنظيف سجاد بالرياض
شركة تنظيف موكيت بالرياض شركة تنظيف موكيت بالرياض
https://www.bfirstseo.com/ https://www.bfirstseo.com/
شركة الاول للتنظيف و مكافحة الحشرات
افضل شركة صيانة مكيفات بالرياض
شركة ترميم منازل بالرياض
شركة عزل اسطح بالرياض
By jojo, at 6:28 AM
Its quite detailed and impressive post please continue posting like this for getting more new information from your side
Best Architects in India
Turnkey Interior Contractors in Chennai
Architecture Firms in Chennai
Warehouse Architect
Factory Architect Chennai
Office Interiors in Chennai
Rainwater Harvesting chennai
By Unknown, at 5:24 AM
شركة مكافحة حشرات بالزلفي
شركة مكافحة حشرات بالبدائع
شركة مكافحة حشرات المذنب
شركة مكافحة حشرات بعيون الجواء
شركة رش مبيدات بالمذنب
شركة رش مبيدات بعيون الجواء
شركة رش مبيدات بالزلفي
شركة رش المبيدات بالبدائع
نعلم جميعًا أن وجود الحشرات في أي مكان يختلف وفقًا للبيئة ووفقًا للموسم ، بالإضافة إلى أنه يختلف وفقًا لنوع الحشرات الموجودة في المكان ؛ ولهذا السبب ، تظهر العديد من الحشرات في أماكن مختلفة وهذا يرجع إلى العديد من الأسباب التي تجعل البعض يملك القدرة على التحكم به ، والبعض الآخر يصعب وضع خطة مناسبة له في جميع الحالات ، يجب أن يكون على علم ببعض هذه الأسباب لتفادي حدوثها في وقت لاحق ونحن سنعرض لك بعض الأسباب التي يجب أن تكون على علم بها لتجنب حدوث الاصابة بالحشرات لاحقًا
By anosh, at 11:57 AM
I just want to say thanks for your wonderful post, it is contain a lot of knowledge and information that i needed right now. Now i need to my bolg, you can play game fun, action here :
site...
By wood couter, at 11:48 PM
I just want to say thanks for your wonderful post, it is contain a lot of knowledge and information that i needed right now. Now i need to my bolg, you can play game fun, action here :
visit our web
By wood couter, at 11:48 PM
Very good information. Its very useful for me. We need learn from real time examples and for this we choose good training institute, we need to learn from experts . So we make use of demo classes . Recently we tried java demo class of Apponix Technologies.
https://www.apponix.com/Java-Institute/Java-Training-Institute-in-Bangalore.html
By Chethu Apponix, at 3:55 AM
I really found this blog post exciting because you have good content and unique thoughts on writing. So this might be useful to everyone. I really look forward to read some more updates. Thanks for sharing. dissertation formatting service
By RogerLavoie, at 12:14 AM
Good blog information I have seened
Sanjary Academy provides excellent training for Piping design course. Best Piping Design Training Institute in Hyderabad, Telangana. We have offer professional Engineering Course like Piping Design Course,QA / QC Course,document Controller course,pressure Vessel Design Course, Welding Inspector Course, Quality Management Course, #Safety officer course.
Piping Design Course in Hyderabad
By kirankumar, at 2:13 AM
We are the best writing company providing Essay Writer Servicesof the highest quality. We guarantee our customers of nothing but the highest quality document. Our Custom Term Paper Writing Services are well referenced, formatted and edited to ensure that the article is rid of unnecessary details.
By meldaresearch, at 3:42 AM
I absolutely admired every bit of it and i additionally accept you book apparent to analysis out fresh things in your site.outdoor game
By wood couter, at 11:06 PM
Nice Information for this blog
"Yaaron media is one of the rapidly growing digital marketing company in Hyderabad,india.Grow your business or brand name with best online, digital marketing companies in ameerpet, Hyderabad. Our Services digitalmarketing, SEO, SEM, SMO, SMM, e-mail marketing, webdesigning & development, mobile appilcation.
"
best digital marketing companies in Hyderabad
Best digital marketing services in Hyderabad
Best web designing & development companies in Hyderabad
By G.chandra sekhar reddy, at 11:35 PM
Thank you so much for these kinds of informative blogs.
we also providesseo services
graphic designing company in gurgaon
website company in gurgaon
best website designing company in india
top website designing company in india
website designing company in gurgaon
website development company in gurgaon
web development company in gurgaon
best website designing company in gurgaon
website designing services in gurgaon
web design company in gurgaon
website company in gurgaon
Website design Company in gurgaon
website designing in gurgaon
website designing company in gurgaon
website design in gurgaon
website design company in gurgaon
website design services in gurgaon
website design service in gurgaon
website designing in gurgaon
web design services in gurgaon
best website design company in gurgaon
best web design company in gurgaon
best website design in gurgaon
best website design services in gurgaon
best website designing services in gurgaon
best web design in gurgaon
best web design company in gurgaon
best web designing services in gurgaon
best web design services in gurgaon
By TNK Design Desk, at 3:06 AM
Thanks for sharing information
We are the best waterproofing services in Hyderabad. We are providing all kinds of leakage services which include bathroom, roof, wash area, water tank, wall cracks, kitchen leakage services in Hyderabad. With trust and honesty, we solve the issue as quickly as possible. We serve you better compared to others.
water proofing services in hyderabad
Hyderabad waterproofing services
Hyderabad waterproofing experts
waterproofing services in hyderabad
By Chandra Sekhar Reddy, at 10:05 PM
The article is very amazing and unique, love each word, and is quite interesting.Online Employee Management System
By Valentine Gift ideas, at 5:52 AM
The Best Baccarat Sites in India
Our 사설 바카라 review of the best Baccarat sites in India The best casinos to play casino games, such as video poker, are online and mobile.
By Anonymous, at 6:43 PM
java is one of the best languages to develop mobile applications. packers and movers in Bangalore thanks for sharing such a blog.
By Anonymous, at 2:13 AM
Thanks for information.
We also written about best rummy app visit our website for more information.
By Silkrummy, at 2:42 AM
Thanks for information. we also written about iot projects for ece. please visit once.
By Technologies, at 2:52 AM
This comment has been removed by the author.
By Vibin, at 3:25 AM
Master the language of innovation with our Java Training in Chennai at Infycle Technologies. Our industry-focused course equips you with the skills to develop robust software applications and opens doors to a world of job opportunities. Learn from experienced tutors, work on real-time projects, and embark on a journey to become a Java expert. Enrol today and start your coding career with confidence! For details, call us at +91-750263363 or +91-7504633633.
By Vibin, at 3:26 AM
Thank you for this insightful interview with Mark Hunter! His perspectives on industry shifts and the importance of adaptability truly resonate. His emphasis on cultivating relationships echoes the essence of successful networking. I particularly appreciated his thoughts on navigating challenges and looking forward to more inspiring content like this!
damar hamlin jacket
triple h jacket
juice wrld letterman jacket
Top Celebrity Jacket
By Zoe, at 2:01 AM
Post a Comment
<< Home