This is the mail archive of the gcc-patches@gcc.gnu.org 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


Hi,

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.

Regards,
Kaushik Phatak
www.kpitgnutools.com 

=======================Start of Patch================================
Changelog:

2010-04-12  Kaushik Phatak <kaushik.phatak@kpitcummins.com>

	* config/h8300/predicate.md (bit_operand): Allow immediate values that 
	satisfy 'U' constraint.
	
diff -upr trunk.orig/gcc/config/h8300/predicates.md trunk/gcc/config/h8300/predicates.md
--- trunk.orig/gcc/config/h8300/predicates.md	2010-03-10 10:38:41.000000000 +0530
+++ trunk/gcc/config/h8300/predicates.md	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]