bootstrappable: ARM: Avoid ternary in argument.

This avoids depending on "70-ternary-arithmetic-argument.c"

* arm-gen.c (gcall_or_jmp): Split calculation and call.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2020-11-15 21:26:20 +01:00
parent f7e98b52a1
commit d0608d0d68
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 10 additions and 0 deletions

View File

@ -749,7 +749,12 @@ static void gcall_or_jmp(int is_jmp)
greloc(cur_text_section, vtop->sym, ind, R_ARM_PC24);
} else
put_elf_reloc(symtab_section, cur_text_section, ind, R_ARM_PC24, 0);
#if !BOOTSTRAP
o(x|(is_jmp?0xE0000000:0xE1000000));
#else
x |= (is_jmp?0xE0000000:0xE1000000);
o(x);
#endif
} else {
if(!is_jmp)
o(0xE28FE004); // add lr,pc,#4
@ -1468,7 +1473,12 @@ int gtst(int inv, int t)
if (nocode_wanted) {
;
} else if (v == VT_CMP) {
#if !BOOTSTRAP
op=mapcc(inv?negcc(vtop->c.i):vtop->c.i);
#else
int tmp_arg = inv?negcc(vtop->c.i):vtop->c.i;
op=mapcc(tmp_arg);
#endif
op|=encbranch(r,t,1);
o(op);
t=r;