diff options
author | Richard Earnshaw <rearnsha@arm.com> | 2003-12-08 11:05:59 +0000 |
---|---|---|
committer | Richard Earnshaw <rearnsha@gcc.gnu.org> | 2003-12-08 11:05:59 +0000 |
commit | de9315db9c74db72425230b6af548c9ddfe02bbd (patch) | |
tree | 99605b68624a6000639c31447dbf9ca1c0184b97 | |
parent | c41affc725d86d77eed0983fa25e5d0984dfaf39 (diff) | |
download | gcc-de9315db9c74db72425230b6af548c9ddfe02bbd.zip gcc-de9315db9c74db72425230b6af548c9ddfe02bbd.tar.gz gcc-de9315db9c74db72425230b6af548c9ddfe02bbd.tar.bz2 |
arm.md: New split to transform ((X << y) - 1) into ~(~(X-1) << y) for constant X.
* arm.md: New split to transform ((X << y) - 1) into ~(~(X-1) << y)
for constant X.
From-SVN: r74417
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/arm/arm.md | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 48f0406..a6c33ac 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-12-08 Richard Earnshaw <rearnsha@arm.com> + + * arm.md: New split to transform ((X << y) - 1) into ~(~(X-1) << y) + for constant X. + 2003-12-08 Richard Sandiford <rsandifo@redhat.com> * calls.c (expand_call): Don't try using tail or recursive calls diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 3c4dffc..d5d4258 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -847,6 +847,20 @@ (set_attr "length" "4,8")] ) +; transform ((x << y) - 1) to ~(~(x-1) << y) Where X is a constant. +(define_split + [(set (match_operand:SI 0 "s_register_operand" "") + (plus:SI (ashift:SI (match_operand:SI 1 "const_int_operand" "") + (match_operand:SI 2 "s_register_operand" "")) + (const_int -1))) + (clobber (match_operand:SI 3 "s_register_operand" ""))] + "TARGET_ARM" + [(set (match_dup 3) (match_dup 1)) + (set (match_dup 0) (not:SI (ashift:SI (match_dup 3) (match_dup 2))))] + " + operands[1] = GEN_INT (~(INTVAL (operands[1]) - 1)); +") + (define_expand "addsf3" [(set (match_operand:SF 0 "s_register_operand" "") (plus:SF (match_operand:SF 1 "s_register_operand" "") |