[PATCH] D23808: [X86][SSE] Add lowering to cvttpd2dq/cvttps2dq for sitofp v2f64/2f32 to 2i32

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 17 10:01:13 PDT 2016


RKSimon added a comment.

In https://reviews.llvm.org/D23808#536983, @delena wrote:

> I propose to do the following (I wrote some code to be sure that it works)
>  In ReplaceNodeResults():
>
>   case ISD::FP_TO_SINT: {
>       SDValue V = LowerFP_TO_SINT(SDValue(N, 0), DAG)) {
>       Results.push_back(V);
>       return;
>     }


I've investigated this approach and don't agree with it. Not only would we be introducing illegal return types in lowering code (far more serious than illegal argument types) but the x87 fallback code in ReplaceNodeResults is subtly different to LowerFP_TO_SINT as it replaces the node entries in FP_TO_INTHelper.

> And you need to add some patterns to the .td files for "fp_to_sint" instead of adding a new node type.


Doing so would require us to attempt to introduce illegal types into the td file which we've avoided so far and is unlikely to work.

We already do something similar from CVTPD2PS (2f64 -> 2f32) where we introduced the X86ISD::VFPROUND node. I don't consider X86ISD::CVTTPD2DQ a major intrusion.


Repository:
  rL LLVM

https://reviews.llvm.org/D23808





More information about the llvm-commits mailing list