diff options
author | Craig Topper <craig.topper@intel.com> | 2019-02-15 21:59:33 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2019-02-15 21:59:33 +0000 |
commit | db2f084aa9dc062f95c9d630be9acfa7b8394b35 (patch) | |
tree | e84896e61d77c9e7952ee268ac3e4ef737f8711f /llvm/test/CodeGen/X86/fp-cvt.ll | |
parent | 1c29801615427fe07927f1179ee017e2351c09e0 (diff) | |
download | bcm5719-llvm-db2f084aa9dc062f95c9d630be9acfa7b8394b35.tar.gz bcm5719-llvm-db2f084aa9dc062f95c9d630be9acfa7b8394b35.zip |
[X86] Don't set exception mask bits when modifying FPCW to change rounding mode for fp->int conversion
When we need to do an fp->int conversion using x87 instructions, we need to temporarily change the rounding mode to 0b11 and perform a store. To do this we save the old value of the fpcw to the stack, then set the fpcw to 0xc7f, do the store, then restore fpcw. But the 0xc7f value forces the exception mask bits 1. While this is what they would be in the default FP environment, as we move to support changing the FP environments, we shouldn't make this assumption.
This patch changes the code to explicitly OR 0xc00 with the old value so that only the rounding mode is changed. Unfortunately, this requires two stack temporaries instead of one. One to hold the old value and one to hold the new value. Without two stack temporaries we would need an additional GPR. We already need one to do the OR operation in. This is similar to what gcc and icc do for this operation. Though they are both better at reusing the stack temporaries when there are multiple truncates in a function(or at least in a basic block)
Differential Revision: https://reviews.llvm.org/D57788
llvm-svn: 354178
Diffstat (limited to 'llvm/test/CodeGen/X86/fp-cvt.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/fp-cvt.ll | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/llvm/test/CodeGen/X86/fp-cvt.ll b/llvm/test/CodeGen/X86/fp-cvt.ll index b087e759c70..be09718eaac 100644 --- a/llvm/test/CodeGen/X86/fp-cvt.ll +++ b/llvm/test/CodeGen/X86/fp-cvt.ll @@ -10,17 +10,17 @@ define i16 @fptosi_i16_fp80(x86_fp80 %a0) nounwind { ; X86-LABEL: fptosi_i16_fp80: ; X86: # %bb.0: -; X86-NEXT: pushl %eax +; X86-NEXT: subl $8, %esp ; X86-NEXT: fldt {{[0-9]+}}(%esp) -; X86-NEXT: fnstcw (%esp) -; X86-NEXT: movzwl (%esp), %eax -; X86-NEXT: movw $3199, (%esp) # imm = 0xC7F -; X86-NEXT: fldcw (%esp) -; X86-NEXT: movw %ax, (%esp) +; X86-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-NEXT: fldcw {{[0-9]+}}(%esp) ; X86-NEXT: fistps {{[0-9]+}}(%esp) -; X86-NEXT: fldcw (%esp) +; X86-NEXT: fldcw {{[0-9]+}}(%esp) ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-NEXT: popl %ecx +; X86-NEXT: addl $8, %esp ; X86-NEXT: retl ; ; X64-X87-LABEL: fptosi_i16_fp80: @@ -28,9 +28,9 @@ define i16 @fptosi_i16_fp80(x86_fp80 %a0) nounwind { ; X64-X87-NEXT: fldt {{[0-9]+}}(%rsp) ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax -; X64-X87-NEXT: movw $3199, -{{[0-9]+}}(%rsp) # imm = 0xC7F -; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fistps -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax @@ -49,18 +49,18 @@ define i16 @fptosi_i16_fp80(x86_fp80 %a0) nounwind { define i16 @fptosi_i16_fp80_ld(x86_fp80 *%a0) nounwind { ; X86-LABEL: fptosi_i16_fp80_ld: ; X86: # %bb.0: -; X86-NEXT: pushl %eax +; X86-NEXT: subl $8, %esp ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax ; X86-NEXT: fldt (%eax) -; X86-NEXT: fnstcw (%esp) -; X86-NEXT: movzwl (%esp), %eax -; X86-NEXT: movw $3199, (%esp) # imm = 0xC7F -; X86-NEXT: fldcw (%esp) -; X86-NEXT: movw %ax, (%esp) +; X86-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-NEXT: fldcw {{[0-9]+}}(%esp) ; X86-NEXT: fistps {{[0-9]+}}(%esp) -; X86-NEXT: fldcw (%esp) +; X86-NEXT: fldcw {{[0-9]+}}(%esp) ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-NEXT: popl %ecx +; X86-NEXT: addl $8, %esp ; X86-NEXT: retl ; ; X64-X87-LABEL: fptosi_i16_fp80_ld: @@ -68,9 +68,9 @@ define i16 @fptosi_i16_fp80_ld(x86_fp80 *%a0) nounwind { ; X64-X87-NEXT: fldt (%rdi) ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax -; X64-X87-NEXT: movw $3199, -{{[0-9]+}}(%rsp) # imm = 0xC7F -; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fistps -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax @@ -92,13 +92,13 @@ define i32 @fptosi_i32_fp80(x86_fp80 %a0) nounwind { ; X86: # %bb.0: ; X86-NEXT: subl $8, %esp ; X86-NEXT: fldt {{[0-9]+}}(%esp) -; X86-NEXT: fnstcw {{[0-9]+}}(%esp) -; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-NEXT: movw $3199, {{[0-9]+}}(%esp) # imm = 0xC7F -; X86-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-NEXT: fnstcw (%esp) +; X86-NEXT: movzwl (%esp), %eax +; X86-NEXT: orl $3072, %eax # imm = 0xC00 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X86-NEXT: fistpl {{[0-9]+}}(%esp) ; X86-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-NEXT: fistpl {{[0-9]+}}(%esp) +; X86-NEXT: fldcw (%esp) ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax ; X86-NEXT: addl $8, %esp ; X86-NEXT: retl @@ -108,9 +108,9 @@ define i32 @fptosi_i32_fp80(x86_fp80 %a0) nounwind { ; X64-X87-NEXT: fldt {{[0-9]+}}(%rsp) ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax -; X64-X87-NEXT: movw $3199, -{{[0-9]+}}(%rsp) # imm = 0xC7F -; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fistpl -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movl -{{[0-9]+}}(%rsp), %eax @@ -132,13 +132,13 @@ define i32 @fptosi_i32_fp80_ld(x86_fp80 *%a0) nounwind { ; X86-NEXT: subl $8, %esp ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax ; X86-NEXT: fldt (%eax) -; X86-NEXT: fnstcw {{[0-9]+}}(%esp) -; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-NEXT: movw $3199, {{[0-9]+}}(%esp) # imm = 0xC7F -; X86-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-NEXT: fnstcw (%esp) +; X86-NEXT: movzwl (%esp), %eax +; X86-NEXT: orl $3072, %eax # imm = 0xC00 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X86-NEXT: fistpl {{[0-9]+}}(%esp) ; X86-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-NEXT: fistpl {{[0-9]+}}(%esp) +; X86-NEXT: fldcw (%esp) ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax ; X86-NEXT: addl $8, %esp ; X86-NEXT: retl @@ -148,9 +148,9 @@ define i32 @fptosi_i32_fp80_ld(x86_fp80 *%a0) nounwind { ; X64-X87-NEXT: fldt (%rdi) ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax -; X64-X87-NEXT: movw $3199, -{{[0-9]+}}(%rsp) # imm = 0xC7F -; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fistpl -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movl -{{[0-9]+}}(%rsp), %eax @@ -177,9 +177,9 @@ define i64 @fptosi_i64_fp80(x86_fp80 %a0) nounwind { ; X86-NEXT: fldt 8(%ebp) ; X86-NEXT: fnstcw {{[0-9]+}}(%esp) ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-NEXT: movw $3199, {{[0-9]+}}(%esp) # imm = 0xC7F -; X86-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-NEXT: orl $3072, %eax # imm = 0xC00 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-NEXT: fldcw {{[0-9]+}}(%esp) ; X86-NEXT: fistpll {{[0-9]+}}(%esp) ; X86-NEXT: fldcw {{[0-9]+}}(%esp) ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax @@ -193,9 +193,9 @@ define i64 @fptosi_i64_fp80(x86_fp80 %a0) nounwind { ; X64-X87-NEXT: fldt {{[0-9]+}}(%rsp) ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax -; X64-X87-NEXT: movw $3199, -{{[0-9]+}}(%rsp) # imm = 0xC7F -; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fistpll -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movq -{{[0-9]+}}(%rsp), %rax @@ -222,9 +222,9 @@ define i64 @fptosi_i64_fp80_ld(x86_fp80 *%a0) nounwind { ; X86-NEXT: fldt (%eax) ; X86-NEXT: fnstcw {{[0-9]+}}(%esp) ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-NEXT: movw $3199, {{[0-9]+}}(%esp) # imm = 0xC7F -; X86-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-NEXT: orl $3072, %eax # imm = 0xC00 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-NEXT: fldcw {{[0-9]+}}(%esp) ; X86-NEXT: fistpll {{[0-9]+}}(%esp) ; X86-NEXT: fldcw {{[0-9]+}}(%esp) ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax @@ -238,9 +238,9 @@ define i64 @fptosi_i64_fp80_ld(x86_fp80 *%a0) nounwind { ; X64-X87-NEXT: fldt (%rdi) ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax -; X64-X87-NEXT: movw $3199, -{{[0-9]+}}(%rsp) # imm = 0xC7F -; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fistpll -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movq -{{[0-9]+}}(%rsp), %rax @@ -266,13 +266,13 @@ define i16 @fptoui_i16_fp80(x86_fp80 %a0) nounwind { ; X86: # %bb.0: ; X86-NEXT: subl $8, %esp ; X86-NEXT: fldt {{[0-9]+}}(%esp) -; X86-NEXT: fnstcw {{[0-9]+}}(%esp) -; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-NEXT: movw $3199, {{[0-9]+}}(%esp) # imm = 0xC7F -; X86-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-NEXT: fnstcw (%esp) +; X86-NEXT: movzwl (%esp), %eax +; X86-NEXT: orl $3072, %eax # imm = 0xC00 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X86-NEXT: fistpl {{[0-9]+}}(%esp) ; X86-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-NEXT: fistpl {{[0-9]+}}(%esp) +; X86-NEXT: fldcw (%esp) ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax ; X86-NEXT: # kill: def $ax killed $ax killed $eax ; X86-NEXT: addl $8, %esp @@ -283,9 +283,9 @@ define i16 @fptoui_i16_fp80(x86_fp80 %a0) nounwind { ; X64-X87-NEXT: fldt {{[0-9]+}}(%rsp) ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax -; X64-X87-NEXT: movw $3199, -{{[0-9]+}}(%rsp) # imm = 0xC7F -; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fistpl -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movl -{{[0-9]+}}(%rsp), %eax @@ -309,13 +309,13 @@ define i16 @fptoui_i16_fp80_ld(x86_fp80 *%a0) nounwind { ; X86-NEXT: subl $8, %esp ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax ; X86-NEXT: fldt (%eax) -; X86-NEXT: fnstcw {{[0-9]+}}(%esp) -; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-NEXT: movw $3199, {{[0-9]+}}(%esp) # imm = 0xC7F -; X86-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-NEXT: fnstcw (%esp) +; X86-NEXT: movzwl (%esp), %eax +; X86-NEXT: orl $3072, %eax # imm = 0xC00 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X86-NEXT: fistpl {{[0-9]+}}(%esp) ; X86-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-NEXT: fistpl {{[0-9]+}}(%esp) +; X86-NEXT: fldcw (%esp) ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax ; X86-NEXT: # kill: def $ax killed $ax killed $eax ; X86-NEXT: addl $8, %esp @@ -326,9 +326,9 @@ define i16 @fptoui_i16_fp80_ld(x86_fp80 *%a0) nounwind { ; X64-X87-NEXT: fldt (%rdi) ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax -; X64-X87-NEXT: movw $3199, -{{[0-9]+}}(%rsp) # imm = 0xC7F -; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fistpl -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movl -{{[0-9]+}}(%rsp), %eax @@ -357,9 +357,9 @@ define i32 @fptoui_i32_fp80(x86_fp80 %a0) nounwind { ; X86-NEXT: fldt 8(%ebp) ; X86-NEXT: fnstcw {{[0-9]+}}(%esp) ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-NEXT: movw $3199, {{[0-9]+}}(%esp) # imm = 0xC7F -; X86-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-NEXT: orl $3072, %eax # imm = 0xC00 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-NEXT: fldcw {{[0-9]+}}(%esp) ; X86-NEXT: fistpll {{[0-9]+}}(%esp) ; X86-NEXT: fldcw {{[0-9]+}}(%esp) ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax @@ -372,9 +372,9 @@ define i32 @fptoui_i32_fp80(x86_fp80 %a0) nounwind { ; X64-X87-NEXT: fldt {{[0-9]+}}(%rsp) ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax -; X64-X87-NEXT: movw $3199, -{{[0-9]+}}(%rsp) # imm = 0xC7F -; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fistpll -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movl -{{[0-9]+}}(%rsp), %eax @@ -401,9 +401,9 @@ define i32 @fptoui_i32_fp80_ld(x86_fp80 *%a0) nounwind { ; X86-NEXT: fldt (%eax) ; X86-NEXT: fnstcw {{[0-9]+}}(%esp) ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-NEXT: movw $3199, {{[0-9]+}}(%esp) # imm = 0xC7F -; X86-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-NEXT: orl $3072, %eax # imm = 0xC00 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-NEXT: fldcw {{[0-9]+}}(%esp) ; X86-NEXT: fistpll {{[0-9]+}}(%esp) ; X86-NEXT: fldcw {{[0-9]+}}(%esp) ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax @@ -416,9 +416,9 @@ define i32 @fptoui_i32_fp80_ld(x86_fp80 *%a0) nounwind { ; X64-X87-NEXT: fldt (%rdi) ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax -; X64-X87-NEXT: movw $3199, -{{[0-9]+}}(%rsp) # imm = 0xC7F -; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: orl $3072, %eax # imm = 0xC00 ; X64-X87-NEXT: movw %ax, -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fistpll -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movl -{{[0-9]+}}(%rsp), %eax @@ -459,13 +459,13 @@ define i64 @fptoui_i64_fp80(x86_fp80 %a0) nounwind { ; X86-NEXT: fstp %st(0) ; X86-NEXT: fnstcw {{[0-9]+}}(%esp) ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-NEXT: movw $3199, {{[0-9]+}}(%esp) # imm = 0xC7F -; X86-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-NEXT: xorl %edx, %edx +; X86-NEXT: orl $3072, %eax # imm = 0xC00 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-NEXT: fldcw {{[0-9]+}}(%esp) ; X86-NEXT: fistpll {{[0-9]+}}(%esp) ; X86-NEXT: fldcw {{[0-9]+}}(%esp) -; X86-NEXT: setbe %al -; X86-NEXT: movzbl %al, %edx +; X86-NEXT: setbe %dl ; X86-NEXT: shll $31, %edx ; X86-NEXT: xorl {{[0-9]+}}(%esp), %edx ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax @@ -479,16 +479,16 @@ define i64 @fptoui_i64_fp80(x86_fp80 %a0) nounwind { ; X64-X87-NEXT: flds {{.*}}(%rip) ; X64-X87-NEXT: fld %st(1) ; X64-X87-NEXT: fsub %st(1), %st -; X64-X87-NEXT: xorl %eax, %eax ; X64-X87-NEXT: fxch %st(1) ; X64-X87-NEXT: fucompi %st(2), %st ; X64-X87-NEXT: fcmovnbe %st(1), %st ; X64-X87-NEXT: fstp %st(1) ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %ecx -; X64-X87-NEXT: movw $3199, -{{[0-9]+}}(%rsp) # imm = 0xC7F -; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: xorl %eax, %eax +; X64-X87-NEXT: orl $3072, %ecx # imm = 0xC00 ; X64-X87-NEXT: movw %cx, -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fistpll -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: setbe %al @@ -541,13 +541,13 @@ define i64 @fptoui_i64_fp80_ld(x86_fp80 *%a0) nounwind { ; X86-NEXT: fstp %st(0) ; X86-NEXT: fnstcw {{[0-9]+}}(%esp) ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X86-NEXT: movw $3199, {{[0-9]+}}(%esp) # imm = 0xC7F -; X86-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-NEXT: xorl %edx, %edx +; X86-NEXT: orl $3072, %eax # imm = 0xC00 ; X86-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-NEXT: fldcw {{[0-9]+}}(%esp) ; X86-NEXT: fistpll {{[0-9]+}}(%esp) ; X86-NEXT: fldcw {{[0-9]+}}(%esp) -; X86-NEXT: setbe %al -; X86-NEXT: movzbl %al, %edx +; X86-NEXT: setbe %dl ; X86-NEXT: shll $31, %edx ; X86-NEXT: xorl {{[0-9]+}}(%esp), %edx ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax @@ -561,16 +561,16 @@ define i64 @fptoui_i64_fp80_ld(x86_fp80 *%a0) nounwind { ; X64-X87-NEXT: flds {{.*}}(%rip) ; X64-X87-NEXT: fld %st(1) ; X64-X87-NEXT: fsub %st(1), %st -; X64-X87-NEXT: xorl %eax, %eax ; X64-X87-NEXT: fxch %st(1) ; X64-X87-NEXT: fucompi %st(2), %st ; X64-X87-NEXT: fcmovnbe %st(1), %st ; X64-X87-NEXT: fstp %st(1) ; X64-X87-NEXT: fnstcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: movzwl -{{[0-9]+}}(%rsp), %ecx -; X64-X87-NEXT: movw $3199, -{{[0-9]+}}(%rsp) # imm = 0xC7F -; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: xorl %eax, %eax +; X64-X87-NEXT: orl $3072, %ecx # imm = 0xC00 ; X64-X87-NEXT: movw %cx, -{{[0-9]+}}(%rsp) +; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fistpll -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: fldcw -{{[0-9]+}}(%rsp) ; X64-X87-NEXT: setbe %al |