[PATCH] D70214: [X86] Add custom type legalization and lowering for scalar STRICT_FP_TO_SINT/UINT

Andy Kaylor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 14:55:04 PST 2019


andrew.w.kaylor added inline comments.


================
Comment at: llvm/test/CodeGen/X86/fp-intrinsics.ll:714
 ; SSE:       # %bb.0: # %entry
+; SSE-NEXT:    cvttsd2si %xmm0, %rax
+; SSE-NEXT:    # kill: def $eax killed $eax killed $rax
----------------
This is wrong for the strict case. If the converted value doesn't fit in the destination range, the invalid flag is supposed to be raised. Likewise with the AVX case below. Possibly also the x87 case above.


================
Comment at: llvm/test/CodeGen/X86/fp-intrinsics.ll:716
+; SSE-NEXT:    # kill: def $eax killed $eax killed $rax
+; SSE-NEXT:    retq
+;
----------------
Why is this retq?


================
Comment at: llvm/test/CodeGen/X86/fp-intrinsics.ll:735
+; Verify that fptoui(%x) isn't simplified when the rounding mode is
+; unknown. The expansion should have only one conversion instruction.
+; Verify that no gross errors happen.
----------------
This comment seems wrong.


================
Comment at: llvm/test/CodeGen/X86/fp-intrinsics.ll:740
+; X87:       # %bb.0: # %entry
+; X87-NEXT:    subl $20, %esp
+; X87-NEXT:    .cfi_def_cfa_offset 24
----------------
I don't think this sequence or the SSE and AVX sequences are correct for strictfp.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70214/new/

https://reviews.llvm.org/D70214





More information about the llvm-commits mailing list