From: Evan Cheng Date: Fri, 14 Mar 2008 07:39:27 +0000 (+0000) Subject: Fix a number of encoding bugs. SSE 4.1 instructions MPSADBWrri, PINSRDrr, etc. have... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=172b794cd5a6544f8d19263728fc54a1847cc552;p=oota-llvm.git Fix a number of encoding bugs. SSE 4.1 instructions MPSADBWrri, PINSRDrr, etc. have 8-bits immediate field (ImmT == Imm8). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48360 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86Instr64bit.td b/lib/Target/X86/X86Instr64bit.td index d5a9f0bc66f..f3c873e4db2 100644 --- a/lib/Target/X86/X86Instr64bit.td +++ b/lib/Target/X86/X86Instr64bit.td @@ -1322,13 +1322,13 @@ def MOVSDto64mr : RPDI<0x7E, MRMDestMem, (outs), (ins i64mem:$dst, FR64:$src), /// SS41I_extract32 - SSE 4.1 extract 32 bits to int reg or memory destination multiclass SS41I_extract64 opc, string OpcodeStr> { - def rr : SS4AI, OpSize, REX_W; - def mr : SS4AI; let isTwoAddress = 1 in { multiclass SS41I_insert64 opc, string OpcodeStr> { - def rr : SS4AI, OpSize, REX_W; - def rm : SS4AI o, Format F, dag outs, dag ins, string asm, // SSE4.1 Instruction Templates: // // SS48I - SSE 4.1 instructions with T8 prefix. -// SS41AI - SSE 4.1 instructions with TA prefix. +// SS41AIi8 - SSE 4.1 instructions with TA prefix and ImmT == Imm8. // class SS48I o, Format F, dag outs, dag ins, string asm, list pattern> : I, T8, Requires<[HasSSE41]>; -class SS4AI o, Format F, dag outs, dag ins, string asm, +class SS4AIi8 o, Format F, dag outs, dag ins, string asm, list pattern> - : I, TA, Requires<[HasSSE41]>; + : Ii8, TA, Requires<[HasSSE41]>; // X86-64 Instruction templates... diff --git a/lib/Target/X86/X86InstrSSE.td b/lib/Target/X86/X86InstrSSE.td index 0ca9c69c003..c7ca5098a61 100644 --- a/lib/Target/X86/X86InstrSSE.td +++ b/lib/Target/X86/X86InstrSSE.td @@ -3072,7 +3072,7 @@ multiclass sse41_fp_unop_rm opcss, bits<8> opcps, Intrinsic F64Int, Intrinsic V2F64Int> { // Intrinsic operation, reg. - def SSr_Int : SS4AI opcss, bits<8> opcps, OpSize; // Intrinsic operation, mem. - def SSm_Int : SS4AI opcss, bits<8> opcps, OpSize; // Vector intrinsic operation, reg - def PSr_Int : SS4AI opcss, bits<8> opcps, OpSize; // Vector intrinsic operation, mem - def PSm_Int : SS4AI opcss, bits<8> opcps, OpSize; // Intrinsic operation, reg. - def SDr_Int : SS4AI opcss, bits<8> opcps, OpSize; // Intrinsic operation, mem. - def SDm_Int : SS4AI opcss, bits<8> opcps, OpSize; // Vector intrinsic operation, reg - def PDr_Int : SS4AI opcss, bits<8> opcps, OpSize; // Vector intrinsic operation, mem - def PDm_Int : SS4AI; -/// SS41I_binop_rmi_int - SSE 4.1 binary operator with immediate +/// SS41I_binop_rmi_int - SSE 4.1 binary operator with 8-bit immediate let Constraints = "$src1 = $dst" in { multiclass SS41I_binop_rmi_int opc, string OpcodeStr, Intrinsic IntId128, bit Commutable = 0> { - def rri : SS4AI; -/// SS41I_binop_rmi_int - SSE 4.1 binary operator with immediate +/// SS41I_ternary_int - SSE 4.1 ternary operator let Uses = [XMM0], Constraints = "$src1 = $dst" in { multiclass SS41I_ternary_int opc, string OpcodeStr, Intrinsic IntId> { def rr0 : SS48I; /// SS41I_binop_ext8 - SSE 4.1 extract 8 bits to 32 bit reg or 8 bit mem multiclass SS41I_extract8 opc, string OpcodeStr> { - def rr : SS4AI, OpSize; - def mr : SS4AI; /// SS41I_extract16 - SSE 4.1 extract 16 bits to memory destination multiclass SS41I_extract16 opc, string OpcodeStr> { - def mr : SS4AI; /// SS41I_extract32 - SSE 4.1 extract 32 bits to int reg or memory destination multiclass SS41I_extract32 opc, string OpcodeStr> { - def rr : SS4AI, OpSize; - def mr : SS4AI; /// SS41I_extractf32 - SSE 4.1 extract 32 bits to fp reg or memory destination multiclass SS41I_extractf32 opc, string OpcodeStr> { - def rr : SS4AI, OpSize; - def mr : SS4AI; let Constraints = "$src1 = $dst" in { multiclass SS41I_insert8 opc, string OpcodeStr> { - def rr : SS4AI, OpSize; - def rm : SS4AI; let Constraints = "$src1 = $dst" in { multiclass SS41I_insert32 opc, string OpcodeStr> { - def rr : SS4AI, OpSize; - def rm : SS4AI; let Constraints = "$src1 = $dst" in { multiclass SS41I_insertf32 opc, string OpcodeStr> { - def rr : SS4AI, OpSize; - def rm : SS4AI