aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1993-01-19 19:48:54 -0800
committerJim Wilson <wilson@gcc.gnu.org>1993-01-19 19:48:54 -0800
commitb47de04b0832bb278ca84fcf73c9d32cb9ff580d (patch)
tree51ca560b758d85d6c6c9453e7bcf4a0d4989af5a /gcc
parent4ec74aebd46c19f776bf3851a05ba8d044906997 (diff)
downloadgcc-b47de04b0832bb278ca84fcf73c9d32cb9ff580d.zip
gcc-b47de04b0832bb278ca84fcf73c9d32cb9ff580d.tar.gz
gcc-b47de04b0832bb278ca84fcf73c9d32cb9ff580d.tar.bz2
(cmplpower2_operand): New function.
From-SVN: r3293
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/i960/i960.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c
index f20de25..4163ca4 100644
--- a/gcc/config/i960/i960.c
+++ b/gcc/config/i960/i960.c
@@ -296,12 +296,26 @@ power2_operand (op,mode)
rtx op;
enum machine_mode mode;
{
- if (GET_CODE(op) != CONST_INT)
+ if (GET_CODE (op) != CONST_INT)
return 0;
return exact_log2 (INTVAL (op)) >= 0;
}
+/* Return true if OP is an integer constant which is the complement of a
+ power of 2. */
+
+int
+cmplpower2_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (GET_CODE (op) != CONST_INT)
+ return 0;
+
+ return exact_log2 (~ INTVAL (op)) >= 0;
+}
+
/* If VAL has only one bit set, return the index of that bit. Otherwise
return -1. */