diff mbox

[rl78] Use canonical const_int for one_cmplqi2

Message ID 87li10ilwu.fsf@talisman.default
State New
Headers show

Commit Message

Richard Sandiford Nov. 7, 2013, 9:46 a.m. UTC
This patch just changes a QImode (const_int 255) to (const_int -1),
since the canonical form is to sign-extend.  As things stand the pattern
trips a new assert added on the wide-int branch.

Tested by building rl78-elf before and after the patch and making sure
that there were no changes in assembly code for gcc.c-torture, gcc.dg
and g++dg.  OK to install?

Thanks,
Richard


gcc/
	* config/rl78/rl78-expand.md (one_cmplqi2): Use (const_int -1)
	rather than (const_int 255).

Comments

DJ Delorie Nov. 8, 2013, 7:38 p.m. UTC | #1
> This patch just changes a QImode (const_int 255) to (const_int -1),
> since the canonical form is to sign-extend.  As things stand the pattern
> trips a new assert added on the wide-int branch.

Ok.  Thanks!
diff mbox

Patch

Index: gcc/config/rl78/rl78-expand.md
===================================================================
--- gcc/config/rl78/rl78-expand.md	2013-10-15 19:24:15.821884272 +0100
+++ gcc/config/rl78/rl78-expand.md	2013-11-07 09:41:50.754226143 +0000
@@ -177,7 +177,7 @@  (define_expand "xorqi3"
 (define_expand "one_cmplqi2"
   [(set (match_operand:QI         0 "nonimmediate_operand")
 	(xor:QI (match_operand:QI 1 "general_operand")
-		(const_int 255)))
+		(const_int -1)))
    ]
   ""
   "if (rl78_force_nonfar_2 (operands, gen_one_cmplqi2))