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]

[H8300 PATCH] Fix generation of aa:16 instruction in Normal mode


Hi,

In Normal mode of H8/300H and H8S, address is 16 bit and so all address range 
fits in aa:16 mode. 
Currently 16 bit constant address above 0x8000 is sign extended to 32 bit and
aa:32 bit instruction is generated.

The patch below fixes this.

Changelog

2003-04-23 Dhananjay Deshpande <dhananjayd@kpitcummins.com> 
		* config/h8300/h8300.c (h8300_tiny_constant_address_p): Return true if TARGET_NORMAL_MODE

=================================================================================
--- h8300.c.orig	Mon Apr 21 15:01:38 2003
+++ h8300.c	Mon Apr 21 15:01:49 2003
@@ -4238,8 +4238,9 @@ h8300_tiny_constant_address_p (x)
   addr = INTVAL (x);
 
   return (0
-	  || ((TARGET_H8300H && !TARGET_NORMAL_MODE)
+	  || TARGET_NORMAL_MODE
+	  || ((TARGET_H8300H)
 	      && (IN_RANGE (addr, h1, h2) || IN_RANGE (addr, h3, h4)))
-	  || ((TARGET_H8300S && !TARGET_NORMAL_MODE)
+	  || ((TARGET_H8300S)
 	      && (IN_RANGE (addr, s1, s2) || IN_RANGE (addr, s3, s4))));
 }

=================================================================================


Regards,
Dhananjay


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