diff options
author | Torbjorn Granlund <tege@gnu.org> | 1995-12-14 23:16:23 +0000 |
---|---|---|
committer | Torbjorn Granlund <tege@gnu.org> | 1995-12-14 23:16:23 +0000 |
commit | f20200f4bc55067621823cd2f0ba9e87c18b4e17 (patch) | |
tree | f1182ec1b9a1043cef2341bd4226b7fb03dfffad /gcc/config/i960 | |
parent | 82eaec4ab0dd5cb17c153df8fab62f54f3a260b5 (diff) | |
download | gcc-f20200f4bc55067621823cd2f0ba9e87c18b4e17.zip gcc-f20200f4bc55067621823cd2f0ba9e87c18b4e17.tar.gz gcc-f20200f4bc55067621823cd2f0ba9e87c18b4e17.tar.bz2 |
(logic_operand): New function.
(i960_print_operand): Handle code `C'.
From-SVN: r10726
Diffstat (limited to 'gcc/config/i960')
-rw-r--r-- | gcc/config/i960/i960.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c index fde2e43..cdd5913 100644 --- a/gcc/config/i960/i960.c +++ b/gcc/config/i960/i960.c @@ -215,6 +215,19 @@ arith_operand (op, mode) return (register_operand (op, mode) || literal (op, mode)); } +/* Return truth value of whether OP can be used as an operands in a three + address logic insn, possibly complementing OP, of mode MODE. */ + +int +logic_operand (op, mode) + rtx op; + enum machine_mode mode; +{ + return (register_operand (op, mode) + || (GET_CODE (op) == CONST_INT + && INTVAL(op) >= -32 && INTVAL(op) < 32)); +} + /* Return true if OP is a register or a valid floating point literal. */ int @@ -1638,10 +1651,13 @@ i960_print_operand (file, x, code) } else if (rtxcode == CONST_INT) { - if (INTVAL (x) > 9999 || INTVAL (x) < -999) - fprintf (file, "0x%x", INTVAL (x)); + HOST_WIDE_INT val = INTVAL (x); + if (code == 'C') + val = ~val; + if (val > 9999 || val < -999) + fprintf (file, "0x%x", val); else - fprintf (file, "%d", INTVAL (x)); + fprintf (file, "%d", val); return; } else if (rtxcode == CONST_DOUBLE) |