christian.thalinger at oracle.com
Thu Feb 21 11:36:25 PST 2013
On Feb 20, 2013, at 2:05 PM, "Venkatachalam, Vasanth" <Vasanth.Venkatachalam at amd.com> wrote:
> 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?
Yes. These are the only instructions that I needed for my initial experiment. As soon as we are able to actually run the emitted PTX code we can continue to implement the missing pieces.
More information about the graal-dev