From 392cd0300d01d21139cec68ba3fd6f2814856138 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sat, 3 Sep 2016 16:28:03 +0000 Subject: [PATCH] [AVX-512] Mark EVEX encoded vpcmpeq as commutable just like its AVX and SSE equivalent. llvm-svn: 280592 --- llvm/lib/Target/X86/X86InstrAVX512.td | 44 ++++++++++++++------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/llvm/lib/Target/X86/X86InstrAVX512.td b/llvm/lib/Target/X86/X86InstrAVX512.td index f5686252cac5..5f3936de6140 100644 --- a/llvm/lib/Target/X86/X86InstrAVX512.td +++ b/llvm/lib/Target/X86/X86InstrAVX512.td @@ -1540,7 +1540,8 @@ let Predicates = [HasAVX512] in { } multiclass avx512_icmp_packed opc, string OpcodeStr, SDNode OpNode, - X86VectorVTInfo _> { + X86VectorVTInfo _, bit IsCommutable> { + let isCommutable = IsCommutable in def rr : AVX512BI opc, string OpcodeStr, SDNode OpNode, } multiclass avx512_icmp_packed_rmb opc, string OpcodeStr, SDNode OpNode, - X86VectorVTInfo _> : - avx512_icmp_packed { + X86VectorVTInfo _, bit IsCommutable> : + avx512_icmp_packed { def rmb : AVX512BI opc, string OpcodeStr, SDNode OpNode, } multiclass avx512_icmp_packed_vl opc, string OpcodeStr, SDNode OpNode, - AVX512VLVectorVTInfo VTInfo, Predicate prd> { + AVX512VLVectorVTInfo VTInfo, Predicate prd, + bit IsCommutable = 0> { let Predicates = [prd] in - defm Z : avx512_icmp_packed, - EVEX_V512; + defm Z : avx512_icmp_packed, EVEX_V512; let Predicates = [prd, HasVLX] in { - defm Z256 : avx512_icmp_packed, - EVEX_V256; - defm Z128 : avx512_icmp_packed, - EVEX_V128; + defm Z256 : avx512_icmp_packed, EVEX_V256; + defm Z128 : avx512_icmp_packed, EVEX_V128; } } multiclass avx512_icmp_packed_rmb_vl opc, string OpcodeStr, SDNode OpNode, AVX512VLVectorVTInfo VTInfo, - Predicate prd> { + Predicate prd, bit IsCommutable = 0> { let Predicates = [prd] in - defm Z : avx512_icmp_packed_rmb, - EVEX_V512; + defm Z : avx512_icmp_packed_rmb, EVEX_V512; let Predicates = [prd, HasVLX] in { - defm Z256 : avx512_icmp_packed_rmb, - EVEX_V256; - defm Z128 : avx512_icmp_packed_rmb, - EVEX_V128; + defm Z256 : avx512_icmp_packed_rmb, EVEX_V256; + defm Z128 : avx512_icmp_packed_rmb, EVEX_V128; } } defm VPCMPEQB : avx512_icmp_packed_vl<0x74, "vpcmpeqb", X86pcmpeqm, - avx512vl_i8_info, HasBWI>, + avx512vl_i8_info, HasBWI, 1>, EVEX_CD8<8, CD8VF>; defm VPCMPEQW : avx512_icmp_packed_vl<0x75, "vpcmpeqw", X86pcmpeqm, - avx512vl_i16_info, HasBWI>, + avx512vl_i16_info, HasBWI, 1>, EVEX_CD8<16, CD8VF>; defm VPCMPEQD : avx512_icmp_packed_rmb_vl<0x76, "vpcmpeqd", X86pcmpeqm, - avx512vl_i32_info, HasAVX512>, + avx512vl_i32_info, HasAVX512, 1>, EVEX_CD8<32, CD8VF>; defm VPCMPEQQ : avx512_icmp_packed_rmb_vl<0x29, "vpcmpeqq", X86pcmpeqm, - avx512vl_i64_info, HasAVX512>, + avx512vl_i64_info, HasAVX512, 1>, T8PD, VEX_W, EVEX_CD8<64, CD8VF>; defm VPCMPGTB : avx512_icmp_packed_vl<0x64, "vpcmpgtb", X86pcmpgtm,