diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2010-06-12 01:23:26 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2010-06-12 01:23:26 +0000 |
commit | 8f14e9991b05321f0d39959516984d2ddd45d285 (patch) | |
tree | c16ad2adae44903e7fd9297ba92f2a573c896eeb /lib | |
parent | f4fba53483a529e8f3adc304a811dd7bd3937854 (diff) | |
download | external_llvm-8f14e9991b05321f0d39959516984d2ddd45d285.zip external_llvm-8f14e9991b05321f0d39959516984d2ddd45d285.tar.gz external_llvm-8f14e9991b05321f0d39959516984d2ddd45d285.tar.bz2 |
More AVX: {ADD,SUB,MUL,DIV}{PD,PS}rr
Handle OpSize TSFlag for AVX
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105869 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/X86/X86InstrFormats.td | 10 | ||||
-rw-r--r-- | lib/Target/X86/X86InstrSSE.td | 20 | ||||
-rw-r--r-- | lib/Target/X86/X86MCCodeEmitter.cpp | 6 |
3 files changed, 35 insertions, 1 deletions
diff --git a/lib/Target/X86/X86InstrFormats.td b/lib/Target/X86/X86InstrFormats.td index 1c4301c..5c422e7 100644 --- a/lib/Target/X86/X86InstrFormats.td +++ b/lib/Target/X86/X86InstrFormats.td @@ -220,6 +220,7 @@ class Iseg32 <bits<8> o, Format f, dag outs, dag ins, string asm, // PSI - SSE1 instructions with TB prefix. // PSIi8 - SSE1 instructions with ImmT == Imm8 and TB prefix. // VSSI - SSE1 instructions with XS prefix in AVX form. +// VPSI - SSE1 instructions with TB prefix in AVX form. class SSI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern> : I<o, F, outs, ins, asm, pattern>, XS, Requires<[HasSSE1]>; @@ -237,6 +238,10 @@ class VSSI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern> : I<o, F, outs, ins, !strconcat("v", asm), pattern>, XS, VEX_4V, Requires<[HasAVX, HasSSE1]>; +class VPSI<bits<8> o, Format F, dag outs, dag ins, string asm, + list<dag> pattern> + : I<o, F, outs, ins, !strconcat("v", asm), pattern, SSEPackedSingle>, + VEX_4V, Requires<[HasAVX, HasSSE1]>; // SSE2 Instruction Templates: // @@ -246,6 +251,7 @@ class VSSI<bits<8> o, Format F, dag outs, dag ins, string asm, // PDI - SSE2 instructions with TB and OpSize prefixes. // PDIi8 - SSE2 instructions with ImmT == Imm8 and TB and OpSize prefixes. // VSDI - SSE2 instructions with XD prefix in AVX form. +// VPDI - SSE2 instructions with TB and OpSize prefixes in AVX form. class SDI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern> : I<o, F, outs, ins, asm, pattern>, XD, Requires<[HasSSE2]>; @@ -266,6 +272,10 @@ class VSDI<bits<8> o, Format F, dag outs, dag ins, string asm, list<dag> pattern> : I<o, F, outs, ins, !strconcat("v", asm), pattern>, XD, VEX_4V, Requires<[HasAVX, HasSSE2]>; +class VPDI<bits<8> o, Format F, dag outs, dag ins, string asm, + list<dag> pattern> + : I<o, F, outs, ins, !strconcat("v", asm), pattern, SSEPackedDouble>, + VEX_4V, OpSize, Requires<[HasAVX, HasSSE2]>; // SSE3 Instruction Templates: // diff --git a/lib/Target/X86/X86InstrSSE.td b/lib/Target/X86/X86InstrSSE.td index fe66d8b..945d69f 100644 --- a/lib/Target/X86/X86InstrSSE.td +++ b/lib/Target/X86/X86InstrSSE.td @@ -737,6 +737,26 @@ multiclass basic_sse12_fp_binop_rm<bits<8> opc, string OpcodeStr, let isCommutable = Commutable; } + def V#NAME#PSrr : VPSI<opc, MRMSrcReg, (outs VR128:$dst), + (ins VR128:$src1, VR128:$src2), + !strconcat(OpcodeStr, + "ps\t{$src2, $src1, $dst|$dst, $src1, $src2}"), + []> { + let isCommutable = Commutable; + let Constraints = ""; + let isAsmParserOnly = 1; + } + + def V#NAME#PDrr : VPDI<opc, MRMSrcReg, (outs VR128:$dst), + (ins VR128:$src1, VR128:$src2), + !strconcat(OpcodeStr, + "pd\t{$src2, $src1, $dst|$dst, $src1, $src2}"), + []> { + let isCommutable = Commutable; + let Constraints = ""; + let isAsmParserOnly = 1; + } + // Vector operation, reg+mem. def PSrm : PSI<opc, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), diff --git a/lib/Target/X86/X86MCCodeEmitter.cpp b/lib/Target/X86/X86MCCodeEmitter.cpp index adf4999..d553b74 100644 --- a/lib/Target/X86/X86MCCodeEmitter.cpp +++ b/lib/Target/X86/X86MCCodeEmitter.cpp @@ -392,12 +392,16 @@ void X86MCCodeEmitter::EmitVEXOpcodePrefix(uint64_t TSFlags, unsigned &CurByte, // functionality of a SIMD prefix // // 0b00: None - // 0b01: 66 (not handled yet) + // 0b01: 66 // 0b10: F3 // 0b11: F2 // unsigned char VEX_PP = 0; + // Encode the operand size opcode prefix as needed. + if (TSFlags & X86II::OpSize) + VEX_PP = 0x01; + switch (TSFlags & X86II::Op0Mask) { default: assert(0 && "Invalid prefix!"); case 0: break; // No prefix! |