rtl.texi (SUBREG_PROMOTED_UNSIGNED_P): Change definition to take ptr_extend into account as third type of extension.

* doc/rtl.texi (SUBREG_PROMOTED_UNSIGNED_P): Change definition
        to take ptr_extend into account as third type of extension.
        (SUBREG_PROMOTED_UNSIGNED_SET): Definition of new macro to set bit
        fields used by SUBREG_PROMOTED_UNSIGNED_P.
        * rtl.h (SUBREG_PROMOTED_UNSIGNED_SET): New macro.
        (SUBREG_PROMOTED_UNSIGNED_P): Change to return -1 as well as 0 or 1.
        * calls.c (precompute_arguments): Use new macro.
        (expand_call): Ditto.
        * combine.c (nonzero_bits): Ditto.
        (record_promoted_value): Ditto.
        * expr.c (store_expr): Ditto.
        (expand_expr): Ditto.
        * function.c (assign_parms): Ditto.

From-SVN: r50174
This commit is contained in:
Steve Ellcey 2002-03-01 01:19:52 +00:00 committed by Richard Henderson
parent 42d579d879
commit 7879b81e6c
7 changed files with 58 additions and 17 deletions

View File

@ -1,3 +1,19 @@
2002-02-28 Steve Ellcey <sje@cup.hp.com>
* doc/rtl.texi (SUBREG_PROMOTED_UNSIGNED_P): Change definition
to take ptr_extend into account as third type of extension.
(SUBREG_PROMOTED_UNSIGNED_SET): Definition of new macro to set bit
fields used by SUBREG_PROMOTED_UNSIGNED_P.
* rtl.h (SUBREG_PROMOTED_UNSIGNED_SET): New macro.
(SUBREG_PROMOTED_UNSIGNED_P): Change to return -1 as well as 0 or 1.
* calls.c (precompute_arguments): Use new macro.
(expand_call): Ditto.
* combine.c (nonzero_bits): Ditto.
(record_promoted_value): Ditto.
* expr.c (store_expr): Ditto.
(expand_expr): Ditto.
* function.c (assign_parms): Ditto.
2002-02-28 Alexandre Oliva <aoliva@redhat.com>
* gcc.c (init_gcc_specs): Get -static and -static-libgcc to

View File

@ -1542,8 +1542,8 @@ precompute_arguments (flags, num_actuals, args)
args[i].initial_value
= gen_lowpart_SUBREG (mode, args[i].value);
SUBREG_PROMOTED_VAR_P (args[i].initial_value) = 1;
SUBREG_PROMOTED_UNSIGNED_P (args[i].initial_value)
= args[i].unsignedp;
SUBREG_PROMOTED_UNSIGNED_SET (args[i].initial_value,
args[i].unsignedp);
}
#endif
}
@ -3279,7 +3279,7 @@ expand_call (exp, target, ignore)
}
target = gen_rtx_SUBREG (TYPE_MODE (type), target, offset);
SUBREG_PROMOTED_VAR_P (target) = 1;
SUBREG_PROMOTED_UNSIGNED_P (target) = unsignedp;
SUBREG_PROMOTED_UNSIGNED_SET (target, unsignedp);
}
#endif

View File

@ -8270,7 +8270,7 @@ nonzero_bits (x, mode)
been zero-extended, we know that at least the high-order bits
are zero, though others might be too. */
if (SUBREG_PROMOTED_VAR_P (x) && SUBREG_PROMOTED_UNSIGNED_P (x))
if (SUBREG_PROMOTED_VAR_P (x) && SUBREG_PROMOTED_UNSIGNED_P (x) > 0)
nonzero = (GET_MODE_MASK (GET_MODE (x))
& nonzero_bits (SUBREG_REG (x), GET_MODE (x)));
@ -11325,7 +11325,7 @@ record_promoted_value (insn, subreg)
if (reg_last_set[regno] == insn)
{
if (SUBREG_PROMOTED_UNSIGNED_P (subreg))
if (SUBREG_PROMOTED_UNSIGNED_P (subreg) > 0)
reg_last_set_nonzero_bits[regno] &= GET_MODE_MASK (mode);
}

View File

