aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/h8300/h8300.h
diff options
context:
space:
mode:
authorKaushik Phatak <kaushik.phatak@kpitcummins.com>2010-04-16 22:56:21 +0000
committerJeff Law <law@gcc.gnu.org>2010-04-16 16:56:21 -0600
commit0f6b820c5d3f39cf1ae01dfd6e523990e199d7e5 (patch)
tree99c86050bd12a7945e9513c74c9b4ab1ddcc83e6 /gcc/config/h8300/h8300.h
parentfcd3c5a9bead3b260a5d4c0c1f69293caab8d50e (diff)
downloadgcc-0f6b820c5d3f39cf1ae01dfd6e523990e199d7e5.zip
gcc-0f6b820c5d3f39cf1ae01dfd6e523990e199d7e5.tar.gz
gcc-0f6b820c5d3f39cf1ae01dfd6e523990e199d7e5.tar.bz2
h8300.c (print_operand): Modify case 'V' and case 'W' print operands for HI mode.
* config/h8300/h8300.c (print_operand) : Modify case 'V' and case 'W' print operands for HI mode. * config/h8300/h8300.h (Y0, Y2) : New constraints. * config/h8300/h8300.md (bclrqi_msx, bclrhi_msx): New patterns (bsetqi_msx, bsethi_msx, bnotqi_msx, bnothi_msx): Likewise. * config/h8300/predicate.md (bit_register_indirect_operand): New. From-SVN: r158452
Diffstat (limited to 'gcc/config/h8300/h8300.h')
-rw-r--r--gcc/config/h8300/h8300.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index d3f714c..f77dfa3 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -819,15 +819,25 @@ struct cum_arg
((STR)[1] == 'U' ? 2 \
: 0)
-/* We don't have any constraint starting with Y yet, but before
- someone uses it for a one-letter constraint and we're left without
- any upper-case constraints left, we reserve it for extensions
- here. */
-#define OK_FOR_Y(OP, STR) \
- (0)
+/* Multi-letter constraints starting with Y are to be used for operands
+ that are constant immediates and have single 1 or 0 in their binary
+ representation. */
+
+#define OK_FOR_Y2(OP) \
+ ((GET_CODE (OP) == CONST_INT) && (exact_log2 (INTVAL (OP) & 0xff) != -1))
+
+#define OK_FOR_Y0(OP) \
+ ((GET_CODE (OP) == CONST_INT) && (exact_log2 (~INTVAL (OP) & 0xff) != -1))
+
+#define OK_FOR_Y(OP, STR) \
+ ((STR)[1] == '2' ? OK_FOR_Y2 (OP) \
+ : (STR)[1] == '0' ? OK_FOR_Y0 (OP) \
+ : 0)
#define CONSTRAINT_LEN_FOR_Y(STR) \
- (0)
+ ((STR)[1] == '2' ? 2 \
+ : (STR)[1] == '0' ? 2 \
+ : 0)
#define OK_FOR_Z(OP) \
(TARGET_H8300SX \