Commit b47de04b by Jim Wilson

(cmplpower2_operand): New function.

From-SVN: r3293
parent 4ec74aeb
...@@ -296,12 +296,26 @@ power2_operand (op,mode) ...@@ -296,12 +296,26 @@ power2_operand (op,mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode;
{ {
if (GET_CODE(op) != CONST_INT) if (GET_CODE (op) != CONST_INT)
return 0; return 0;
return exact_log2 (INTVAL (op)) >= 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 /* If VAL has only one bit set, return the index of that bit. Otherwise
return -1. */ return -1. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment