diff options
author | Torbjorn Granlund <tege@gnu.org> | 1995-04-03 22:53:36 +0000 |
---|---|---|
committer | Torbjorn Granlund <tege@gnu.org> | 1995-04-03 22:53:36 +0000 |
commit | 67cd4f83cfddd1ae43bb5183a5ecc79d79528ef2 (patch) | |
tree | 1fa4b8d20ed871a4c883e214ebe610659fc49ca0 /gcc | |
parent | 88f63c77d975085a3f2f1c73f2fe2a187b087f84 (diff) | |
download | gcc-67cd4f83cfddd1ae43bb5183a5ecc79d79528ef2.zip gcc-67cd4f83cfddd1ae43bb5183a5ecc79d79528ef2.tar.gz gcc-67cd4f83cfddd1ae43bb5183a5ecc79d79528ef2.tar.bz2 |
(const_uint32_operand): New function.
(const_sint32_operand): New function.
From-SVN: r9306
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/m68k/m68k.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index 836dab3..b3b69b9 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -2426,3 +2426,36 @@ strict_low_part_peephole_ok (mode, first_insn, target) return 0; } + +/* Accept integer operands in the range 0..0xffffffff. We have to check the + range carefully since this predicate is used in DImode contexts. Also, we + need some extra crud to make it work when hosted on 64-bit machines. */ + +int +const_uint32_operand (op, mode) + rtx op; + enum machine_mode mode; +{ +#if HOST_BITS_PER_WIDE_INT > 32 + /* All allowed constants will fit a CONST_INT. */ + return (GET_CODE (op) == CONST_INT + && (INTVAL (op) >= 0 && INTVAL (op) <= 0xffffffffL)); +#else + return (GET_CODE (op) == CONST_INT + || (GET_CODE (op) == CONST_DOUBLE && CONST_DOUBLE_HIGH (op) == 0)); +#endif +} + +/* Accept integer operands in the range -0x80000000..0x7fffffff. We have + to check the range carefully since this predicate is used in DImode + contexts. */ + +int +const_sint32_operand (op, mode) + rtx op; + enum machine_mode mode; +{ + /* All allowed constants will fit a CONST_INT. */ + return (GET_CODE (op) == CONST_INT + && (INTVAL (op) >= (-0x7fffffff - 1) && INTVAL (op) <= 0x7fffffff)); +} |