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]

Re: [PATCH, i386]: Remaining FP moves cleanups


On Tue, Jun 7, 2011 at 7:02 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Tue, Jun 7, 2011 at 3:42 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>
>>> 2011-06-05 ?Uros Bizjak ?<ubizjak@gmail.com>
>>>
>>> ? ? ? ?* config/i386/i386.md (*movdf_internal_rex64) <case 8,9,10>:
>>> ? ? ? ?Remove MODE_TI handling. ?Remove SSE1 handling in attribute "mode"
>>> ? ? ? ?calculation.
>>> ? ? ? ?(*movdf_internal_rex64) <case 6,7,8>: Remove MODE_TI handling.
>>> ? ? ? ?Simplify MODE_V1DF and MODE_V2SF handling.
>>> ? ? ? ?(*movsf_internal): Remove x constraint from operand 1 alternative 7.
>>> ? ? ? ?Simplify MODE_SF handling.
>>>
>>> Patch was bootstrapped and regression tested on x86_64-pc-linux-gnuj
>>> {,-m32} AVX target. Committed to mainline SVN.
>>>
>>
>> Hi Uros,
>>
>> The new *movsf_internal patter has
>>
>> ?[(set (match_operand:SF 0 "nonimmediate_operand"
>> ? ? ? ? ?"=f,m,f,?r ,?m,x,x,x,m,!*y,!m,!*y,?Yi,?r,!*Ym,!r")
>> ? ? ? ?(match_operand:SF 1 "general_operand"
>> ? ? ? ? ?"fm,f,G,rmF,Fr,C,x,m,x,m ?,*y,*y ,r ?,Yi,r ? ,*Ym"))]
>> ...
>> ? ?case 7:
>> ? ?case 8:
>> ? ? ?if (TARGET_AVX && REG_P (operands[0]) && REG_P (operands[1]))
>> ? ? ? ?return "vmovss\t{%1, %0, %0|%0, %0, %1}";
>> ? ? ?return "%vmovss\t{%1, %0|%0, %1}";
>>
>> Since 7 is store and 8 is load,
>>
>> if (TARGET_AVX && REG_P (operands[0]) && REG_P (operands[1]))
>>
>> will always be false. ?Should we remove it?
>
> No, because it also handles fallthru from case 6.
>
> OTOH, you are right, this statement can be moved to case 6, without
> the check for registers.
>

Like this?  OK for trunk with a ChangeLog entry?

Thanks.

-- 
H.J.
----
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 58de87b..a61bffb 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -3207,11 +3207,11 @@
     case 6:
       if (get_attr_mode (insn) == MODE_V4SF)
 	return "%vmovaps\t{%1, %0|%0, %1}";
+      else if (TARGET_AVX && REG_P (operands[0]) && REG_P (operands[1]))
+	return "vmovss\t{%1, %0, %0|%0, %0, %1}";

     case 7:
     case 8:
-      if (TARGET_AVX && REG_P (operands[0]) && REG_P (operands[1]))
-	return "vmovss\t{%1, %0, %0|%0, %0, %1}";
       return "%vmovss\t{%1, %0|%0, %1}";

     case 9:


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