forked from OSchip/llvm-project
[X86] Use ZERO_EXTEND instead of SIGN_EXTEND in the fast isel handling of convert_from_fp16.
This commit is contained in:
parent
fc0c72b2df
commit
391cc4dd41
|
@ -2648,8 +2648,8 @@ bool X86FastISel::fastLowerIntrinsicCall(const IntrinsicInst *II) {
|
|||
ResultReg = fastEmitInst_extractsubreg(MVT::i16, ResultReg, true, RegIdx);
|
||||
} else {
|
||||
assert(Op->getType()->isIntegerTy(16) && "Expected a 16-bit integer!");
|
||||
// Explicitly sign-extend the input to 32-bit.
|
||||
InputReg = fastEmit_r(MVT::i16, MVT::i32, ISD::SIGN_EXTEND, InputReg,
|
||||
// Explicitly zero-extend the input to 32-bit.
|
||||
InputReg = fastEmit_r(MVT::i16, MVT::i32, ISD::ZERO_EXTEND, InputReg,
|
||||
/*Kill=*/false);
|
||||
|
||||
// The following SCALAR_TO_VECTOR will be expanded into a VMOVDI2PDIrr.
|
||||
|
|
|
@ -15,7 +15,7 @@ entry:
|
|||
|
||||
define float @test_fp16_to_fp32(i32 %a) {
|
||||
; CHECK-LABEL: test_fp16_to_fp32:
|
||||
; CHECK: movswl %di, %eax
|
||||
; CHECK: movzwl %di, %eax
|
||||
; CHECK-NEXT: vmovd %eax, %xmm0
|
||||
; CHECK-NEXT: vcvtph2ps %xmm0, %xmm0
|
||||
; CHECK-NEXT: retq
|
||||
|
|
Loading…
Reference in New Issue