gcc12 uses the xmm registers a lot more. - save xmm0/xmm1 in gen_bounds_epilog - align stack for call to (__bound_)memmove call in gfunc_call
Unified · Split
| @@ -715,10 +715,18 @@ static void gen_bounds_epilog(void) · 714 unmodified lines | |||
| 715 | 715 | ||
| 716 | /* generate bound check local freeing */ | 716 | /* generate bound check local freeing */ |
| 717 | o(0x5250); /* save returned value, if any */ | 717 | o(0x5250); /* save returned value, if any */ |
| 718 | o(0x20ec8348); /* sub $32,%rsp */ | ||
| 719 | o(0x290f); /* movaps %xmm0,0x10(%rsp) */ | ||
| 720 | o(0x102444); | ||
| 721 | o(0x240c290f); /* movaps %xmm1,(%rsp) */ | ||
| 718 | greloca(cur_text_section, sym_data, ind + 3, R_X86_64_PC32, -4); | 722 | greloca(cur_text_section, sym_data, ind + 3, R_X86_64_PC32, -4); |
| 719 | o(0x0d8d48 + ((TREG_FASTCALL_1 == TREG_RDI) * 0x300000)); /* lea xxx(%rip), %rcx/rdi */ | 723 | o(0x0d8d48 + ((TREG_FASTCALL_1 == TREG_RDI) * 0x300000)); /* lea xxx(%rip), %rcx/rdi */ |
| 720 | gen_le32 (0); | 724 | gen_le32 (0); |
| 721 | gen_bounds_call(TOK___bound_local_delete); | 725 | gen_bounds_call(TOK___bound_local_delete); |
| 726 | o(0x280f); /* movaps 0x10(%rsp),%xmm0 */ | ||
| 727 | o(0x102444); | ||
| 728 | o(0x240c280f); /* movaps (%rsp),%xmm1 */ | ||
| 729 | o(0x20c48348); /* add $32,%rsp */ | ||
| 722 | o(0x585a); /* restore returned value, if any */ | 730 | o(0x585a); /* restore returned value, if any */ |
| 723 | } | 731 | } |
| 724 | #endif | 732 | #endif |
| @@ -1317,7 +1325,14 @@ void gfunc_call(int nb_args) · 592 unmodified lines | |||
| 1317 | o(0xe0 + REG_VALUE(r)); | 1325 | o(0xe0 + REG_VALUE(r)); |
| 1318 | vset(&vtop->type, r | VT_LVAL, 0); | 1326 | vset(&vtop->type, r | VT_LVAL, 0); |
| 1319 | vswap(); | 1327 | vswap(); |
| 1328 | /* keep stack aligned for (__bound_)memmove call */ | ||
| 1329 | o(0x10ec8348); /* sub $16,%rsp */ | ||
| 1330 | o(0xf0e48348); /* and $-16,%rsp */ | ||
| 1331 | orex(0,r,0,0x50 + REG_VALUE(r)); /* push r (last %rsp) */ | ||
| 1332 | o(0x08ec8348); /* sub $8,%rsp */ | ||
| 1320 | vstore(); | 1333 | vstore(); |
| 1334 | o(0x08c48348); /* add $8,%rsp */ | ||
| 1335 | o(0x5c); /* pop %rsp */ | ||
| 1321 | break; | 1336 | break; |
| 1322 | 1337 | ||
| 1323 | case VT_LDOUBLE: | 1338 | case VT_LDOUBLE: |