aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2019-11-12 22:44:48 -0800
committerCraig Topper <craig.topper@gmail.com>2019-11-12 22:45:52 -0800
commita4b7613a49741e7faa284641b0a9830275371a24 (patch)
tree9cb3a68a909ef3383a4e801bb6e795f2370e4471 /llvm/lib
parent7be6ec5fa210620e63148e38fd241e41a40a07be (diff)
downloadllvm-a4b7613a49741e7faa284641b0a9830275371a24.zip
llvm-a4b7613a49741e7faa284641b0a9830275371a24.tar.gz
llvm-a4b7613a49741e7faa284641b0a9830275371a24.tar.bz2
[X86] Remove setOperationAction for FP_TO_SINT v8i16.
This is no longer needed after widening legalization as we custom legalize v8i8 ourselves. Added entries to the cost model, but bumped the cost slightly to account for the truncate shuffle that wasn't costed before.
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp8
-rw-r--r--llvm/lib/Target/X86/X86TargetTransformInfo.cpp3
2 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 6257716..e7fe403 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -937,14 +937,6 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
setOperationAction(ISD::FP_TO_UINT, MVT::v2i16, Custom);
setOperationAction(ISD::FP_TO_UINT, MVT::v4i16, Custom);
- // By marking FP_TO_SINT v8i16 as Custom, will trick type legalization into
- // promoting v8i8 FP_TO_UINT into FP_TO_SINT. When the v8i16 FP_TO_SINT is
- // split again based on the input type, this will cause an AssertSExt i16 to
- // be emitted instead of an AssertZExt. This will allow packssdw followed by
- // packuswb to be used to truncate to v8i8. This is necessary since packusdw
- // isn't available until sse4.1.
- setOperationAction(ISD::FP_TO_SINT, MVT::v8i16, Custom);
-
setOperationAction(ISD::SINT_TO_FP, MVT::v4i32, Legal);
setOperationAction(ISD::SINT_TO_FP, MVT::v2i32, Custom);
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index b4db1cc..0b3a531 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -1576,6 +1576,9 @@ int X86TTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
{ ISD::UINT_TO_FP, MVT::v2f64, MVT::v2i64, 6 },
{ ISD::UINT_TO_FP, MVT::v4f32, MVT::v2i64, 15 },
+ { ISD::FP_TO_SINT, MVT::v4i16, MVT::v4f32, 2 },
+ { ISD::FP_TO_SINT, MVT::v2i16, MVT::v2f64, 2 },
+
{ ISD::FP_TO_SINT, MVT::v2i32, MVT::v2f64, 3 },
{ ISD::UINT_TO_FP, MVT::f64, MVT::i64, 6 },