This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch:H8/300] Absolute address mode support for bit_operand predicate


The bit instruction code generated for H8 targets does not use the 
absolute address mode causing non-optimized code. Since the constraint
'U' is valid for bset destination which includes an 8-bit memory 
region, this patch adds this condition to the 'bit_operand' predicate
before rejecting this option.

Current code generated for bset instruction,
mov.b   @er2,r3l
bset    #7,r3l
mov.b   r3l,@er2
This change would generate the code in the following manner,
bset    #7,@-14:8
This would address the data in the region 0xFF00 to 0xFFFF for 
the -mn -mh targets.
Regression done for h8300-elf-* and no new regressions found.
Please Comment.

Kaushik Phatak 

=======================Start of Patch================================

2010-04-12  Kaushik Phatak <>

	* config/h8300/ (bit_operand): Allow immediate values that 
	satisfy 'U' constraint.
diff -upr trunk.orig/gcc/config/h8300/ trunk/gcc/config/h8300/
--- trunk.orig/gcc/config/h8300/	2010-03-10 10:38:41.000000000 +0530
+++ trunk/gcc/config/h8300/	2010-04-09 17:53:37.000000000 +0530
@@ -326,7 +326,7 @@
   /* We can accept any nonimmediate operand, except that MEM operands must
      be limited to those that use addresses valid for the 'U' constraint.  */
-  if (!nonimmediate_operand (op, mode))
+  if (!nonimmediate_operand (op, mode) && !OK_FOR_U (op))
     return 0;
   /* H8SX accepts pretty much anything here.  */
=========================End Of Patch================================

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]