summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
authornickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-28 10:30:46 +0000
committernickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-28 10:30:46 +0000
commit851e684973e14b082bcc5297b0aa77cc7ce8868d (patch)
treede3b301456c7de16320fcb33ace83dc50e815d73 /gcc
parent1e16645ca26a03b84454c61cf46e77d9b635fceb (diff)
downloadppe42-gcc-851e684973e14b082bcc5297b0aa77cc7ce8868d.tar.gz
ppe42-gcc-851e684973e14b082bcc5297b0aa77cc7ce8868d.zip
Add code written by rth to generate use shifts to perform an extension if no
suitable extend patterns can be found. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23398 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/expr.c16
2 files changed, 20 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a84f2124f9a..21ec81f21df 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+Wed Oct 28 10:29:09 1998 Nick Clifton <nickc@cygnus.com>
+
+ * expr.c (convert_move): Use shifts to perform the move if a
+ suitable extend pattern cannot be found. Code written by
+ Richard Henderson <rth@cygnus.com>.
+
Wed Oct 28 03:59:29 1998 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* regclass.c (renumber, regno_allocated): New static variables, moved
diff --git a/gcc/expr.c b/gcc/expr.c
index 37581ec39ce..1dd7cb718d6 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -1100,6 +1100,8 @@ convert_move (to, from, unsignedp)
else
{
enum machine_mode intermediate;
+ rtx tmp;
+ tree shift_amount;
/* Search for a mode to convert via. */
for (intermediate = from_mode; intermediate != VOIDmode;
@@ -1116,8 +1118,18 @@ convert_move (to, from, unsignedp)
return;
}
- /* No suitable intermediate mode. */
- abort ();
+ /* No suitable intermediate mode.
+ Generate what we need with shifts. */
+ shift_amount = build_int_2 (GET_MODE_BITSIZE (to_mode)
+ - GET_MODE_BITSIZE (from_mode), 0);
+ from = gen_lowpart (to_mode, force_reg (from_mode, from));
+ tmp = expand_shift (LSHIFT_EXPR, to_mode, from, shift_amount,
+ to, unsignedp);
+ tmp = expand_shift (RSHIFT_EXPR, to_mode, tmp, shift_amount,
+ to, unsignedp);
+ if (tmp != to)
+ emit_move_insn (to, tmp);
+ return;
}
}
OpenPOWER on IntegriCloud