Regarding Opcodes in x86

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Regarding Opcodes in x86

pratik dand
Dear,

I am going through the lib/Target/X86/X86InstrArithmetic.td file where there is a definition for a multiclass as follows

multiclass ArithBinOp_F<bits<8> BaseOpc, bits<8> BaseOpc2, bits<8> BaseOpc4,
                        string mnemonic, Format RegMRM, Format MemMRM,
                        SDNode opnode,
                        bit CommutableRR, bit ConvertibleToThreeAddress>

This for arithmetic operators like ADD,XOR,AND etc.

Can anyone throw some light on the three different opcodes used namely BaseOpc , BasecOp2, BaseOpc4 ?
Also, I am looking for some free opcodes to assign to new instructions, If someone could guide on this then It would be great?

Pratik


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Regarding Opcodes in x86

Craig Topper
I believe BaseOpc is the opcode for 'add/xor/and reg/mem, reg' form, BaseOpc2 is the opcode for the 'add/xor/and reg, reg/mem' form, BaseOpc4 is the opcode for the 'add/xor/and AL, imm form'.

If you want to look for free opcodes you're better of looking at the blank spots in the official Intel documentation.


On Sun, Jun 22, 2014 at 7:43 PM, pratik dand <[hidden email]> wrote:
Dear,

I am going through the lib/Target/X86/X86InstrArithmetic.td file where there is a definition for a multiclass as follows

multiclass ArithBinOp_F<bits<8> BaseOpc, bits<8> BaseOpc2, bits<8> BaseOpc4,
                        string mnemonic, Format RegMRM, Format MemMRM,
                        SDNode opnode,
                        bit CommutableRR, bit ConvertibleToThreeAddress>

This for arithmetic operators like ADD,XOR,AND etc.

Can anyone throw some light on the three different opcodes used namely BaseOpc , BasecOp2, BaseOpc4 ?
Also, I am looking for some free opcodes to assign to new instructions, If someone could guide on this then It would be great?

Pratik


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




--
~Craig

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev