Source level compatiblity between P1 and P2?
David Betz
Posts: 14,516
There has been lots of discussion of binary encoding optimizations in P2 that make it binary incompatible with P1 programs. What about source level compatability? What common source level practices used in P1 will not work anymore in P2? I guess one obvious one is that the NR and WR specifiers will no longer be supported. Are there other source level differences? I realize of course that there are many new instructions in P2 but right now I'm only asking about how much P1 PASM source code will have to be changed to assemble for P2. I'm also not worried about instructions that manage the hardware blocks like counters and video or even pins. In particular, I'm wondering about changes that might affect the code generation of PropGCC.
Comments
- WAITVID
- Counters
- NR flag
- all the new P2 features (hub, clut pointers, indirection)
There is probably more I have not thought of.
won't be source code compatible.
Frankly, to make decent use of the new features, gcc will need a new back end code generator, assembler and new optimizer rules at a minimum - however that effort should result in smaller/faster code.
A "preliminary" port that minimizes the changes may make sense, and could be done fairly quickly by not trying to incorporate the new instructions etc, however for good performance, it may actually take less time and get better performance to start from scratch. (Sorry Ken)
Incorporating all the new features, and using a VLIW-approach, would result in much faster code.
p.s.
Starting with a preliminary port, and hoping to over time make small changes to "bring it up to snuff" is likely far more work and would cost a lot more than a clean sheet design specifically for the P2.
I meant a quick port to the new instruction encoding.
I liked the previous quick port, I did play with it a bit and it worked - you guys did a good job.
What I was referring to was making good uses of INDA/INDB, PTRA/PTRB, SPA/SPB with all the different addressing modes, the new math instructions, a float package based on them etc etc - the hub and clut addressing modes are a huge win for generated code (once implemented) as will the new instructions.
Regardless, the changes are well worth the re-work, as they greatly upgrade the P2 instruction set and opportunity for better code generation.