summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorWei Guozhi <carrot@google.com>2010-08-12 02:03:59 +0000
committerWei Guozhi <carrot@gcc.gnu.org>2010-08-12 02:03:59 +0000
commit3565ffedc8f301d0f13d7c5d2aa89ea8261c2299 (patch)
treebd3bb1365a96238b1158b561bea82a2ba50c5d57 /gcc
parent835e673451bc33f464caf735821073b2232fa152 (diff)
downloadgcc-3565ffedc8f301d0f13d7c5d2aa89ea8261c2299.tar.gz
arm.md (andsi3): Change to zero extension if possible.
* config/arm/arm.md (andsi3): Change to zero extension if possible. * config/arm/thumb2.md (thumb2_zero_extendqisi2_v6): Change the name. * gcc.target/arm/pr44999.c: New testcase. From-SVN: r163184
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/arm/arm.md14
-rw-r--r--gcc/config/arm/thumb2.md2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/arm/pr44999.c9
5 files changed, 32 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 031e7d25da2..d55ddbe4012 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-08-12 Wei Guozhi <carrot@google.com>
+
+ PR target/44999
+ * config/arm/arm.md (andsi3): Change to zero extension if possible.
+ * config/arm/thumb2.md (thumb2_zero_extendqisi2_v6): Change the name.
+
2010-08-11 Vladimir Makarov <vmakarov@redhat.com>
* ira-int.h (ira_remove_allocno_copy_from_list): Remove.
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 78b1710f8c8..1506935901c 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -1937,9 +1937,17 @@
{
if (GET_CODE (operands[2]) == CONST_INT)
{
- arm_split_constant (AND, SImode, NULL_RTX,
- INTVAL (operands[2]), operands[0],
- operands[1], optimize && can_create_pseudo_p ());
+ if (INTVAL (operands[2]) == 255 && arm_arch6)
+ {
+ operands[1] = convert_to_mode (QImode, operands[1], 1);
+ emit_insn (gen_thumb2_zero_extendqisi2_v6 (operands[0],
+ operands[1]));
+ }
+ else
+ arm_split_constant (AND, SImode, NULL_RTX,
+ INTVAL (operands[2]), operands[0],
+ operands[1],
+ optimize && can_create_pseudo_p ());
DONE;
}
diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md
index 46767d49f76..2e4cfc96d43 100644
--- a/gcc/config/arm/thumb2.md
+++ b/gcc/config/arm/thumb2.md
@@ -907,7 +907,7 @@
(set_attr "neg_pool_range" "*,250")]
)
-(define_insn "*thumb2_zero_extendqisi2_v6"
+(define_insn "thumb2_zero_extendqisi2_v6"
[(set (match_operand:SI 0 "s_register_operand" "=r,r")
(zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
"TARGET_THUMB2 && arm_arch6"
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e76af3f266d..6ac7bbac087 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-12 Wei Guozhi <carrot@google.com>
+
+ PR target/44999
+ * gcc.target/arm/pr44999.c: New testcase.
+
2010-08-12 Jie Zhang <jie@codesourcery.com>
* gcc.dg/graphite/interchange-9.c (M): Define to be 111.
diff --git a/gcc/testsuite/gcc.target/arm/pr44999.c b/gcc/testsuite/gcc.target/arm/pr44999.c
new file mode 100644
index 00000000000..d07dca1a010
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr44999.c
@@ -0,0 +1,9 @@
+/* Use UXTB to extract the lowest byte. */
+/* { dg-options "-mthumb -Os" } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-final { scan-assembler "uxtb" } } */
+
+int tp(int x, int y)
+{
+ return (x & 0xff) - (y & 0xffff);
+}