From 2c70d4ad35e6a7beddb0b65d9176ede77ea5683e Mon Sep 17 00:00:00 2001 From: Bruno Cardoso Lopes Date: Sat, 3 Jul 2010 00:37:44 +0000 Subject: Add AVX SSE4.1 round instructions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107549 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrSSE.td | 76 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) (limited to 'lib') diff --git a/lib/Target/X86/X86InstrSSE.td b/lib/Target/X86/X86InstrSSE.td index c0efb78..39013c5 100644 --- a/lib/Target/X86/X86InstrSSE.td +++ b/lib/Target/X86/X86InstrSSE.td @@ -3948,6 +3948,38 @@ multiclass sse41_fp_unop_rm opcps, bits<8> opcpd, OpSize; } +multiclass sse41_fp_unop_rm_avx opcps, bits<8> opcpd, + string OpcodeStr> { + // Intrinsic operation, reg. + // Vector intrinsic operation, reg + def PSr : SS4AIi8, OpSize; + + // Vector intrinsic operation, mem + def PSm : Ii8, TA, OpSize, Requires<[HasSSE41]>; + + // Vector intrinsic operation, reg + def PDr : SS4AIi8, OpSize; + + // Vector intrinsic operation, mem + def PDm : SS4AIi8, OpSize; +} + multiclass sse41_fp_binop_rm opcss, bits<8> opcsd, string OpcodeStr, Intrinsic F32Int, @@ -3999,7 +4031,51 @@ multiclass sse41_fp_binop_rm opcss, bits<8> opcsd, OpSize; } +multiclass sse41_fp_binop_rm_avx opcss, bits<8> opcsd, + string OpcodeStr> { + // Intrinsic operation, reg. + def SSr : SS4AIi8, OpSize; + + // Intrinsic operation, mem. + def SSm : SS4AIi8, OpSize; + + // Intrinsic operation, reg. + def SDr : SS4AIi8, OpSize; + + // Intrinsic operation, mem. + def SDm : SS4AIi8, OpSize; +} + // FP round - roundss, roundps, roundsd, roundpd +let isAsmParserOnly = 1, Predicates = [HasAVX, HasSSE41] in { + // Intrinsic form + defm VROUND : sse41_fp_unop_rm<0x08, 0x09, "vround", + int_x86_sse41_round_ps, int_x86_sse41_round_pd>, + VEX; + defm VROUND : sse41_fp_binop_rm<0x0A, 0x0B, "vround", + int_x86_sse41_round_ss, int_x86_sse41_round_sd, + 0>, VEX_4V; + // Instructions for the assembler + defm VROUND : sse41_fp_unop_rm_avx<0x08, 0x09, "vround">, VEX; + defm VROUND : sse41_fp_binop_rm_avx<0x0A, 0x0B, "vround">, VEX_4V; +} + defm ROUND : sse41_fp_unop_rm<0x08, 0x09, "round", int_x86_sse41_round_ps, int_x86_sse41_round_pd>; let Constraints = "$src1 = $dst" in -- cgit v1.1