Skip to content

Commit

Permalink
[X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits t…
Browse files Browse the repository at this point in the history
…o match with ICC

MSVC currently doesn't support 80 bits long double. ICC supports it when
the option `/Qlong-double` is specified. Changing the alignment of f80
to 16 bytes so that we can be compatible with ICC's option.

Reviewed By: rnk, craig.topper

Differential Revision: https://reviews.llvm.org/D115942
  • Loading branch information
phoebewang committed Jan 12, 2022
1 parent fe958b1 commit 1bb0caf
Show file tree
Hide file tree
Showing 9 changed files with 194 additions and 99 deletions.
11 changes: 6 additions & 5 deletions clang/lib/Basic/Targets/X86.h
Expand Up @@ -533,11 +533,12 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_32TargetInfo
DoubleAlign = LongLongAlign = 64;
bool IsWinCOFF =
getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
resetDataLayout(IsWinCOFF ? "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:"
"64-i64:64-f80:32-n8:16:32-a:0:32-S32"
: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:"
"64-i64:64-f80:32-n8:16:32-a:0:32-S32",
IsWinCOFF ? "_" : "");
bool IsMSVC = getTriple().isWindowsMSVCEnvironment();
std::string Layout = IsWinCOFF ? "e-m:x" : "e-m:e";
Layout += "-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-";
Layout += IsMSVC ? "f80:128" : "f80:32";
Layout += "-n8:16:32-a:0:32-S32";
resetDataLayout(Layout, IsWinCOFF ? "_" : "");
}
};

Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/target-data.c
Expand Up @@ -8,7 +8,7 @@

// RUN: %clang_cc1 -triple i686-unknown-win32 -emit-llvm -o - %s | \
// RUN: FileCheck --check-prefix=I686-WIN32 %s
// I686-WIN32: target datalayout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-a:0:32-S32"
// I686-WIN32: target datalayout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32-a:0:32-S32"

// RUN: %clang_cc1 -triple i686-unknown-cygwin -emit-llvm -o - %s | \
// RUN: FileCheck --check-prefix=I686-CYGWIN %s
Expand Down
19 changes: 15 additions & 4 deletions llvm/lib/IR/AutoUpgrade.cpp
Expand Up @@ -4569,18 +4569,29 @@ std::string llvm::UpgradeDataLayoutString(StringRef DL, StringRef TT) {
return DL.empty() ? std::string("G1") : (DL + "-G1").str();
}

std::string Res = DL.str();
std::string AddrSpaces = "-p270:32:32-p271:32:32-p272:64:64";
// If X86, and the datalayout matches the expected format, add pointer size
// address spaces to the datalayout.
if (!T.isX86() || DL.contains(AddrSpaces))
return std::string(DL);
return Res;

SmallVector<StringRef, 4> Groups;
Regex R("(e-m:[a-z](-p:32:32)?)(-[if]64:.*$)");
if (!R.match(DL, &Groups))
return std::string(DL);
if (R.match(DL, &Groups))
Res = (Groups[1] + AddrSpaces + Groups[3]).str();

// For 32-bit MSVC targets, raise the alignment of f80 values to 16 bytes.
// Raising the alignment is safe because Clang did not produce f80 values in
// the MSVC environment before this upgrade was added.
if (T.isWindowsMSVCEnvironment() && !T.isArch64Bit()) {
StringRef Ref = Res;
auto I = Ref.find("-f80:32-");
if (I != StringRef::npos)
Res = (Ref.take_front(I) + "-f80:128-" + Ref.drop_front(I + 8)).str();
}

return (Groups[1] + AddrSpaces + Groups[3]).str();
return Res;
}

void llvm::UpgradeAttributes(AttrBuilder &B) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/X86/X86TargetMachine.cpp
Expand Up @@ -127,7 +127,7 @@ static std::string computeDataLayout(const Triple &TT) {
// Some ABIs align long double to 128 bits, others to 32.
if (TT.isOSNaCl() || TT.isOSIAMCU())
; // No f80
else if (TT.isArch64Bit() || TT.isOSDarwin())
else if (TT.isArch64Bit() || TT.isOSDarwin() || TT.isWindowsMSVCEnvironment())
Ret += "-f80:128";
else
Ret += "-f80:32";
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Bitcode/upgrade-datalayout3.ll
Expand Up @@ -5,4 +5,4 @@
target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
target triple = "i686-pc-windows-msvc"

; CHECK: target datalayout = "e-m:w-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-S32"
; CHECK: target datalayout = "e-m:w-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32-S32"
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/X86/long-double-abi-align.ll
Expand Up @@ -11,7 +11,7 @@ define void @foo(i32 %0, x86_fp80 %1, i32 %2) nounwind {
; MSVC-NEXT: movl %esp, %ebp
; MSVC-NEXT: andl $-16, %esp
; MSVC-NEXT: subl $32, %esp
; MSVC-NEXT: fldt 12(%ebp)
; MSVC-NEXT: fldt 24(%ebp)
; MSVC-NEXT: fstpt (%esp)
; MSVC-NEXT: leal 8(%ebp), %eax
; MSVC-NEXT: pushl %eax
Expand All @@ -21,7 +21,7 @@ define void @foo(i32 %0, x86_fp80 %1, i32 %2) nounwind {
; MSVC-NEXT: pushl %eax
; MSVC-NEXT: calll _escape
; MSVC-NEXT: addl $4, %esp
; MSVC-NEXT: leal 24(%ebp), %eax
; MSVC-NEXT: leal 40(%ebp), %eax
; MSVC-NEXT: pushl %eax
; MSVC-NEXT: calll _escape
; MSVC-NEXT: addl $4, %esp
Expand Down
219 changes: 151 additions & 68 deletions llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
Expand Up @@ -344,8 +344,8 @@ define i32 @x_to_u32(x86_fp80 %a) nounwind {
; X86-AVX512-WIN: # %bb.0:
; X86-AVX512-WIN-NEXT: pushl %ebp
; X86-AVX512-WIN-NEXT: movl %esp, %ebp
; X86-AVX512-WIN-NEXT: andl $-8, %esp
; X86-AVX512-WIN-NEXT: subl $8, %esp
; X86-AVX512-WIN-NEXT: andl $-16, %esp
; X86-AVX512-WIN-NEXT: subl $16, %esp
; X86-AVX512-WIN-NEXT: fldt 8(%ebp)
; X86-AVX512-WIN-NEXT: fisttpll (%esp)
; X86-AVX512-WIN-NEXT: movl (%esp), %eax
Expand Down Expand Up @@ -382,8 +382,8 @@ define i32 @x_to_u32(x86_fp80 %a) nounwind {
; X86-SSE3-WIN: # %bb.0:
; X86-SSE3-WIN-NEXT: pushl %ebp
; X86-SSE3-WIN-NEXT: movl %esp, %ebp
; X86-SSE3-WIN-NEXT: andl $-8, %esp
; X86-SSE3-WIN-NEXT: subl $8, %esp
; X86-SSE3-WIN-NEXT: andl $-16, %esp
; X86-SSE3-WIN-NEXT: subl $16, %esp
; X86-SSE3-WIN-NEXT: fldt 8(%ebp)
; X86-SSE3-WIN-NEXT: fisttpll (%esp)
; X86-SSE3-WIN-NEXT: movl (%esp), %eax
Expand Down Expand Up @@ -420,8 +420,8 @@ define i32 @x_to_u32(x86_fp80 %a) nounwind {
; X86-SSE2-WIN: # %bb.0:
; X86-SSE2-WIN-NEXT: pushl %ebp
; X86-SSE2-WIN-NEXT: movl %esp, %ebp
; X86-SSE2-WIN-NEXT: andl $-8, %esp
; X86-SSE2-WIN-NEXT: subl $16, %esp
; X86-SSE2-WIN-NEXT: andl $-16, %esp
; X86-SSE2-WIN-NEXT: subl $32, %esp
; X86-SSE2-WIN-NEXT: fldt 8(%ebp)
; X86-SSE2-WIN-NEXT: fnstcw {{[0-9]+}}(%esp)
; X86-SSE2-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax
Expand Down Expand Up @@ -482,8 +482,8 @@ define i32 @x_to_u32(x86_fp80 %a) nounwind {
; X86-SSE1-WIN: # %bb.0:
; X86-SSE1-WIN-NEXT: pushl %ebp
; X86-SSE1-WIN-NEXT: movl %esp, %ebp
; X86-SSE1-WIN-NEXT: andl $-8, %esp
; X86-SSE1-WIN-NEXT: subl $16, %esp
; X86-SSE1-WIN-NEXT: andl $-16, %esp
; X86-SSE1-WIN-NEXT: subl $32, %esp
; X86-SSE1-WIN-NEXT: fldt 8(%ebp)
; X86-SSE1-WIN-NEXT: fnstcw {{[0-9]+}}(%esp)
; X86-SSE1-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax
Expand Down Expand Up @@ -516,8 +516,8 @@ define i32 @x_to_u32(x86_fp80 %a) nounwind {
; X87-WIN: # %bb.0:
; X87-WIN-NEXT: pushl %ebp
; X87-WIN-NEXT: movl %esp, %ebp
; X87-WIN-NEXT: andl $-8, %esp
; X87-WIN-NEXT: subl $16, %esp
; X87-WIN-NEXT: andl $-16, %esp
; X87-WIN-NEXT: subl $32, %esp
; X87-WIN-NEXT: fldt 8(%ebp)
; X87-WIN-NEXT: fnstcw {{[0-9]+}}(%esp)
; X87-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax
Expand Down Expand Up @@ -550,14 +550,27 @@ define i32 @x_to_u32(x86_fp80 %a) nounwind {
}

define i32 @x_to_s32(x86_fp80 %a) nounwind {
; X86-AVX512-LABEL: x_to_s32:
; X86-AVX512: # %bb.0:
; X86-AVX512-NEXT: pushl %eax
; X86-AVX512-NEXT: fldt {{[0-9]+}}(%esp)
; X86-AVX512-NEXT: fisttpl (%esp)
; X86-AVX512-NEXT: movl (%esp), %eax
; X86-AVX512-NEXT: popl %ecx
; X86-AVX512-NEXT: retl
; X86-AVX512-WIN-LABEL: x_to_s32:
; X86-AVX512-WIN: # %bb.0:
; X86-AVX512-WIN-NEXT: pushl %ebp
; X86-AVX512-WIN-NEXT: movl %esp, %ebp
; X86-AVX512-WIN-NEXT: andl $-16, %esp
; X86-AVX512-WIN-NEXT: subl $16, %esp
; X86-AVX512-WIN-NEXT: fldt 8(%ebp)
; X86-AVX512-WIN-NEXT: fisttpl {{[0-9]+}}(%esp)
; X86-AVX512-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-AVX512-WIN-NEXT: movl %ebp, %esp
; X86-AVX512-WIN-NEXT: popl %ebp
; X86-AVX512-WIN-NEXT: retl
;
; X86-AVX512-LIN-LABEL: x_to_s32:
; X86-AVX512-LIN: # %bb.0:
; X86-AVX512-LIN-NEXT: pushl %eax
; X86-AVX512-LIN-NEXT: fldt {{[0-9]+}}(%esp)
; X86-AVX512-LIN-NEXT: fisttpl (%esp)
; X86-AVX512-LIN-NEXT: movl (%esp), %eax
; X86-AVX512-LIN-NEXT: popl %ecx
; X86-AVX512-LIN-NEXT: retl
;
; X64-AVX512-WIN-LABEL: x_to_s32:
; X64-AVX512-WIN: # %bb.0:
Expand All @@ -575,14 +588,27 @@ define i32 @x_to_s32(x86_fp80 %a) nounwind {
; X64-AVX512-LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax
; X64-AVX512-LIN-NEXT: retq
;
; X86-SSE3-LABEL: x_to_s32:
; X86-SSE3: # %bb.0:
; X86-SSE3-NEXT: pushl %eax
; X86-SSE3-NEXT: fldt {{[0-9]+}}(%esp)
; X86-SSE3-NEXT: fisttpl (%esp)
; X86-SSE3-NEXT: movl (%esp), %eax
; X86-SSE3-NEXT: popl %ecx
; X86-SSE3-NEXT: retl
; X86-SSE3-WIN-LABEL: x_to_s32:
; X86-SSE3-WIN: # %bb.0:
; X86-SSE3-WIN-NEXT: pushl %ebp
; X86-SSE3-WIN-NEXT: movl %esp, %ebp
; X86-SSE3-WIN-NEXT: andl $-16, %esp
; X86-SSE3-WIN-NEXT: subl $16, %esp
; X86-SSE3-WIN-NEXT: fldt 8(%ebp)
; X86-SSE3-WIN-NEXT: fisttpl {{[0-9]+}}(%esp)
; X86-SSE3-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-SSE3-WIN-NEXT: movl %ebp, %esp
; X86-SSE3-WIN-NEXT: popl %ebp
; X86-SSE3-WIN-NEXT: retl
;
; X86-SSE3-LIN-LABEL: x_to_s32:
; X86-SSE3-LIN: # %bb.0:
; X86-SSE3-LIN-NEXT: pushl %eax
; X86-SSE3-LIN-NEXT: fldt {{[0-9]+}}(%esp)
; X86-SSE3-LIN-NEXT: fisttpl (%esp)
; X86-SSE3-LIN-NEXT: movl (%esp), %eax
; X86-SSE3-LIN-NEXT: popl %ecx
; X86-SSE3-LIN-NEXT: retl
;
; X64-SSE3-WIN-LABEL: x_to_s32:
; X64-SSE3-WIN: # %bb.0:
Expand All @@ -600,20 +626,39 @@ define i32 @x_to_s32(x86_fp80 %a) nounwind {
; X64-SSE3-LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax
; X64-SSE3-LIN-NEXT: retq
;
; X86-SSE2-LABEL: x_to_s32:
; X86-SSE2: # %bb.0:
; X86-SSE2-NEXT: subl $8, %esp
; X86-SSE2-NEXT: fldt {{[0-9]+}}(%esp)
; X86-SSE2-NEXT: fnstcw (%esp)
; X86-SSE2-NEXT: movzwl (%esp), %eax
; X86-SSE2-NEXT: orl $3072, %eax # imm = 0xC00
; X86-SSE2-NEXT: movw %ax, {{[0-9]+}}(%esp)
; X86-SSE2-NEXT: fldcw {{[0-9]+}}(%esp)
; X86-SSE2-NEXT: fistpl {{[0-9]+}}(%esp)
; X86-SSE2-NEXT: fldcw (%esp)
; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-SSE2-NEXT: addl $8, %esp
; X86-SSE2-NEXT: retl
; X86-SSE2-WIN-LABEL: x_to_s32:
; X86-SSE2-WIN: # %bb.0:
; X86-SSE2-WIN-NEXT: pushl %ebp
; X86-SSE2-WIN-NEXT: movl %esp, %ebp
; X86-SSE2-WIN-NEXT: andl $-16, %esp
; X86-SSE2-WIN-NEXT: subl $16, %esp
; X86-SSE2-WIN-NEXT: fldt 8(%ebp)
; X86-SSE2-WIN-NEXT: fnstcw (%esp)
; X86-SSE2-WIN-NEXT: movzwl (%esp), %eax
; X86-SSE2-WIN-NEXT: orl $3072, %eax # imm = 0xC00
; X86-SSE2-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
; X86-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%esp)
; X86-SSE2-WIN-NEXT: fistpl {{[0-9]+}}(%esp)
; X86-SSE2-WIN-NEXT: fldcw (%esp)
; X86-SSE2-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-SSE2-WIN-NEXT: movl %ebp, %esp
; X86-SSE2-WIN-NEXT: popl %ebp
; X86-SSE2-WIN-NEXT: retl
;
; X86-SSE2-LIN-LABEL: x_to_s32:
; X86-SSE2-LIN: # %bb.0:
; X86-SSE2-LIN-NEXT: subl $8, %esp
; X86-SSE2-LIN-NEXT: fldt {{[0-9]+}}(%esp)
; X86-SSE2-LIN-NEXT: fnstcw (%esp)
; X86-SSE2-LIN-NEXT: movzwl (%esp), %eax
; X86-SSE2-LIN-NEXT: orl $3072, %eax # imm = 0xC00
; X86-SSE2-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
; X86-SSE2-LIN-NEXT: fldcw {{[0-9]+}}(%esp)
; X86-SSE2-LIN-NEXT: fistpl {{[0-9]+}}(%esp)
; X86-SSE2-LIN-NEXT: fldcw (%esp)
; X86-SSE2-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-SSE2-LIN-NEXT: addl $8, %esp
; X86-SSE2-LIN-NEXT: retl
;
; X64-SSE2-WIN-LABEL: x_to_s32:
; X64-SSE2-WIN: # %bb.0:
Expand Down Expand Up @@ -643,35 +688,73 @@ define i32 @x_to_s32(x86_fp80 %a) nounwind {
; X64-SSE2-LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax
; X64-SSE2-LIN-NEXT: retq
;
; X86-SSE1-LABEL: x_to_s32:
; X86-SSE1: # %bb.0:
; X86-SSE1-NEXT: subl $8, %esp
; X86-SSE1-NEXT: fldt {{[0-9]+}}(%esp)
; X86-SSE1-NEXT: fnstcw (%esp)
; X86-SSE1-NEXT: movzwl (%esp), %eax
; X86-SSE1-NEXT: orl $3072, %eax # imm = 0xC00
; X86-SSE1-NEXT: movw %ax, {{[0-9]+}}(%esp)
; X86-SSE1-NEXT: fldcw {{[0-9]+}}(%esp)
; X86-SSE1-NEXT: fistpl {{[0-9]+}}(%esp)
; X86-SSE1-NEXT: fldcw (%esp)
; X86-SSE1-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-SSE1-NEXT: addl $8, %esp
; X86-SSE1-NEXT: retl
; X86-SSE1-WIN-LABEL: x_to_s32:
; X86-SSE1-WIN: # %bb.0:
; X86-SSE1-WIN-NEXT: pushl %ebp
; X86-SSE1-WIN-NEXT: movl %esp, %ebp
; X86-SSE1-WIN-NEXT: andl $-16, %esp
; X86-SSE1-WIN-NEXT: subl $16, %esp
; X86-SSE1-WIN-NEXT: fldt 8(%ebp)
; X86-SSE1-WIN-NEXT: fnstcw (%esp)
; X86-SSE1-WIN-NEXT: movzwl (%esp), %eax
; X86-SSE1-WIN-NEXT: orl $3072, %eax # imm = 0xC00
; X86-SSE1-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
; X86-SSE1-WIN-NEXT: fldcw {{[0-9]+}}(%esp)
; X86-SSE1-WIN-NEXT: fistpl {{[0-9]+}}(%esp)
; X86-SSE1-WIN-NEXT: fldcw (%esp)
; X86-SSE1-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-SSE1-WIN-NEXT: movl %ebp, %esp
; X86-SSE1-WIN-NEXT: popl %ebp
; X86-SSE1-WIN-NEXT: retl
;
; X87-LABEL: x_to_s32:
; X87: # %bb.0:
; X87-NEXT: subl $8, %esp
; X87-NEXT: fldt {{[0-9]+}}(%esp)
; X87-NEXT: fnstcw (%esp)
; X87-NEXT: movzwl (%esp), %eax
; X87-NEXT: orl $3072, %eax # imm = 0xC00
; X87-NEXT: movw %ax, {{[0-9]+}}(%esp)
; X87-NEXT: fldcw {{[0-9]+}}(%esp)
; X87-NEXT: fistpl {{[0-9]+}}(%esp)
; X87-NEXT: fldcw (%esp)
; X87-NEXT: movl {{[0-9]+}}(%esp), %eax
; X87-NEXT: addl $8, %esp
; X87-NEXT: retl
; X86-SSE1-LIN-LABEL: x_to_s32:
; X86-SSE1-LIN: # %bb.0:
; X86-SSE1-LIN-NEXT: subl $8, %esp
; X86-SSE1-LIN-NEXT: fldt {{[0-9]+}}(%esp)
; X86-SSE1-LIN-NEXT: fnstcw (%esp)
; X86-SSE1-LIN-NEXT: movzwl (%esp), %eax
; X86-SSE1-LIN-NEXT: orl $3072, %eax # imm = 0xC00
; X86-SSE1-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
; X86-SSE1-LIN-NEXT: fldcw {{[0-9]+}}(%esp)
; X86-SSE1-LIN-NEXT: fistpl {{[0-9]+}}(%esp)
; X86-SSE1-LIN-NEXT: fldcw (%esp)
; X86-SSE1-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-SSE1-LIN-NEXT: addl $8, %esp
; X86-SSE1-LIN-NEXT: retl
;
; X87-WIN-LABEL: x_to_s32:
; X87-WIN: # %bb.0:
; X87-WIN-NEXT: pushl %ebp
; X87-WIN-NEXT: movl %esp, %ebp
; X87-WIN-NEXT: andl $-16, %esp
; X87-WIN-NEXT: subl $16, %esp
; X87-WIN-NEXT: fldt 8(%ebp)
; X87-WIN-NEXT: fnstcw (%esp)
; X87-WIN-NEXT: movzwl (%esp), %eax
; X87-WIN-NEXT: orl $3072, %eax # imm = 0xC00
; X87-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp)
; X87-WIN-NEXT: fistpl {{[0-9]+}}(%esp)
; X87-WIN-NEXT: fldcw (%esp)
; X87-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax
; X87-WIN-NEXT: movl %ebp, %esp
; X87-WIN-NEXT: popl %ebp
; X87-WIN-NEXT: retl
;
; X87-LIN-LABEL: x_to_s32:
; X87-LIN: # %bb.0:
; X87-LIN-NEXT: subl $8, %esp
; X87-LIN-NEXT: fldt {{[0-9]+}}(%esp)
; X87-LIN-NEXT: fnstcw (%esp)
; X87-LIN-NEXT: movzwl (%esp), %eax
; X87-LIN-NEXT: orl $3072, %eax # imm = 0xC00
; X87-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp)
; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp)
; X87-LIN-NEXT: fistpl {{[0-9]+}}(%esp)
; X87-LIN-NEXT: fldcw (%esp)
; X87-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax
; X87-LIN-NEXT: addl $8, %esp
; X87-LIN-NEXT: retl
%r = fptosi x86_fp80 %a to i32
ret i32 %r
}
Expand Down

0 comments on commit 1bb0caf

Please sign in to comment.