aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@wdc.com>2020-07-31 23:52:20 +0100
committerMaciej W. Rozycki <macro@wdc.com>2020-07-31 23:52:20 +0100
commit9fa4023c7aa0ab126b00fe7e640ed9858b249c77 (patch)
treed5b31bcdac3dd07ec7bf1cb16466752d277e3e6c /gcc/c
parentd1da25fe991ca7140c4ecce39b30aacd6f78c921 (diff)
downloadgcc-9fa4023c7aa0ab126b00fe7e640ed9858b249c77.zip
gcc-9fa4023c7aa0ab126b00fe7e640ed9858b249c77.tar.gz
gcc-9fa4023c7aa0ab126b00fe7e640ed9858b249c77.tar.bz2
RISC-V/libgcc: Reduce the size of RV64 millicode by 6 bytes
Rewrite code sequences throughout the 64-bit RISC-V `__riscv_save_*' routines replacing `li t1, -48', `li t1, -64', and `li t1, -80', instructions, which do not have a compressed encoding, respectively with `li t1, 3', `li t1, 4', and `li t1, 4', which do, and then adjusting the remaining code accordingly observing that `sub sp, sp, t1' takes the same amount of space as an `slli t1, t1, 4'/`add sp, sp, t1' instruction pair does, again due to the use of compressed encodings, saving 6 bytes total. This change does increase code size by 4 bytes for RISC-V processors lacking the compressed instruction set, however their users couldn't care about the code size or they would have chosen an implementation that does have the compressed instructions, wouldn't they? libgcc/ * config/riscv/save-restore.S [__riscv_xlen == 64] (__riscv_save_10, __riscv_save_8, __riscv_save_6, __riscv_save_4) (__riscv_save_2): Replace negative immediates used for the final stack pointer adjustment with positive ones, right-shifted by 4.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions