X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FARM%2FARMInstrFormats.td;h=7d27cf3fcdcbade77033fd340d7ca166c426b028;hb=d2f8ee71948854c205c74accf14c2b0b87502fef;hp=1349476d7c78e201e5db110e94aa99aaa7137da7;hpb=59b3300664d062bf04159eacaeb44d6c729e6a8c;p=oota-llvm.git diff --git a/lib/Target/ARM/ARMInstrFormats.td b/lib/Target/ARM/ARMInstrFormats.td index 1349476d7c7..7d27cf3fcdc 100644 --- a/lib/Target/ARM/ARMInstrFormats.td +++ b/lib/Target/ARM/ARMInstrFormats.td @@ -155,6 +155,16 @@ def pred : PredicateOperand, PredicateOp, + ComplexPattern { + let MIOperandInfo = (ops i32imm, i32imm); + let PrintMethod = "printPredicateOperand"; +} + // Conditional code result for instructions whose 's' bit is set, e.g. subs. def CCOutOperand : AsmOperandClass { let Name = "CCOut"; } def cc_out : OptionalDefOperand { @@ -193,6 +203,16 @@ def msr_mask : Operand { let ParserMatchClass = MSRMaskOperand; } +def BankedRegOperand : AsmOperandClass { + let Name = "BankedReg"; + let ParserMethod = "parseBankedRegOperand"; +} +def banked_reg : Operand { + let PrintMethod = "printBankedRegOperand"; + let DecoderMethod = "DecodeBankedReg"; + let ParserMatchClass = BankedRegOperand; +} + // Shift Right Immediate - A shift right immediate is encoded differently from // other shift immediates. The imm6 field is encoded like so: // @@ -202,25 +222,25 @@ def msr_mask : Operand { // 32 imm6<5> = '1', 32 - is encoded in imm6<4:0> // 64 64 - is encoded in imm6<5:0> def shr_imm8_asm_operand : ImmAsmOperand { let Name = "ShrImm8"; } -def shr_imm8 : Operand { +def shr_imm8 : Operand, ImmLeaf 0 && Imm <= 8; }]> { let EncoderMethod = "getShiftRight8Imm"; let DecoderMethod = "DecodeShiftRight8Imm"; let ParserMatchClass = shr_imm8_asm_operand; } def shr_imm16_asm_operand : ImmAsmOperand { let Name = "ShrImm16"; } -def shr_imm16 : Operand { +def shr_imm16 : Operand, ImmLeaf 0 && Imm <= 16; }]> { let EncoderMethod = "getShiftRight16Imm"; let DecoderMethod = "DecodeShiftRight16Imm"; let ParserMatchClass = shr_imm16_asm_operand; } def shr_imm32_asm_operand : ImmAsmOperand { let Name = "ShrImm32"; } -def shr_imm32 : Operand { +def shr_imm32 : Operand, ImmLeaf 0 && Imm <= 32; }]> { let EncoderMethod = "getShiftRight32Imm"; let DecoderMethod = "DecodeShiftRight32Imm"; let ParserMatchClass = shr_imm32_asm_operand; } def shr_imm64_asm_operand : ImmAsmOperand { let Name = "ShrImm64"; } -def shr_imm64 : Operand { +def shr_imm64 : Operand, ImmLeaf 0 && Imm <= 64; }]> { let EncoderMethod = "getShiftRight64Imm"; let DecoderMethod = "DecodeShiftRight64Imm"; let ParserMatchClass = shr_imm64_asm_operand; @@ -237,6 +257,8 @@ class t2InstAlias : InstAlias, Requires<[IsThumb2]>; class VFP2InstAlias : InstAlias, Requires<[HasVFP2]>; +class VFP2DPInstAlias + : InstAlias, Requires<[HasVFP2,HasDPVFP]>; class VFP3InstAlias : InstAlias, Requires<[HasVFP3]>; class NEONInstAlias @@ -317,10 +339,10 @@ class InstThumb +class AsmPseudoInst : InstTemplate { - let OutOperandList = (outs); + let OutOperandList = oops; let InOperandList = iops; let Pattern = []; let isCodeGenOnly = 0; // So we get asm matcher for it. @@ -328,16 +350,16 @@ class AsmPseudoInst let isPseudo = 1; } -class ARMAsmPseudo : AsmPseudoInst, - Requires<[IsARM]>; -class tAsmPseudo : AsmPseudoInst, - Requires<[IsThumb]>; -class t2AsmPseudo : AsmPseudoInst, - Requires<[IsThumb2]>; -class VFP2AsmPseudo : AsmPseudoInst, - Requires<[HasVFP2]>; -class NEONAsmPseudo : AsmPseudoInst, - Requires<[HasNEON]>; +class ARMAsmPseudo + : AsmPseudoInst, Requires<[IsARM]>; +class tAsmPseudo + : AsmPseudoInst, Requires<[IsThumb]>; +class t2AsmPseudo + : AsmPseudoInst, Requires<[IsThumb2]>; +class VFP2AsmPseudo + : AsmPseudoInst, Requires<[HasVFP2]>; +class NEONAsmPseudo + : AsmPseudoInst, Requires<[HasNEON]>; // Pseudo instructions for the code generator. class PseudoInst pattern> @@ -465,6 +487,10 @@ class AXI pattern> : XI; +class AXIM pattern> + : XI; class AInoP pattern> : InoP; -// Atomic load/store instructions -class AIldrex opcod, dag oops, dag iops, InstrItinClass itin, +class AIldr_ex_or_acq opcod, bits<2> opcod2, dag oops, dag iops, InstrItinClass itin, string opc, string asm, list pattern> : I { @@ -502,23 +527,52 @@ class AIldrex opcod, dag oops, dag iops, InstrItinClass itin, let Inst{20} = 1; let Inst{19-16} = addr; let Inst{15-12} = Rt; - let Inst{11-0} = 0b111110011111; + let Inst{11-10} = 0b11; + let Inst{9-8} = opcod2; + let Inst{7-0} = 0b10011111; } -class AIstrex opcod, dag oops, dag iops, InstrItinClass itin, +class AIstr_ex_or_rel opcod, bits<2> opcod2, dag oops, dag iops, InstrItinClass itin, string opc, string asm, list pattern> : I { - bits<4> Rd; bits<4> Rt; bits<4> addr; let Inst{27-23} = 0b00011; let Inst{22-21} = opcod; let Inst{20} = 0; let Inst{19-16} = addr; - let Inst{15-12} = Rd; - let Inst{11-4} = 0b11111001; + let Inst{11-10} = 0b11; + let Inst{9-8} = opcod2; + let Inst{7-4} = 0b1001; let Inst{3-0} = Rt; } +// Atomic load/store instructions +class AIldrex opcod, dag oops, dag iops, InstrItinClass itin, + string opc, string asm, list pattern> + : AIldr_ex_or_acq; + +class AIstrex opcod, dag oops, dag iops, InstrItinClass itin, + string opc, string asm, list pattern> + : AIstr_ex_or_rel { + bits<4> Rd; + let Inst{15-12} = Rd; +} + +// Exclusive load/store instructions + +class AIldaex opcod, dag oops, dag iops, InstrItinClass itin, + string opc, string asm, list pattern> + : AIldr_ex_or_acq, + Requires<[IsARM, HasV8]>; + +class AIstlex opcod, dag oops, dag iops, InstrItinClass itin, + string opc, string asm, list pattern> + : AIstr_ex_or_rel, + Requires<[IsARM, HasV8]> { + bits<4> Rd; + let Inst{15-12} = Rd; +} + class AIswp pattern> : AI { bits<4> Rt; @@ -535,6 +589,18 @@ class AIswp pattern> let Unpredictable{11-8} = 0b1111; let DecoderMethod = "DecodeSwap"; } +// Acquire/Release load/store instructions +class AIldracq opcod, dag oops, dag iops, InstrItinClass itin, + string opc, string asm, list pattern> + : AIldr_ex_or_acq, + Requires<[IsARM, HasV8]>; + +class AIstrrel opcod, dag oops, dag iops, InstrItinClass itin, + string opc, string asm, list pattern> + : AIstr_ex_or_rel, + Requires<[IsARM, HasV8]> { + let Inst{15-12} = 0b1111; +} // addrmode1 instructions class AI1 opcod, dag oops, dag iops, Format f, InstrItinClass itin, @@ -1520,6 +1586,8 @@ class ADuI opcod1, bits<2> opcod2, bits<4> opcod3, bits<2> opcod4, let Inst{8} = 1; // Double precision let Inst{7-6} = opcod4; let Inst{4} = opcod5; + + let Predicates = [HasVFP2, HasDPVFP]; } // Double precision, unary, not-predicated @@ -1572,6 +1640,8 @@ class ADbI opcod1, bits<2> opcod2, bit op6, bit op4, dag oops, let Inst{8} = 1; // Double precision let Inst{6} = op6; let Inst{4} = op4; + + let Predicates = [HasVFP2, HasDPVFP]; } // FP, binary, not predicated @@ -1601,6 +1671,8 @@ class ADbInp opcod1, bits<2> opcod2, bit opcod3, dag oops, dag iops, let Inst{8} = 1; // double precision let Inst{6} = opcod3; let Inst{4} = 0; + + let Predicates = [HasVFP2, HasDPVFP]; } // Single precision, unary, predicated @@ -1965,9 +2037,9 @@ class N2V op24_23, bits<2> op21_20, bits<2> op19_18, bits<2> op17_16, } // Same as N2V but not predicated. -class N2Vnp op17_16, bits<3> op10_8, bit op7, bit op6, +class N2Vnp op19_18, bits<2> op17_16, bits<3> op10_8, bit op7, bit op6, dag oops, dag iops, InstrItinClass itin, string OpcodeStr, - string Dt, ValueType ResTy, ValueType OpTy, list pattern> + string Dt, list pattern> : NeonInp { bits<5> Vd; @@ -1982,7 +2054,7 @@ class N2Vnp op17_16, bits<3> op10_8, bit op7, bit op6, // Encode constant bits let Inst{27-23} = 0b00111; let Inst{21-20} = 0b11; - let Inst{19-18} = 0b10; + let Inst{19-18} = op19_18; let Inst{17-16} = op17_16; let Inst{11} = 0; let Inst{10-8} = op10_8; @@ -2076,8 +2148,7 @@ class N3V op21_20, bits<4> op11_8, bit op6, bit op4, class N3Vnp op27_23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4, dag oops, dag iops,Format f, InstrItinClass itin, - string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy, - SDPatternOperator IntOp, bit Commutable, list pattern> + string OpcodeStr, string Dt, list pattern> : NeonInp { bits<5> Vd;