History

two new tests in abi5.ssa

They are meant to exercise the hardware floating-point calling convention of the risc-v target.

Quentin Carbonneaux committed 4 years ago

Commit e6debbb1 parent 7f7e34c1 file · +26 −1Browse files

Unified · Split

test/abi5.ssa+26−1
@@ -10,6 +10,8 @@ type :st7 = { s, d } · 9 unmodified lines
10type :st8 = { w 4 }10type :st8 = { w 4 }
11type :un9 = { { b } { s } }11type :un9 = { { b } { s } }
12type :st9 = { w, :un9 }12type :st9 = { w, :un9 }
13type :sta = { b, s }
14type :stb = { b, b, s }
13 15
14data $fmt1 = { b "t1: %s\n", b 0 }16data $fmt1 = { b "t1: %s\n", b 0 }
15data $fmt2 = { b "t2: %d\n", b 0 }17data $fmt2 = { b "t2: %d\n", b 0 }
@@ -20,6 +22,8 @@ data $fmt6 = { b "t6: %s\n", b 0 } · 4 unmodified lines
20data $fmt7 = { b "t7: %f %f\n", b 0 }22data $fmt7 = { b "t7: %f %f\n", b 0 }
21data $fmt8 = { b "t8: %d %d %d %d\n", b 0 }23data $fmt8 = { b "t8: %d %d %d %d\n", b 0 }
22data $fmt9 = { b "t9: %d %f\n", b 0 }24data $fmt9 = { b "t9: %d %f\n", b 0 }
25data $fmta = { b "ta: %d %f\n", b 0 }
26data $fmtb = { b "tb: %d %d %f\n", b 0 }
23 27
24export28export
25function $test() {29function $test() {
@@ -78,12 +82,27 @@ function $test() { · 52 unmodified lines
78 %d9 =d exts %s982 %d9 =d exts %s9
79 %i9 =w call $printf(l $fmt9, ..., w %w9, d %d9)83 %i9 =w call $printf(l $fmt9, ..., w %w9, d %d9)
80 84
85 %ra =:sta call $ta()
86 %ra4 =l add 4, %ra
87 %wa =w loadsb %ra
88 %sa =s loads %ra4
89 %da =d exts %sa
90 %ia =w call $printf(l $fmta, ..., w %wa, d %da)
91
92 %rb =:stb call $tb()
93 %rb1 =l add 1, %rb
94 %rb4 =l add 4, %rb
95 %w0b =w loadsb %rb
96 %w1b =w loadsb %rb1
97 %sb =s loads %rb4
98 %db =d exts %sb
99 %ib =w call $printf(l $fmtb, ..., w %w0b, w %w1b, d %db)
100
81 ret101 ret
82}102}
83 103
84 104
85# >>> driver105# >>> driver
86# #include <stdio.h>
87# typedef struct { char t[17]; } st1;106# typedef struct { char t[17]; } st1;
88# typedef struct { int i; } st2;107# typedef struct { int i; } st2;
89# typedef struct { float f; int i; } st3;108# typedef struct { float f; int i; } st3;
@@ -93,6 +112,8 @@ function $test() { · 3 unmodified lines
93# typedef struct { float f; double d; } st7;112# typedef struct { float f; double d; } st7;
94# typedef struct { int i[4]; } st8;113# typedef struct { int i[4]; } st8;
95# typedef struct { int i; union { char c; float f; } u; } st9;114# typedef struct { int i; union { char c; float f; } u; } st9;
115# typedef struct { char c; float f; } sta;
116# typedef struct { char c0, c1; float f; } stb;
96# extern void test(void);117# extern void test(void);
97# st1 t1() { return (st1){"abcdefghijklmnop"}; }118# st1 t1() { return (st1){"abcdefghijklmnop"}; }
98# st2 t2() { return (st2){2}; }119# st2 t2() { return (st2){2}; }
@@ -103,6 +124,8 @@ function $test() { · 4 unmodified lines
103# st7 t7() { return (st7){7.77,77.7}; }124# st7 t7() { return (st7){7.77,77.7}; }
104# st8 t8() { return (st8){-8,88,-888,8888}; }125# st8 t8() { return (st8){-8,88,-888,8888}; }
105# st9 t9() { return (st9){9,{.f=9.9}}; }126# st9 t9() { return (st9){9,{.f=9.9}}; }
127# sta ta() { return (sta){-10,10.1}; }
128# stb tb() { return (stb){-1,11,11.11}; }
106# int main() { test(); return 0; }129# int main() { test(); return 0; }
107# <<<130# <<<
108 131
@@ -116,4 +139,6 @@ function $test() { · 7 unmodified lines
116# t7: 7.770000 77.700000139# t7: 7.770000 77.700000
117# t8: -8 88 -888 8888140# t8: -8 88 -888 8888
118# t9: 9 9.900000141# t9: 9 9.900000
142# ta: -10 10.100000
143# tb: -1 11 11.110000
119# <<<144# <<<

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t