Fix sse calling bug
This commit is contained in:
parent
800c3a5e0b
commit
fadfc118e5
3 changed files with 26 additions and 3 deletions
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;
|
sse_reg -= 2;
|
||||||
gv(RC_FRET); /* Use pair load into xmm0 & xmm1 */
|
gv(RC_FRET); /* Use pair load into xmm0 & xmm1 */
|
||||||
if (sse_reg) { /* avoid redundant movaps %xmm0, %xmm0 */
|
if (sse_reg) { /* avoid redundant movaps %xmm0, %xmm0 */
|
||||||
/* movaps %xmm0, %xmmN */
|
|
||||||
o(0x280f);
|
|
||||||
o(0xc0 + (sse_reg << 3));
|
|
||||||
/* movaps %xmm1, %xmmN */
|
/* movaps %xmm1, %xmmN */
|
||||||
o(0x280f);
|
o(0x280f);
|
||||||
o(0xc1 + ((sse_reg+1) << 3));
|
o(0xc1 + ((sse_reg+1) << 3));
|
||||||
|
/* movaps %xmm0, %xmmN */
|
||||||
|
o(0x280f);
|
||||||
|
o(0xc0 + (sse_reg << 3));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
assert(reg_count == 1);
|
assert(reg_count == 1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue