aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2003-03-03 12:57:10 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2003-03-03 12:57:10 +0000
commit6967a12651bd724104b9d9e695b78372df65d8e6 (patch)
tree6cddecd9ef9c0632ecf828aea7ee22c5b3b5d326 /gcc
parent1f7e87909e7d00c3ef6270c2783d765e164e317f (diff)
downloadgcc-6967a12651bd724104b9d9e695b78372df65d8e6.zip
gcc-6967a12651bd724104b9d9e695b78372df65d8e6.tar.gz
gcc-6967a12651bd724104b9d9e695b78372df65d8e6.tar.bz2
* config/h8300/h8300.md (a peephole2): New.
From-SVN: r63719
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/h8300/h8300.md17
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8b81f7e..5d6ece2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2003-03-03 Kazu Hirata <kazu@cs.umass.edu>
+ * config/h8300/h8300.md (a peephole2): New.
+
+2003-03-03 Kazu Hirata <kazu@cs.umass.edu>
+
* config/h8300/h8300.md (*extzv_8_8): Use shorter code when
operands[0] and operands[1] are different.
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index 28cb87e..1c031b9 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -3561,6 +3561,23 @@
? gen_rtx_GE (VOIDmode, cc0_rtx, const0_rtx)
: gen_rtx_LT (VOIDmode, cc0_rtx, const0_rtx));")
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand" "")
+ (match_operand:SI 1 "register_operand" ""))
+ (set (match_dup 0)
+ (and:SI (match_dup 0)
+ (const_int 255)))]
+ "(TARGET_H8300H || TARGET_H8300S)
+ && REG_P (operands[0])
+ && REG_P (operands[1])
+ && REGNO (operands[0]) != REGNO (operands[1])"
+ [(set (match_dup 0)
+ (const_int 0))
+ (set (strict_low_part (match_dup 2))
+ (match_dup 3))]
+ "operands[2] = gen_rtx_REG (QImode, REGNO (operands[0]));
+ operands[3] = gen_rtx_REG (QImode, REGNO (operands[1]));")
+
;; (compare (reg:SI) (const_int)) takes 6 bytes, so we try to achieve
;; the equivalent with shorter sequences. Here is the summary. Cases
;; are grouped for each define_peephole2.