aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>2023-01-12 13:26:42 +0900
committerMax Filippov <jcmvbkbc@gmail.com>2023-01-12 04:44:06 -0800
commit117be79bd84ed21b47588d0cd86d72d5d1757cae (patch)
tree66de3fca6c104561bf3afa8058b60d104c6f3cd4 /gcc
parentbb65bd084a8739feb5b85f87135c531fc8b86572 (diff)
downloadgcc-117be79bd84ed21b47588d0cd86d72d5d1757cae.zip
gcc-117be79bd84ed21b47588d0cd86d72d5d1757cae.tar.gz
gcc-117be79bd84ed21b47588d0cd86d72d5d1757cae.tar.bz2
xtensa: Optimize ctzsi2 and ffssi2 a bit
This patch saves one byte when the Code Density Option is enabled, gcc/ChangeLog: * config/xtensa/xtensa.md (ctzsi2, ffssi2): Rearrange the emitting codes.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/xtensa/xtensa.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
index b498983..764da63 100644
--- a/gcc/config/xtensa/xtensa.md
+++ b/gcc/config/xtensa/xtensa.md
@@ -477,8 +477,8 @@
emit_insn (gen_negsi2 (temp, operands[1]));
emit_insn (gen_andsi3 (temp, temp, operands[1]));
emit_insn (gen_clzsi2 (temp, temp));
- emit_insn (gen_negsi2 (temp, temp));
- emit_insn (gen_addsi3 (operands[0], temp, GEN_INT (31)));
+ emit_move_insn (operands[0], GEN_INT (31));
+ emit_insn (gen_subsi3 (operands[0], operands[0], temp));
DONE;
})
@@ -491,8 +491,8 @@
emit_insn (gen_negsi2 (temp, operands[1]));
emit_insn (gen_andsi3 (temp, temp, operands[1]));
emit_insn (gen_clzsi2 (temp, temp));
- emit_insn (gen_negsi2 (temp, temp));
- emit_insn (gen_addsi3 (operands[0], temp, GEN_INT (32)));
+ emit_move_insn (operands[0], GEN_INT (32));
+ emit_insn (gen_subsi3 (operands[0], operands[0], temp));
DONE;
})