Skip to content

Commit 9796d83

Browse files
tidbits
1 parent 83558b1 commit 9796d83

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

llvm/test/CodeGen/X86/isel-fp-to-sint-x87.ll

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
; RUN: llc < %s -mtriple=x86_64-- -mattr=+x87,-sse,-sse2 -global-isel=0 | FileCheck %s --check-prefixes X64,SDAG-X64
55
; RUN: llc < %s -mtriple=x86_64-- -mattr=+x87,-sse,-sse2 -global-isel -global-isel-abort=2 | FileCheck %s --check-prefixes X64,GISEL-X64
6-
; RUN: llc < %s -mtriple=i686-linux-gnu -mattr=+x87,-sse,-sse2 -global-isel=0 | FileCheck %s --check-prefixes I686,SDAG-I686
7-
; RUN: llc < %s -mtriple=i686-linux-gnu -mattr=+x87,-sse,-sse2 -global-isel -global-isel-abort=2 | FileCheck %s --check-prefixes I686,GISEL-I686
6+
; RUN: llc < %s -mtriple=i686-- -mattr=+x87,-sse,-sse2 -global-isel=0 | FileCheck %s --check-prefixes I686,SDAG-I686
7+
; RUN: llc < %s -mtriple=i686-- -mattr=+x87,-sse,-sse2 -global-isel -global-isel-abort=2 | FileCheck %s --check-prefixes I686,GISEL-I686
88

99
define i8 @test_float_to_int8(float %input) nounwind {
1010
; X64-LABEL: test_float_to_int8:
@@ -220,8 +220,11 @@ define i64 @test_float_to_int64(float %input) nounwind {
220220
;
221221
; I686-LABEL: test_float_to_int64:
222222
; I686: # %bb.0: # %entry
223-
; I686-NEXT: subl $20, %esp
224-
; I686-NEXT: flds {{[0-9]+}}(%esp)
223+
; I686-NEXT: pushl %ebp
224+
; I686-NEXT: movl %esp, %ebp
225+
; I686-NEXT: andl $-8, %esp
226+
; I686-NEXT: subl $16, %esp
227+
; I686-NEXT: flds 8(%ebp)
225228
; I686-NEXT: fnstcw {{[0-9]+}}(%esp)
226229
; I686-NEXT: movzwl {{[0-9]+}}(%esp), %eax
227230
; I686-NEXT: orl $3072, %eax # imm = 0xC00
@@ -231,7 +234,8 @@ define i64 @test_float_to_int64(float %input) nounwind {
231234
; I686-NEXT: fldcw {{[0-9]+}}(%esp)
232235
; I686-NEXT: movl {{[0-9]+}}(%esp), %eax
233236
; I686-NEXT: movl {{[0-9]+}}(%esp), %edx
234-
; I686-NEXT: addl $20, %esp
237+
; I686-NEXT: movl %ebp, %esp
238+
; I686-NEXT: popl %ebp
235239
; I686-NEXT: retl
236240
entry:
237241
%conv = fptosi float %input to i64
@@ -254,8 +258,11 @@ define i64 @test_longdouble_to_int64(x86_fp80 %input) nounwind {
254258
;
255259
; I686-LABEL: test_longdouble_to_int64:
256260
; I686: # %bb.0: # %entry
257-
; I686-NEXT: subl $20, %esp
258-
; I686-NEXT: fldt {{[0-9]+}}(%esp)
261+
; I686-NEXT: pushl %ebp
262+
; I686-NEXT: movl %esp, %ebp
263+
; I686-NEXT: andl $-8, %esp
264+
; I686-NEXT: subl $16, %esp
265+
; I686-NEXT: fldt 8(%ebp)
259266
; I686-NEXT: fnstcw {{[0-9]+}}(%esp)
260267
; I686-NEXT: movzwl {{[0-9]+}}(%esp), %eax
261268
; I686-NEXT: orl $3072, %eax # imm = 0xC00
@@ -265,7 +272,8 @@ define i64 @test_longdouble_to_int64(x86_fp80 %input) nounwind {
265272
; I686-NEXT: fldcw {{[0-9]+}}(%esp)
266273
; I686-NEXT: movl {{[0-9]+}}(%esp), %eax
267274
; I686-NEXT: movl {{[0-9]+}}(%esp), %edx
268-
; I686-NEXT: addl $20, %esp
275+
; I686-NEXT: movl %ebp, %esp
276+
; I686-NEXT: popl %ebp
269277
; I686-NEXT: retl
270278
entry:
271279
%conv = fptosi x86_fp80 %input to i64
@@ -387,8 +395,11 @@ define i64 @test_double_to_int64(double %input) nounwind {
387395
;
388396
; I686-LABEL: test_double_to_int64:
389397
; I686: # %bb.0: # %entry
390-
; I686-NEXT: subl $20, %esp
391-
; I686-NEXT: fldl {{[0-9]+}}(%esp)
398+
; I686-NEXT: pushl %ebp
399+
; I686-NEXT: movl %esp, %ebp
400+
; I686-NEXT: andl $-8, %esp
401+
; I686-NEXT: subl $16, %esp
402+
; I686-NEXT: fldl 8(%ebp)
392403
; I686-NEXT: fnstcw {{[0-9]+}}(%esp)
393404
; I686-NEXT: movzwl {{[0-9]+}}(%esp), %eax
394405
; I686-NEXT: orl $3072, %eax # imm = 0xC00
@@ -398,7 +409,8 @@ define i64 @test_double_to_int64(double %input) nounwind {
398409
; I686-NEXT: fldcw {{[0-9]+}}(%esp)
399410
; I686-NEXT: movl {{[0-9]+}}(%esp), %eax
400411
; I686-NEXT: movl {{[0-9]+}}(%esp), %edx
401-
; I686-NEXT: addl $20, %esp
412+
; I686-NEXT: movl %ebp, %esp
413+
; I686-NEXT: popl %ebp
402414
; I686-NEXT: retl
403415
entry:
404416
%conv = fptosi double %input to i64

llvm/test/CodeGen/X86/isel-sint-to-fp-x87.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
; RUN: llc < %s -mtriple=x86_64-- -mattr=+x87,-sse,-sse2 -global-isel=0 | FileCheck %s --check-prefixes X64,SDAG-X64
55
; RUN: llc < %s -mtriple=x86_64-- -mattr=+x87,-sse,-sse2 -global-isel -global-isel-abort=2 | FileCheck %s --check-prefixes X64,GISEL-X64
6-
; RUN: llc < %s -mtriple=i686-linux-gnu -mattr=+x87,-sse,-sse2 -global-isel=0 | FileCheck %s --check-prefixes I686,SDAG-I686
7-
; RUN: llc < %s -mtriple=i686-linux-gnu -mattr=+x87,-sse,-sse2 -global-isel -global-isel-abort=2 | FileCheck %s --check-prefixes I686,GISEL-I686
6+
; RUN: llc < %s -mtriple=i686-- -mattr=+x87,-sse,-sse2 -global-isel=0 | FileCheck %s --check-prefixes I686,SDAG-I686
7+
; RUN: llc < %s -mtriple=i686-- -mattr=+x87,-sse,-sse2 -global-isel -global-isel-abort=2 | FileCheck %s --check-prefixes I686,GISEL-I686
88

99
define void @test_int8_to_float(i8 %x, ptr %p) nounwind {
1010
; X64-LABEL: test_int8_to_float:

0 commit comments

Comments
 (0)