aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc/tm.texi
diff options
context:
space:
mode:
authorAdam Nemet <anemet@caviumnetworks.com>2006-04-17 01:59:41 +0000
committerAdam Nemet <nemet@gcc.gnu.org>2006-04-17 01:59:41 +0000
commitb12cbf2cc559fa466b854d89bc4069d7282a881f (patch)
tree58a07ed2ef2fe0457a23ba7f949c521901afd762 /gcc/doc/tm.texi
parentca8b30c8d14e272af6129abc5c7df4a1f2961889 (diff)
downloadgcc-b12cbf2cc559fa466b854d89bc4069d7282a881f.zip
gcc-b12cbf2cc559fa466b854d89bc4069d7282a881f.tar.gz
gcc-b12cbf2cc559fa466b854d89bc4069d7282a881f.tar.bz2
target.h (struct gcc_target): Add mode_rep_extended.
* target.h (struct gcc_target): Add mode_rep_extended. * rtlanal.c (num_sign_bit_copies_in_rep): New global. (init_num_sign_bit_copies_in_rep): Initialize it using mode_rep_extended. (truncate_to_mode): Use it. (init_rtlanal): Call init_num_sign_bit_copies_in_rep. * targhooks.h (default_mode_rep_extended): Declare it. * targhooks.c (default_mode_rep_extended): Define it. * target-def.h (TARGET_MODE_REP_EXTENDED): New macro. Default to default_mode_rep_extended. (TARGET_INITIALIZER): Include it. * doc/tm.texi (Misc): Document it. * config/mips/mips.c (TARGET_TRUNCATED_TO_MODE): Override it. (mips_truncated_to_mode): New function. From-SVN: r112998
Diffstat (limited to 'gcc/doc/tm.texi')
-rw-r--r--gcc/doc/tm.texi28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 9ee6a83..639e9e9 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -9143,6 +9143,34 @@ If this is the case, making @code{TRULY_NOOP_TRUNCATION} return 0 in
such cases may improve things.
@end defmac
+@deftypefn {Target Hook} int TARGET_MODE_REP_EXTENDED (enum machine_mode @var{mode}, enum machine_mode @var{rep_mode})
+The representation of an intergral mode can be such that the values
+are always extended to a wider integral mode. Return
+@code{SIGN_EXTEND} if values of @var{mode} are represented in
+sign-extended form to @var{rep_mode}. Return @code{UNKNOWN}
+otherwise. (Currently, none of the targets use zero-extended
+representation this way so unlike @code{LOAD_EXTEND_OP},
+@code{TARGET_MODE_REP_EXTENDED} is expected to return either
+@code{SIGN_EXTEND} or @code{UNKNOWN}. Also no target extends
+@var{mode} to @var{mode_rep} so that @var{mode_rep} is not the next
+widest integral mode and currently we take advantage of this fact.)
+
+Similarly to @code{LOAD_EXTEND_OP} you may return a non-@code{UNKNOWN}
+value even if the extension is not performed on certain hard registers
+as long as for the @code{REGNO_REG_CLASS} of these hard registers
+@code{CANNOT_CHANGE_MODE_CLASS} returns nonzero.
+
+Note that @code{TARGET_MODE_REP_EXTENDED} and @code{LOAD_EXTEND_OP}
+describe two related properties. If you define
+@code{TARGET_MODE_REP_EXTENDED (mode, word_mode)} you probably also want
+to define @code{LOAD_EXTEND_OP (mode)} to return the same type of
+extension.
+
+In order to enforce the representation of @code{mode},
+@code{TRULY_NOOP_TRUNCATION} should return false when truncating to
+@code{mode}.
+@end deftypefn
+
@defmac STORE_FLAG_VALUE
A C expression describing the value returned by a comparison operator
with an integral mode and stored by a store-flag instruction