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]

[sh] tiny cstore cleanup


The pre-cond-optab implementation of SHmedia floating-point branches
always used a DImode temporary to convert the branch to integer,
despite the conditional stores for SHmedia can emit a SImode
result and the branches can use it.

This resulted in extra sign extensions that I kept in the cond-optab
branch to minimize code generation differences.  This however can
go away now.

Tested with my bunch of cond-optab testcases.  Ok?

2009-07-11  Paolo Bonzini  <bonzini@gnu.org>

	* config/sh/sh.md (cbranchfp4_media): Remove hack extending
	cstore result to DImode.

Index: gcc/config/sh/sh.md
===================================================================
--- gcc/config/sh/sh.md	(branch cond-optab2)
+++ gcc/config/sh/sh.md	(working copy)
@@ -6889,8 +6889,6 @@ label:
   "TARGET_SHMEDIA"
   "
 {
-  /* hack to generate same code.  */
-  rtx tmp_di = GET_CODE (operands[0]) == UNORDERED ? NULL : gen_reg_rtx (DImode);
   rtx tmp = gen_reg_rtx (SImode);
   rtx cmp;
   if (GET_CODE (operands[0]) == NE)
@@ -6900,13 +6898,12 @@ label:
 			  operands[1], operands[2]);
 
   emit_insn (gen_cstore4_media (tmp, cmp, operands[1], operands[2]));
-  if (tmp_di) emit_insn (gen_extendsidi2 (tmp_di, tmp)); else tmp_di = tmp;
 
   if (GET_CODE (cmp) == GET_CODE (operands[0]))
-    operands[0] = gen_rtx_NE (VOIDmode, tmp_di, const0_rtx);
+    operands[0] = gen_rtx_NE (VOIDmode, tmp, const0_rtx);
   else
-    operands[0] = gen_rtx_EQ (VOIDmode, tmp_di, const0_rtx);
-  operands[1] = tmp_di;
+    operands[0] = gen_rtx_EQ (VOIDmode, tmp, const0_rtx);
+  operands[1] = tmp;
   operands[2] = const0_rtx;
   operands[3] = gen_rtx_LABEL_REF (Pmode, operands[3]);
 }")


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