Commit 3306eb80 by Geoff Keating Committed by Jeff Law

expmed.c (extract_bit_field): Allow for the case of non-integer objects that are…

expmed.c (extract_bit_field): Allow for the case of non-integer objects that are smaller than a word (like...

        * expmed.c (extract_bit_field): Allow for the case of non-integer
        objects that are smaller than a word (like SFmode on a 64-bit
        machine).

From-SVN: r30185
parent 543c94cc
...@@ -6,6 +6,10 @@ Tue Oct 26 00:41:54 1999 Bernd Schmidt <bernds@cygnus.co.uk> ...@@ -6,6 +6,10 @@ Tue Oct 26 00:41:54 1999 Bernd Schmidt <bernds@cygnus.co.uk>
Mon Oct 25 23:54:45 1999 Geoff Keating <geoffk@cygnus.com> Mon Oct 25 23:54:45 1999 Geoff Keating <geoffk@cygnus.com>
* expmed.c (extract_bit_field): Allow for the case of non-integer
objects that are smaller than a word (like SFmode on a 64-bit
machine).
* loop.c (basic_induction_var): A non-integer variable which is * loop.c (basic_induction_var): A non-integer variable which is
being set by a paradoxical subreg is probably not a biv. being set by a paradoxical subreg is probably not a biv.
......
...@@ -963,6 +963,7 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp, ...@@ -963,6 +963,7 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
register rtx op0 = str_rtx; register rtx op0 = str_rtx;
rtx spec_target = target; rtx spec_target = target;
rtx spec_target_subreg = 0; rtx spec_target_subreg = 0;
enum machine_mode int_mode;
#ifdef HAVE_extv #ifdef HAVE_extv
int extv_bitsize; int extv_bitsize;
enum machine_mode extv_mode; enum machine_mode extv_mode;
...@@ -1168,10 +1169,19 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp, ...@@ -1168,10 +1169,19 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
NULL_RTX, 0); NULL_RTX, 0);
} }
/* From here on we know the desired field is smaller than a word /* From here on we know the desired field is smaller than a word. */
so we can assume it is an integer. So we can safely extract it as one
size of integer, if necessary, and then truncate or extend /* Check if there is a correspondingly-sized integer field, so we can
to the size that is wanted. */ safely extract it as one size of integer, if necessary; then
truncate or extend to the size that is wanted; then use SUBREGs or
convert_to_mode to get one of the modes we really wanted. */
int_mode = int_mode_for_mode (tmode);
if (int_mode == BLKmode)
int_mode = int_mode_for_mode (mode);
if (int_mode == BLKmode)
abort(); /* Should probably push op0 out to memory and then
do a load. */
/* OFFSET is the number of words or bytes (UNIT says which) /* OFFSET is the number of words or bytes (UNIT says which)
from STR_RTX to the first word or byte containing part of the field. */ from STR_RTX to the first word or byte containing part of the field. */
...@@ -1326,15 +1336,15 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp, ...@@ -1326,15 +1336,15 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
else else
{ {
delete_insns_since (last); delete_insns_since (last);
target = extract_fixed_bit_field (tmode, op0, offset, bitsize, target = extract_fixed_bit_field (int_mode, op0, offset, bitsize,
bitpos, target, 1, align); bitpos, target, 1, align);
} }
} }
else else
extzv_loses: extzv_loses:
#endif #endif
target = extract_fixed_bit_field (tmode, op0, offset, bitsize, bitpos, target = extract_fixed_bit_field (int_mode, op0, offset, bitsize,
target, 1, align); bitpos, target, 1, align);
} }
else else
{ {
...@@ -1462,15 +1472,15 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp, ...@@ -1462,15 +1472,15 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
else else
{ {
delete_insns_since (last); delete_insns_since (last);
target = extract_fixed_bit_field (tmode, op0, offset, bitsize, target = extract_fixed_bit_field (int_mode, op0, offset, bitsize,
bitpos, target, 0, align); bitpos, target, 0, align);
} }
} }
else else
extv_loses: extv_loses:
#endif #endif
target = extract_fixed_bit_field (tmode, op0, offset, bitsize, bitpos, target = extract_fixed_bit_field (int_mode, op0, offset, bitsize,
target, 0, align); bitpos, target, 0, align);
} }
if (target == spec_target) if (target == spec_target)
return target; return target;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment