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]

A few more CONST_INT sign extension patches for i386


Somehow, these hadn't triggered on i686 bootstrap, but other tests
revealed these to be necessary.  I'm checking this in as obviously
correct.

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* config/i386/i386.c (ix86_expand_int_movcc,
	ix86_expand_strlensi_unroll_1): Sign-extend CONST_INTs.

Index: gcc/config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.c,v
retrieving revision 1.252
diff -u -p -r1.252 i386.c
--- gcc/config/i386/i386.c 2001/04/11 12:10:22 1.252
+++ gcc/config/i386/i386.c 2001/04/20 09:35:50
@@ -6316,7 +6316,8 @@ ix86_expand_int_movcc (operands)
 	       *
 	       * Size 8 - 11.
 	       */
-	      emit_insn (gen_andsi3 (out, out, GEN_INT (cf - ct)));
+	      emit_insn (gen_andsi3 (out, out, GEN_INT (trunc_int_for_mode
+							(cf - ct, SImode))));
 	      if (ct)
 	        emit_insn (gen_addsi3 (out, out, GEN_INT (ct)));
 	    }
@@ -6473,7 +6474,8 @@ ix86_expand_int_movcc (operands)
 				 ix86_compare_op1, VOIDmode, 0, 1);
 
 	  emit_insn (gen_addsi3 (out, out, constm1_rtx));
-	  emit_insn (gen_andsi3 (out, out, GEN_INT (cf-ct)));
+	  emit_insn (gen_andsi3 (out, out, GEN_INT (trunc_int_for_mode
+						    (cf - ct, SImode))));
 	  if (ct != 0)
 	    emit_insn (gen_addsi3 (out, out, GEN_INT (ct)));
 	  if (out != operands[0])
@@ -7886,7 +7888,9 @@ ix86_expand_strlensi_unroll_1 (out, alig
   emit_insn (gen_addsi3 (tmpreg, scratch, GEN_INT (-0x01010101)));
   emit_insn (gen_one_cmplsi2 (scratch, scratch));
   emit_insn (gen_andsi3 (tmpreg, tmpreg, scratch));
-  emit_insn (gen_andsi3 (tmpreg, tmpreg, GEN_INT (0x80808080)));
+  emit_insn (gen_andsi3 (tmpreg, tmpreg,
+			 GEN_INT (trunc_int_for_mode
+				  (0x80808080, SImode))));
   emit_cmp_and_jump_insns (tmpreg, const0_rtx, EQ, 0,
 			   SImode, 1, 0, align_4_label);
 

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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