* [SH] Reorg some CONST_OK_ macros
@ 2012-07-15 18:58 Oleg Endo
2012-07-16 0:22 ` Kaz Kojima
0 siblings, 1 reply; 2+ messages in thread
From: Oleg Endo @ 2012-07-15 18:58 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 390 bytes --]
Hello,
This patch replaces usages of CONST_OK_FOR_I06 with
satisfies_constraint_I06 and moves the CONST_OK_FOR_I10 macro to sh.c.
Tested with 'make all-gcc'.
OK?
Cheers,
Oleg
ChangeLog:
* config/sh/sh.h (CONST_OK_FOR_I06): Delete.
(CONST_OK_FOR_I10): Move macro to ...
* config/sh/sh.c: ... here.
(sh_legitimate_index_p): Use satisfies_constraint_I06
instead of CONST_OK_FOR_I06.
[-- Attachment #2: sh_reorg_const_ok_macros.patch --]
[-- Type: text/x-patch, Size: 1559 bytes --]
Index: gcc/config/sh/sh.c
===================================================================
--- gcc/config/sh/sh.c (revision 189427)
+++ gcc/config/sh/sh.c (working copy)
@@ -63,6 +63,9 @@
#define LSW (TARGET_LITTLE_ENDIAN ? 0 : 1)
/* These are some macros to abstract register modes. */
+#define CONST_OK_FOR_I10(VALUE) (((HOST_WIDE_INT)(VALUE)) >= -512 \
+ && ((HOST_WIDE_INT)(VALUE)) <= 511)
+
#define CONST_OK_FOR_ADD(size) \
(TARGET_SHMEDIA ? CONST_OK_FOR_I10 (size) : CONST_OK_FOR_I08 (size))
#define GEN_MOV (*(TARGET_SHMEDIA64 ? gen_movdi : gen_movsi))
@@ -9776,7 +9779,7 @@
/* Check if this is the address of an unaligned load / store. */
if (mode == VOIDmode)
- return CONST_OK_FOR_I06 (INTVAL (op));
+ return satisfies_constraint_I06 (op);
size = GET_MODE_SIZE (mode);
return (!(INTVAL (op) & (size - 1))
Index: gcc/config/sh/sh.h
===================================================================
--- gcc/config/sh/sh.h (revision 189427)
+++ gcc/config/sh/sh.h (working copy)
@@ -1213,12 +1213,8 @@
\f
/* Defines for sh.md and constraints.md. */
-#define CONST_OK_FOR_I06(VALUE) (((HOST_WIDE_INT)(VALUE)) >= -32 \
- && ((HOST_WIDE_INT)(VALUE)) <= 31)
#define CONST_OK_FOR_I08(VALUE) (((HOST_WIDE_INT)(VALUE))>= -128 \
&& ((HOST_WIDE_INT)(VALUE)) <= 127)
-#define CONST_OK_FOR_I10(VALUE) (((HOST_WIDE_INT)(VALUE)) >= -512 \
- && ((HOST_WIDE_INT)(VALUE)) <= 511)
#define CONST_OK_FOR_I16(VALUE) (((HOST_WIDE_INT)(VALUE)) >= -32768 \
&& ((HOST_WIDE_INT)(VALUE)) <= 32767)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [SH] Reorg some CONST_OK_ macros
2012-07-15 18:58 [SH] Reorg some CONST_OK_ macros Oleg Endo
@ 2012-07-16 0:22 ` Kaz Kojima
0 siblings, 0 replies; 2+ messages in thread
From: Kaz Kojima @ 2012-07-16 0:22 UTC (permalink / raw)
To: oleg.endo; +Cc: gcc-patches
Oleg Endo <oleg.endo@t-online.de> wrote:
> This patch replaces usages of CONST_OK_FOR_I06 with
> satisfies_constraint_I06 and moves the CONST_OK_FOR_I10 macro to sh.c.
> Tested with 'make all-gcc'.
>
> OK?
OK.
Regards,
kaz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-16 0:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-15 18:58 [SH] Reorg some CONST_OK_ macros Oleg Endo
2012-07-16 0:22 ` Kaz Kojima
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).