History

Update for gcc12 on x86_64

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

herman ten brugge committed 4 years ago

Commit 6bb41a01 parent 5fb582a1 file · +15 −0Browse files

Unified · Split

x86_64-gen.c+15−0
@@ -715,10 +715,18 @@ static void gen_bounds_epilog(void) · 714 unmodified lines
715715
716716 /* generate bound check local freeing */
717717 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) */
718722 greloca(cur_text_section, sym_data, ind + 3, R_X86_64_PC32, -4);
719723 o(0x0d8d48 + ((TREG_FASTCALL_1 == TREG_RDI) * 0x300000)); /* lea xxx(%rip), %rcx/rdi */
720724 gen_le32 (0);
721725 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 */
722730 o(0x585a); /* restore returned value, if any */
723731 }
724732 #endif
@@ -1317,7 +1325,14 @@ void gfunc_call(int nb_args) · 592 unmodified lines
13171325 o(0xe0 + REG_VALUE(r));
13181326 vset(&vtop->type, r | VT_LVAL, 0);
13191327 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 */
13201333 vstore();
1334+ o(0x08c48348); /* add $8,%rsp */
1335+ o(0x5c); /* pop %rsp */
13211336 break;
13221337
13231338 case VT_LDOUBLE:

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