summaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-23 20:06:46 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-23 20:06:46 +0000
commitc736a8377d4c4b4efe1eec1c2d79e18e51dd8ac5 (patch)
treea4657d0936e95c87f5855af3090630b9fee49cb9 /gcc/simplify-rtx.c
parent8d8dff492b9e21560d2094645b676b952ee720ef (diff)
downloadgcc-c736a8377d4c4b4efe1eec1c2d79e18e51dd8ac5.tar.gz
gcc:
* reload.c (find_reloads_toplev): Use simplify_gen_subreg. * simplify-rtx.c (simplify_subreg): When converting to a non-int mode, try to convert to an integer mode of matching size first. gcc/testsuite: * gcc.c-torture/compile/simd-4.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55687 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index d07de68d223..1791f2e4d79 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -2347,8 +2347,7 @@ simplify_subreg (outermode, op, innermode, byte)
return NULL_RTX;
return simplify_subreg (outermode, op, new_mode, subbyte);
}
- else if (GET_MODE_CLASS (outermode) != MODE_VECTOR_INT
- && GET_MODE_CLASS (outermode) != MODE_VECTOR_FLOAT)
+ else if (GET_MODE_CLASS (outermode) == MODE_INT)
/* This shouldn't happen, but let's not do anything stupid. */
return NULL_RTX;
}
@@ -2387,7 +2386,8 @@ simplify_subreg (outermode, op, innermode, byte)
Later it we should move all simplification code here and rewrite
GEN_LOWPART_IF_POSSIBLE, GEN_HIGHPART, OPERAND_SUBWORD and friends
using SIMPLIFY_SUBREG. */
- if (subreg_lowpart_offset (outermode, innermode) == byte)
+ if (subreg_lowpart_offset (outermode, innermode) == byte
+ && GET_CODE (op) != CONST_VECTOR)
{
rtx new = gen_lowpart_if_possible (outermode, op);
if (new)
@@ -2406,6 +2406,19 @@ simplify_subreg (outermode, op, innermode, byte)
return new;
}
+ if (GET_MODE_CLASS (outermode) != MODE_INT)
+ {
+ enum machine_mode new_mode = int_mode_for_mode (outermode);
+
+ if (new_mode != innermode || byte != 0)
+ {
+ op = simplify_subreg (new_mode, op, innermode, byte);
+ if (! op)
+ return NULL_RTX;
+ return simplify_subreg (outermode, op, new_mode, 0);
+ }
+ }
+
offset = byte * BITS_PER_UNIT;
switch (GET_CODE (op))
{