diff options
author | Jan Hubicka <hubicka@freesoft.cz> | 1999-12-01 23:35:15 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 1999-12-01 22:35:15 +0000 |
commit | 1c27d4b20f0bfb8e17e28b51678069b18f2d4cb1 (patch) | |
tree | 9a44ad9b69467274321ddbc40bc062d35ad4e6e9 /gcc | |
parent | c45fd7f9b23593029bd4d846b7d8fc4fe140de25 (diff) | |
download | gcc-1c27d4b20f0bfb8e17e28b51678069b18f2d4cb1.zip gcc-1c27d4b20f0bfb8e17e28b51678069b18f2d4cb1.tar.gz gcc-1c27d4b20f0bfb8e17e28b51678069b18f2d4cb1.tar.bz2 |
(addsi): New add to lea splitter.
* (addsi): New add to lea splitter.
(ashlsi): Likewise.
(lea to add/shift peep2): New.
From-SVN: r30745
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/i386/i386.md | 48 |
2 files changed, 53 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c0ab9c..4f18085 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Fri Nov 26 10:59:12 CET 1999 Jan Hubicka <hubicka@freesoft.cz> + + * (addsi): New add to lea splitter. + (ashlsi): Likewise. + (lea to add/shift peep2): New. + 1999-12-01 Mark Salter <msalter@cygnus.com> * config/mips/elf.h (STARTFILE_SPEC): Add no-crt0. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 6966cf2..86939a9 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -2107,7 +2107,7 @@ (define_insn "*zero_extendqihi2_movzbw" [(set (match_operand:HI 0 "register_operand" "=r") (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "qm")))] - "!TARGET_ZERO_EXTEND_WITH_AND || optimize_size" + "(!TARGET_ZERO_EXTEND_WITH_AND || optimize_size) && reload_completed" "movz{bw|x}\\t{%1, %0|%0, %1}" [(set_attr "type" "imovx")]) @@ -3096,6 +3096,19 @@ ] (const_string "alu")))]) +;; Convert lea to the lea pattern to avoid flags dependency. +(define_split + [(set (match_operand:SI 0 "register_operand" "") + (plus:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "nonmemory_operand" ""))) + (clobber (reg:CC 17))] + "reload_completed + && true_regnum (operands[0]) != true_regnum (operands[1])" + [(set (match_dup 0) + (plus:SI (match_dup 1) + (match_dup 2)))] + "") + (define_insn "*addsi_2" [(set (reg:CCNO 17) (compare:CCNO @@ -5501,6 +5514,19 @@ ] (const_string "ishift")))]) +;; Convert lea to the lea pattern to avoid flags dependency. +(define_split + [(set (match_operand:SI 0 "register_operand" "") + (ashift:SI (match_operand:SI 1 "register_operand" "") + (match_operand:QI 2 "immediate_operand" ""))) + (clobber (reg:CC 17))] + "reload_completed + && true_regnum (operands[0]) != true_regnum (operands[1])" + [(set (match_dup 0) + (mult:SI (match_dup 1) + (match_dup 2)))] + "operands[2] = GEN_INT (1 << INTVAL (operands[2]));") + (define_insn "*ashlsi3_cmpno" [(set (reg:CCNO 17) (compare:CCNO @@ -8494,6 +8520,26 @@ [(parallel [(set (match_dup 0) (const_int -1)) (clobber (reg:CC 17))])] "operands[0] = gen_rtx_REG (SImode, true_regnum (operands[0]));") + +;; Attempt to convert simple leas to adds. These can be created by +;; move expanders. +(define_peephole2 + [(set (match_operand:SI 0 "register_operand" "") + (plus:SI (match_dup 0) + (match_operand:SI 1 "nonmemory_operand" "")))] + "reg_dead_p (insn, gen_rtx_REG (CCmode, FLAGS_REG))" + [(parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1))) + (clobber (reg:CC 17))])] + "") + +(define_peephole2 + [(set (match_operand:SI 0 "register_operand" "") + (mult:SI (match_dup 0) + (match_operand:SI 1 "immediate_operand" "")))] + "reg_dead_p (insn, gen_rtx_REG (CCmode, FLAGS_REG))" + [(parallel [(set (match_dup 0) (ashift:SI (match_dup 0) (match_dup 2))) + (clobber (reg:CC 17))])] + "operands[2] = GEN_INT (exact_log2 (INTVAL (operands[1])));") ;; Call-value patterns last so that the wildcard operand does not ;; disrupt insn-recog's switch tables. |