thumb2.md
56 KB
-
[ARM] Do no clobber r4 in Armv8-M nonsecure call · 0a413fbc
Expanders for Armv8-M nonsecure call unnecessarily clobber r4 despite the libcall they perform not writing to r4. Furthermore, the requirement for the branch target address to be in r4 as expected by the libcall is modeled in a convoluted way in the define_insn patterns: the address is a register match_operand constrained by the match_dup for the clobber which is guaranteed to be r4 due to the expander. This patch simplifies all this by simply requiring the address to be in r4 and removing the clobbers. Expanders are left alone because cmse_nonsecure_call_clear_caller_saved relies on branch target memory attributes which would be lost if expanding to reg:SI R4_REGNUM. 2017-11-20 Thomas Preud'homme <thomas.preudhomme@arm.com> gcc/ * config/arm/arm.md (R4_REGNUM): Define constant. (nonsecure_call_internal): Remove r4 clobber. (nonsecure_call_value_internal): Likewise. * config/arm/thumb1.md (nonsecure_call_reg_thumb1_v5): Remove second clobber and resequence match_operands. (nonsecure_call_value_reg_thumb1_v5): Likewise. * config/arm/thumb2.md (nonsecure_call_reg_thumb2): Likewise. (nonsecure_call_value_reg_thumb2): Likewise. From-SVN: r254950
Thomas Preud'homme committed