mirror of
https://github.com/mirror/tinycc.git
synced 2024-12-28 04:00:06 +08:00
Fix sse calling bug
This commit is contained in:
parent
800c3a5e0b
commit
fadfc118e5
22
tests/tests2/109_sse_calling.c
Normal file
22
tests/tests2/109_sse_calling.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
|
||||
struct Point {
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
|
||||
struct Rect {
|
||||
struct Point top_left;
|
||||
struct Point size;
|
||||
};
|
||||
|
||||
float foo(struct Point p, struct Rect r) {
|
||||
return r.size.x;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
struct Point p = {1, 2};
|
||||
struct Rect r = {{3, 4}, {5, 6}};
|
||||
printf("%f\n", foo(p, r));
|
||||
return 0;
|
||||
}
|
1
tests/tests2/109_sse_calling.expect
Normal file
1
tests/tests2/109_sse_calling.expect
Normal file
@ -0,0 +1 @@
|
||||
5.000000
|
@ -1351,12 +1351,12 @@ void gfunc_call(int nb_args)
|
||||
sse_reg -= 2;
|
||||
gv(RC_FRET); /* Use pair load into xmm0 & xmm1 */
|
||||
if (sse_reg) { /* avoid redundant movaps %xmm0, %xmm0 */
|
||||
/* movaps %xmm0, %xmmN */
|
||||
o(0x280f);
|
||||
o(0xc0 + (sse_reg << 3));
|
||||
/* movaps %xmm1, %xmmN */
|
||||
o(0x280f);
|
||||
o(0xc1 + ((sse_reg+1) << 3));
|
||||
/* movaps %xmm0, %xmmN */
|
||||
o(0x280f);
|
||||
o(0xc0 + (sse_reg << 3));
|
||||
}
|
||||
} else {
|
||||
assert(reg_count == 1);
|
||||
|
Loading…
Reference in New Issue
Block a user