From 7be0d2c8e944d0f51db8abb0fb4c8fb7c1bfe8f8 Mon Sep 17 00:00:00 2001 From: Bruno Cardoso Lopes Date: Sat, 12 Jun 2010 01:23:26 +0000 Subject: [PATCH] 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 --- lib/Target/X86/X86InstrFormats.td | 10 ++++++++ lib/Target/X86/X86InstrSSE.td | 20 ++++++++++++++++ lib/Target/X86/X86MCCodeEmitter.cpp | 6 ++++- test/MC/AsmParser/X86/x86_32-encoding.s | 31 ++++++++++++++++++++++++ test/MC/AsmParser/X86/x86_64-encoding.s | 32 +++++++++++++++++++++++++ 5 files changed, 98 insertions(+), 1 deletion(-) diff --git a/lib/Target/X86/X86InstrFormats.td b/lib/Target/X86/X86InstrFormats.td index 1c4301c7038..5c422e7cd45 100644 --- a/lib/Target/X86/X86InstrFormats.td +++ b/lib/Target/X86/X86InstrFormats.td @@ -220,6 +220,7 @@ class Iseg32 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 o, Format F, dag outs, dag ins, string asm, list pattern> : I, XS, Requires<[HasSSE1]>; @@ -237,6 +238,10 @@ class VSSI o, Format F, dag outs, dag ins, string asm, list pattern> : I, XS, VEX_4V, Requires<[HasAVX, HasSSE1]>; +class VPSI o, Format F, dag outs, dag ins, string asm, + list pattern> + : I, + VEX_4V, Requires<[HasAVX, HasSSE1]>; // SSE2 Instruction Templates: // @@ -246,6 +251,7 @@ class VSSI 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 o, Format F, dag outs, dag ins, string asm, list pattern> : I, XD, Requires<[HasSSE2]>; @@ -266,6 +272,10 @@ class VSDI o, Format F, dag outs, dag ins, string asm, list pattern> : I, XD, VEX_4V, Requires<[HasAVX, HasSSE2]>; +class VPDI o, Format F, dag outs, dag ins, string asm, + list pattern> + : I, + VEX_4V, OpSize, Requires<[HasAVX, HasSSE2]>; // SSE3 Instruction Templates: // diff --git a/lib/Target/X86/X86InstrSSE.td b/lib/Target/X86/X86InstrSSE.td index fe66d8b011e..945d69f9e26 100644 --- a/lib/Target/X86/X86InstrSSE.td +++ b/lib/Target/X86/X86InstrSSE.td @@ -737,6 +737,26 @@ multiclass basic_sse12_fp_binop_rm opc, string OpcodeStr, let isCommutable = Commutable; } + def V#NAME#PSrr : VPSI { + let isCommutable = Commutable; + let Constraints = ""; + let isAsmParserOnly = 1; + } + + def V#NAME#PDrr : VPDI { + let isCommutable = Commutable; + let Constraints = ""; + let isAsmParserOnly = 1; + } + // Vector operation, reg+mem. def PSrm : PSI