diff --git a/llvm/lib/Target/X86/InstPrinter/X86InstComments.cpp b/llvm/lib/Target/X86/InstPrinter/X86InstComments.cpp index 98c3a03dfe94..97e9ee3519bf 100644 --- a/llvm/lib/Target/X86/InstPrinter/X86InstComments.cpp +++ b/llvm/lib/Target/X86/InstPrinter/X86InstComments.cpp @@ -132,6 +132,14 @@ using namespace llvm; CASE_AVX512_INS_COMMON(Inst, Z256, src##i) \ CASE_AVX_INS_COMMON(Inst, Y, src##i) +#define CASE_MASK_VPERM(Inst, src) \ + CASE_MASK_INS_COMMON(Inst, Z, src##i) \ + CASE_MASK_INS_COMMON(Inst, Z256, src##i) + +#define CASE_MASKZ_VPERM(Inst, src) \ + CASE_MASKZ_INS_COMMON(Inst, Z, src##i) \ + CASE_MASKZ_INS_COMMON(Inst, Z256, src##i) + #define CASE_VSHUF(Inst, src) \ CASE_AVX512_INS_COMMON(SHUFF##Inst, Z, r##src##i) \ CASE_AVX512_INS_COMMON(SHUFI##Inst, Z, r##src##i) \ @@ -261,6 +269,10 @@ static std::string getMaskName(const MCInst *MI, const char *DestName, CASE_MASKZ_VPERMILPI(PSHUFHW, r) CASE_MASKZ_VPERMILPI(PSHUFLW, m) CASE_MASKZ_VPERMILPI(PSHUFLW, r) + CASE_MASKZ_VPERM(PERMPD, m) + CASE_MASKZ_VPERM(PERMPD, r) + CASE_MASKZ_VPERM(PERMQ, m) + CASE_MASKZ_VPERM(PERMQ, r) CASE_MASKZ_VSHUF(64X2, m) CASE_MASKZ_VSHUF(64X2, r) CASE_MASKZ_VSHUF(32X4, m) @@ -322,6 +334,10 @@ static std::string getMaskName(const MCInst *MI, const char *DestName, CASE_MASK_VPERMILPI(PSHUFHW, r) CASE_MASK_VPERMILPI(PSHUFLW, m) CASE_MASK_VPERMILPI(PSHUFLW, r) + CASE_MASK_VPERM(PERMPD, m) + CASE_MASK_VPERM(PERMPD, r) + CASE_MASK_VPERM(PERMQ, m) + CASE_MASK_VPERM(PERMQ, r) CASE_MASK_VSHUF(64X2, m) CASE_MASK_VSHUF(64X2, r) CASE_MASK_VSHUF(32X4, m) diff --git a/llvm/test/CodeGen/X86/avx512-intrinsics.ll b/llvm/test/CodeGen/X86/avx512-intrinsics.ll index 13f59dcd4f08..6041832ed07d 100644 --- a/llvm/test/CodeGen/X86/avx512-intrinsics.ll +++ b/llvm/test/CodeGen/X86/avx512-intrinsics.ll @@ -6352,8 +6352,8 @@ define <8 x double>@test_int_x86_avx512_mask_perm_df_512(<8 x double> %x0, i32 % ; CHECK-LABEL: test_int_x86_avx512_mask_perm_df_512: ; CHECK: ## BB#0: ; CHECK-NEXT: kmovw %esi, %k1 -; CHECK-NEXT: vpermpd {{.*#+}} zmm1 = zmm0[3,0,0,0,7,4,4,4] -; CHECK-NEXT: vpermpd {{.*#+}} zmm2 = zmm0[3,0,0,0,7,4,4,4] +; CHECK-NEXT: vpermpd {{.*#+}} zmm1 {%k1} = zmm0[3,0,0,0,7,4,4,4] +; CHECK-NEXT: vpermpd {{.*#+}} zmm2 {%k1} {z} = zmm0[3,0,0,0,7,4,4,4] ; CHECK-NEXT: vpermpd {{.*#+}} zmm0 = zmm0[3,0,0,0,7,4,4,4] ; CHECK-NEXT: vaddpd %zmm2, %zmm1, %zmm1 ; CHECK-NEXT: vaddpd %zmm0, %zmm1, %zmm0 @@ -6372,8 +6372,8 @@ define <8 x i64>@test_int_x86_avx512_mask_perm_di_512(<8 x i64> %x0, i32 %x1, <8 ; CHECK-LABEL: test_int_x86_avx512_mask_perm_di_512: ; CHECK: ## BB#0: ; CHECK-NEXT: kmovw %esi, %k1 -; CHECK-NEXT: vpermq {{.*#+}} zmm1 = zmm0[3,0,0,0,7,4,4,4] -; CHECK-NEXT: vpermq {{.*#+}} zmm2 = zmm0[3,0,0,0,7,4,4,4] +; CHECK-NEXT: vpermq {{.*#+}} zmm1 {%k1} = zmm0[3,0,0,0,7,4,4,4] +; CHECK-NEXT: vpermq {{.*#+}} zmm2 {%k1} {z} = zmm0[3,0,0,0,7,4,4,4] ; CHECK-NEXT: vpermq {{.*#+}} zmm0 = zmm0[3,0,0,0,7,4,4,4] ; CHECK-NEXT: vpaddq %zmm2, %zmm1, %zmm1 ; CHECK-NEXT: vpaddq %zmm0, %zmm1, %zmm0 diff --git a/llvm/test/CodeGen/X86/avx512vl-intrinsics.ll b/llvm/test/CodeGen/X86/avx512vl-intrinsics.ll index d951b406396d..f31a57f5dce7 100644 --- a/llvm/test/CodeGen/X86/avx512vl-intrinsics.ll +++ b/llvm/test/CodeGen/X86/avx512vl-intrinsics.ll @@ -8076,9 +8076,9 @@ define <4 x double>@test_int_x86_avx512_mask_perm_df_256(<4 x double> %x0, i32 % ; CHECK: ## BB#0: ; CHECK-NEXT: kmovw %esi, %k1 ## encoding: [0xc5,0xf8,0x92,0xce] ; CHECK-NEXT: vpermpd $3, %ymm0, %ymm1 {%k1} ## encoding: [0x62,0xf3,0xfd,0x29,0x01,0xc8,0x03] -; CHECK-NEXT: ## ymm1 = ymm0[3,0,0,0] +; CHECK-NEXT: ## ymm1 {%k1} = ymm0[3,0,0,0] ; CHECK-NEXT: vpermpd $3, %ymm0, %ymm2 {%k1} {z} ## encoding: [0x62,0xf3,0xfd,0xa9,0x01,0xd0,0x03] -; CHECK-NEXT: ## ymm2 = ymm0[3,0,0,0] +; CHECK-NEXT: ## ymm2 {%k1} {z} = ymm0[3,0,0,0] ; CHECK-NEXT: vpermpd $3, %ymm0, %ymm0 ## encoding: [0x62,0xf3,0xfd,0x28,0x01,0xc0,0x03] ; CHECK-NEXT: ## ymm0 = ymm0[3,0,0,0] ; CHECK-NEXT: vaddpd %ymm2, %ymm1, %ymm1 ## encoding: [0x62,0xf1,0xf5,0x28,0x58,0xca] @@ -8099,9 +8099,9 @@ define <4 x i64>@test_int_x86_avx512_mask_perm_di_256(<4 x i64> %x0, i32 %x1, <4 ; CHECK: ## BB#0: ; CHECK-NEXT: kmovw %esi, %k1 ## encoding: [0xc5,0xf8,0x92,0xce] ; CHECK-NEXT: vpermq $3, %ymm0, %ymm1 {%k1} ## encoding: [0x62,0xf3,0xfd,0x29,0x00,0xc8,0x03] -; CHECK-NEXT: ## ymm1 = ymm0[3,0,0,0] +; CHECK-NEXT: ## ymm1 {%k1} = ymm0[3,0,0,0] ; CHECK-NEXT: vpermq $3, %ymm0, %ymm2 {%k1} {z} ## encoding: [0x62,0xf3,0xfd,0xa9,0x00,0xd0,0x03] -; CHECK-NEXT: ## ymm2 = ymm0[3,0,0,0] +; CHECK-NEXT: ## ymm2 {%k1} {z} = ymm0[3,0,0,0] ; CHECK-NEXT: vpermq $3, %ymm0, %ymm0 ## encoding: [0x62,0xf3,0xfd,0x28,0x00,0xc0,0x03] ; CHECK-NEXT: ## ymm0 = ymm0[3,0,0,0] ; CHECK-NEXT: vpaddq %ymm2, %ymm1, %ymm1 ## encoding: [0x62,0xf1,0xf5,0x28,0xd4,0xca]