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
1010 type :st8 = { w 4 }
1111 type :un9 = { { b } { s } }
1212 type :st9 = { w, :un9 }
13+type :sta = { b, s }
14+type :stb = { b, b, s }
1315
1416 data $fmt1 = { b "t1: %s\n", b 0 }
1517 data $fmt2 = { b "t2: %d\n", b 0 }
@@ -20,6 +22,8 @@ data $fmt6 = { b "t6: %s\n", b 0 } · 4 unmodified lines
2022 data $fmt7 = { b "t7: %f %f\n", b 0 }
2123 data $fmt8 = { b "t8: %d %d %d %d\n", b 0 }
2224 data $fmt9 = { b "t9: %d %f\n", b 0 }
25+data $fmta = { b "ta: %d %f\n", b 0 }
26+data $fmtb = { b "tb: %d %d %f\n", b 0 }
2327
2428 export
2529 function $test() {
@@ -78,12 +82,27 @@ function $test() { · 52 unmodified lines
7882 %d9 =d exts %s9
7983 %i9 =w call $printf(l $fmt9, ..., w %w9, d %d9)
8084
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+
81101 ret
82102 }
83103
84104
85105 # >>> driver
86−# #include <stdio.h>
87106 # typedef struct { char t[17]; } st1;
88107 # typedef struct { int i; } st2;
89108 # typedef struct { float f; int i; } st3;
@@ -93,6 +112,8 @@ function $test() { · 3 unmodified lines
93112 # typedef struct { float f; double d; } st7;
94113 # typedef struct { int i[4]; } st8;
95114 # 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;
96117 # extern void test(void);
97118 # st1 t1() { return (st1){"abcdefghijklmnop"}; }
98119 # st2 t2() { return (st2){2}; }
@@ -103,6 +124,8 @@ function $test() { · 4 unmodified lines
103124 # st7 t7() { return (st7){7.77,77.7}; }
104125 # st8 t8() { return (st8){-8,88,-888,8888}; }
105126 # 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}; }
106129 # int main() { test(); return 0; }
107130 # <<<
108131
@@ -116,4 +139,6 @@ function $test() { · 7 unmodified lines
116139 # t7: 7.770000 77.700000
117140 # t8: -8 88 -888 8888
118141 # t9: 9 9.900000
142+# ta: -10 10.100000
143+# tb: -1 11 11.110000
119144 # <<<

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