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 : Avoid the insertion of divu.l instruction in the delay slot for H8/SX targets


Hi,

According to the datasheet of H8/SX target, the instruction to be 
placed in the delay slot should be of 1 word size. Still the divu.l
instruction which occupy 4 bytes (2 words) goes into delay slot. 

Executable containing divu.l instruction in the delay slot can be 
debugged successfully in H8300-elf GDB. However this is unexpected
because the same executable hangs on the hardware board at the point
of divu.l instruction execution.

Following patch prohibits the insertion of the divu.l instruction
in the delay slot for Renesas H8/SX targets.

No new regressions found.

Changelog:

2007-07-09 Deepen Mantri <deepen.mantri@kpitcummins.com>

	* h8300.md: Added the "can_delay" attribute in define insn
	            of divu.l instruction. 

==================================================================
--- ./gcc/config/h8300/h8300.md.orig	2007-07-06 17:12:54.000000000
+0530
+++ ./gcc/config/h8300/h8300.md	2007-07-06 17:13:31.000000000 +0530
@@ -1636,7 +1636,8 @@
 	 (match_operand:SI 2 "reg_or_nibble_operand" "r IP4>X")))]
   "TARGET_H8300SX"
   "divu.l\\t%S2,%S0"
-  [(set_attr "length" "2")])
+  [(set_attr "length" "2")
+   (set_attr "can_delay" "no")])
   
 (define_insn "divsi3"
   [(set (match_operand:SI 0 "register_operand" "=r")

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

Regards,		
Deepen Mantri		

KPIT Cummins InfoSystems Ltd.		
Pune, India		

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	
Free download of GNU based tool-chains for Renesas' SH, H8, R8C, 
M16C and M32C Series. The following site also offers free technical
support to its users. Visit http://www.kpitgnutools.com for details.
Latest versions of KPIT GNU tools were released on June 1,2007	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	


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