Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: tests_lit/llvm2ice_tests/fpcall.ll

Issue 563303003: Subzero: Always be sure x87 FP stack is emptied after a call. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 ; Test that for calls returning a floating-point value, the calling
2 ; ABI with respect to the x87 floating point stack is honored. In
3 ; particular, the top-of-stack must be popped regardless of whether
4 ; its value is used.
5
6 ; RUN: %llvm2ice -O2 --verbose none %s \
7 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \
8 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
9 ; RUN: %llvm2ice -Om1 --verbose none %s \
10 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \
11 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
12 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s
13 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s
14 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \
15 ; RUN: | FileCheck --check-prefix=DUMP %s
16
17 define float @dummy() {
18 entry:
19 ret float 0.000000e+00
20 }
21 ; CHECK-LABEL: dummy
22
23 ; The call is ignored, but the top of the FP stack still needs to be
24 ; popped.
25 define i32 @ignored_fp_call() {
26 entry:
27 %ignored = call float @dummy()
28 ret i32 0
29 }
30 ; CHECK-LABEL: ignored_fp_call
31 ; CHECK: call dummy
32 ; CHECK: fstp
33
34 ; The top of the FP stack is popped and subsequently used.
35 define i32 @converted_fp_call() {
36 entry:
37 %fp = call float @dummy()
38 %ret = fptosi float %fp to i32
39 ret i32 %ret
40 }
41 ; CHECK-LABEL: converted_fp_call
42 ; CHECK: call dummy
43 ; CHECK: fstp
44 ; CHECK: cvttss2si
45
46 ; The top of the FP stack is ultimately passed through as the return
47 ; value. Note: the translator could optimized by not popping and
48 ; re-pushing, in which case the test would need to be changed.
49 define float @returned_fp_call() {
50 entry:
51 %fp = call float @dummy()
52 ret float %fp
53 }
54 ; CHECK-LABEL: returned_fp_call
55 ; CHECK: call dummy
56 ; CHECK: fstp
57 ; CHECK: fld
58
59 ; ERRORS-NOT: ICE translation error
60 ; DUMP-NOT: SZ
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698