@ -631,13 +631,29 @@ string constant pool.
Stored in the @code{frame_related} field and printed as @samp{/f}.
@findex SUBREG_PROMOTED_UNSIGNED_P
@cindex @code{subreg} and @samp{/u} and @samp{/v}
@cindex @code{unchanging}, in @code{subreg}
@cindex @code{volatil}, in @code{subreg}
@item SUBREG_PROMOTED_UNSIGNED_P (@var{x})
Returns a value greater then zero for a @code{subreg} that has
@code{SUBREG_PROMOTED_VAR_P} nonzero if the object being referenced is kept
zero-extended, zero if it is kept sign-extended, and less then zero if it is
extended some other way via the @code{ptr_extend} instruction.
Stored in the @code{unchanging}
field and @code{volatil} field, printed as @samp{/u} and @samp{/v}.
This macro may only be used to get the value it may not be used to change
the value. Use @code{SUBREG_PROMOTED_UNSIGNED_SET} to change the value.
@findex SUBREG_PROMOTED_UNSIGNED_SET
@cindex @code{subreg} and @samp{/u}
@cindex @code{unchanging}, in @code{subreg}
@item SUBREG_PROMOTED_UNSIGNED_P (@var{x})
Nonzero in a @code{subreg} that has @code{SUBREG_PROMOTED_VAR_P} nonzero
if the object being referenced is kept zero-extended and zero if it
is kept sign-extended. Stored in the @code{unchanging} field and
printed as @samp{/u}.
@cindex @code{volatil}, in @code{subreg}
@item SUBREG_PROMOTED_UNSIGNED_SET (@var{x})
Set the @code{unchanging} and @code{volatil} fields in a @code{subreg}
to reflect zero, sign, or other extension. If @code{volatil} is
zero, then @code{unchanging} as nonzero means zero extension and as
zero means sign extension. If @code{volatil} is nonzero then some
other type of extension was done via the @code{ptr_extend} instruction.
@findex SUBREG_PROMOTED_VAR_P
@cindex @code{subreg} and @samp{/s}

View File

@ -4049,8 +4049,8 @@ store_expr (exp, target, want_value)
{
temp = gen_lowpart_SUBREG (GET_MODE (target), temp);
SUBREG_PROMOTED_VAR_P (temp) = 1;
SUBREG_PROMOTED_UNSIGNED_P (temp)
= SUBREG_PROMOTED_UNSIGNED_P (target);
SUBREG_PROMOTED_UNSIGNED_SET (temp,
SUBREG_PROMOTED_UNSIGNED_P (target));
}
else
temp = convert_modes (GET_MODE (target),
@ -6289,7 +6289,7 @@ expand_expr (exp, target, tmode, modifier)
temp = gen_lowpart_SUBREG (mode, DECL_RTL (exp));
SUBREG_PROMOTED_VAR_P (temp) = 1;
SUBREG_PROMOTED_UNSIGNED_P (temp) = unsignedp;
SUBREG_PROMOTED_UNSIGNED_SET (temp, unsignedp);
return temp;
}
@ -6409,7 +6409,7 @@ expand_expr (exp, target, tmode, modifier)
{
temp = gen_lowpart_SUBREG (mode, SAVE_EXPR_RTL (exp));
SUBREG_PROMOTED_VAR_P (temp) = 1;
SUBREG_PROMOTED_UNSIGNED_P (temp) = unsignedp;
SUBREG_PROMOTED_UNSIGNED_SET (temp, unsignedp);
}
if (temp == const0_rtx)
@ -6431,7 +6431,7 @@ expand_expr (exp, target, tmode, modifier)
promote_mode (type, mode, &unsignedp, 0);
temp = gen_lowpart_SUBREG (mode, SAVE_EXPR_RTL (exp));
SUBREG_PROMOTED_VAR_P (temp) = 1;
SUBREG_PROMOTED_UNSIGNED_P (temp) = unsignedp;
SUBREG_PROMOTED_UNSIGNED_SET (temp, unsignedp);
return temp;
}

View File

@ -4733,7 +4733,7 @@ assign_parms (fndecl)
/* The argument is already sign/zero extended, so note it
into the subreg. */
SUBREG_PROMOTED_VAR_P (tempreg) = 1;
SUBREG_PROMOTED_UNSIGNED_P (tempreg) = unsignedp;
SUBREG_PROMOTED_UNSIGNED_SET (tempreg, unsignedp);
}
/* TREE_USED gets set erroneously during expand_assignment. */

View File

@ -853,7 +853,16 @@ extern unsigned int subreg_regno PARAMS ((rtx));
when assigning to SUBREG_REG. */
#define SUBREG_PROMOTED_VAR_P(RTX) ((RTX)->in_struct)
#define SUBREG_PROMOTED_UNSIGNED_P(RTX) ((RTX)->unchanging)
#define SUBREG_PROMOTED_UNSIGNED_SET(RTX, VAL) \
do { \
if ((VAL) < 0) \
(RTX)->volatil = 1; \
else { \
(RTX)->volatil = 0; \
(RTX)->unchanging = (VAL); \
} \
} while (0)
#define SUBREG_PROMOTED_UNSIGNED_P(RTX) ((RTX)->volatil ? -1 : (RTX)->unchanging)
/* Access various components of an ASM_OPERANDS rtx. */