[AVX512] Fix VFPCLASSSD/VFPCLASSSS intrinsic lowering. The i1 result should be zero extended according to SPEC.

Differential Revision: http://reviews.llvm.org/D23489

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278626 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Igor Breger 2016-08-14 13:58:57 +00:00
parent 96cefd6f44
commit 1a3669b36e
2 changed files with 5 additions and 25 deletions

View File

@ -17951,7 +17951,7 @@ static SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, const X86Subtarget &Subtarget
SDValue FPclass = DAG.getNode(IntrData->Opc0, dl, MVT::i1, Src1, Imm);
SDValue FPclassMask = getScalarMaskingNode(FPclass, Mask,
DAG.getTargetConstant(0, dl, MVT::i1), Subtarget, DAG);
return DAG.getNode(ISD::SIGN_EXTEND, dl, MVT::i8, FPclassMask);
return DAG.getNode(ISD::ZERO_EXTEND, dl, MVT::i8, FPclassMask);
}
case CMP_MASK:
case CMP_MASK_CC: {

View File

@ -490,19 +490,9 @@ define i8 @test_int_x86_avx512_mask_fpclass_sd(<2 x double> %x0, i8 %x1) {
; CHECK-NEXT: andl $1, %edi
; CHECK-NEXT: kmovw %edi, %k1
; CHECK-NEXT: vfpclasssd $2, %xmm0, %k0 {%k1}
; CHECK-NEXT: kmovw %k0, %eax
; CHECK-NEXT: testb %al, %al
; CHECK-NEXT: je LBB28_2
; CHECK-NEXT: ## BB#1:
; CHECK-NEXT: movb $-1, %al
; CHECK-NEXT: LBB28_2:
; CHECK-NEXT: vfpclasssd $4, %xmm0, %k0
; CHECK-NEXT: kmovw %k0, %ecx
; CHECK-NEXT: testb %cl, %cl
; CHECK-NEXT: je LBB28_4
; CHECK-NEXT: ## BB#3:
; CHECK-NEXT: movb $-1, %cl
; CHECK-NEXT: LBB28_4:
; CHECK-NEXT: vfpclasssd $4, %xmm0, %k0
; CHECK-NEXT: kmovw %k0, %eax
; CHECK-NEXT: addb %cl, %al
; CHECK-NEXT: ## kill: %AL<def> %AL<kill> %AX<kill>
; CHECK-NEXT: retq
@ -520,19 +510,9 @@ define i8 @test_int_x86_avx512_mask_fpclass_ss(<4 x float> %x0, i8 %x1) {
; CHECK-NEXT: andl $1, %edi
; CHECK-NEXT: kmovw %edi, %k1
; CHECK-NEXT: vfpclassss $4, %xmm0, %k0 {%k1}
; CHECK-NEXT: kmovw %k0, %eax
; CHECK-NEXT: testb %al, %al
; CHECK-NEXT: je LBB29_2
; CHECK-NEXT: ## BB#1:
; CHECK-NEXT: movb $-1, %al
; CHECK-NEXT: LBB29_2:
; CHECK-NEXT: vfpclassss $4, %xmm0, %k0
; CHECK-NEXT: kmovw %k0, %ecx
; CHECK-NEXT: testb %cl, %cl
; CHECK-NEXT: je LBB29_4
; CHECK-NEXT: ## BB#3:
; CHECK-NEXT: movb $-1, %cl
; CHECK-NEXT: LBB29_4:
; CHECK-NEXT: vfpclassss $4, %xmm0, %k0
; CHECK-NEXT: kmovw %k0, %eax
; CHECK-NEXT: addb %cl, %al
; CHECK-NEXT: ## kill: %AL<def> %AL<kill> %AX<kill>
; CHECK-NEXT: retq