|
|
Hi,
The instructions "XOR" and "BNOT" are not getting generated for H8SX
when optimization options are enabled. Instead it gives ICE.
Please find attached the patch that fixes the ICE and hence generates
"XOR" and "BNOT" instructions.
Below is a simple testcase that generates ICE for H8SX targets.
=====================================================================
const unsigned char baCryptX[]="A";
void TEST(unsigned char *ptrbVal)
{
ptrbVal[0]^=baCryptX[0];
}
int main()
{
return 0;
}
COMMAND LINE :- h8300-elf-gcc -msx -O1
=====================================================================
No new regressions found. Tested on GCC-4.2 snapshot.
=======================Start of Patch================================
ChangeLog
2006-05-23 Naveen.H.S <naveenh@xxxxxxxxxxxxxxx>
* gcc/config/h8300/h8300.md: A new insn xorqi3_2 is added.
xorqi3_1 - Remove the condition for H8SX target.
--- /gcc/config/h8300/h8300.md.orig 2006-05-23 11:09:29.000000000
+0530
+++ /gcc/config/h8300/h8300.md 2006-05-23 11:22:24.000000000 +0530
@@ -1876,18 +1876,28 @@
;;
----------------------------------------------------------------------
;; XOR INSTRUCTIONS
;;
----------------------------------------------------------------------
+(define_insn "*xorqi3_2"
+ [(set (match_operand:QI 0 "bit_operand" "=rQ,r")
+ (xor:QI (match_operand:QI 1 "bit_operand" "%0,WU")
+ (match_operand:QI 2 "h8300_src_operand" "rQi,IP1>X")))]
+ "TARGET_H8300SX"
+ "@
+ xor\\t %X2,%X0
+ bnot\\t %V2,%R0"
+ [(set_attr "length" "*,8")
+ (set_attr "length_table" "logicb,*")
+ (set_attr "cc" "set_znv,none_0hit")])
(define_insn "xorqi3_1"
[(set (match_operand:QI 0 "bit_operand" "=r,U")
(xor:QI (match_operand:QI 1 "bit_operand" "%0,0")
(match_operand:QI 2 "h8300_src_operand" "rQi,n")))]
- "TARGET_H8300SX || register_operand (operands[0], QImode)
+ "register_operand (operands[0], QImode)
|| single_one_operand (operands[2], QImode)"
"@
xor\\t%X2,%X0
bnot\\t%V2,%R0"
- [(set_attr "length" "*,8")
- (set_attr "length_table" "logicb,*")
+ [(set_attr "length" "2,8")
(set_attr "cc" "set_znv,none_0hit")])
(define_expand "xorqi3"
=======================End Of Patch================================
Regards,
Naveen.H.S.
KPIT Cummins Infosystems Ltd,
Pune ( INDIA )
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH, H8 and M16C
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 April 1, 2006.
|
|