AMD64Arithmetic.java
Venkatachalam, Vasanth
Vasanth.Venkatachalam at amd.com
Wed Feb 20 14:05:34 PST 2013
Hi,
I'm trying to understand AMD64Arithmetic.java and had some questions.
1) Why are Op2RegCommutative, DivOp and ShiftOp defined separately instead of having the operations that would be covered by these classes piggyback on Op1Reg and Op2Reg? More generally, what guides the decision of how many separate *Op classes should be defined in this file which call the emit( ) routine?
2) Am I right in thinking that these different Op objects (Op1Reg, etc) represent nodes in the LIR and the emit( ) routine decides based on the opcode, which native or assembly instructions should be emitted? What files should I look at to understand the plumbing that generates these nodes (and which I would need to update if I were to define new Op classes in this file)?
3) For PTXArithmetic.java it looks like the switch statements inside the emit( ) routines haven't been completely implemented. For example, the case where src1 is a constant only covers the isub and iand instructions, whereas the case where src2 is a constant only covers iadd, iand, and iushr. Is it true that this is just a partial implementation?
Vasanth
More information about the graal-dev
mailing list