Fix sse calling bug

This commit is contained in:
herman ten brugge 2019-10-29 07:19:42 +01:00
parent 800c3a5e0b
commit fadfc118e5
3 changed files with 26 additions and 3 deletions

View 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;
}

View File

@ -0,0 +1 @@
5.000000

View File

@ -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);