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]: Unify TARGET_SSE_MATH for float* patterns


Richard Henderson wrote:

On Mon, Dec 13, 2004 at 10:13:52AM +0100, Uros Bizjak wrote:


+(define_insn "*floathisf2_i387"
[(set (match_operand:SF 0 "register_operand" "=f,f")
- (float:SF (match_operand:HI 1 "nonimmediate_operand" "m,r")))]
- "TARGET_80387 && (!TARGET_SSE || !TARGET_SSE_MATH)"
+ (float:SF (match_operand:HI 1 "nonimmediate_operand" "m,?r")))]
+ "TARGET_80387"



It's wrong to enable this pattern with TARGET_SSE_MATH. There's no floathisf2_{mixed,sse} patterns to shadow it.



Before this pattern, we have:

(define_expand "floathisf2"
 [(set (match_operand:SF 0 "register_operand" "")
   (float:SF (match_operand:HI 1 "nonimmediate_operand" "")))]
 "TARGET_80387 || TARGET_SSE_MATH"
{
 if (TARGET_SSE_MATH)
   {
     emit_insn (gen_floatsisf2 (operands[0],
                convert_to_mode (SImode, operands[1], 0)));
     DONE;
   }
})

In TARGET_SSE_MATH case, floatsisf2 pattern is generated. Anyway, I have changed the constraint for *floathisf2_i387 to "TARGET_80387 && !TARGET_SSE_MATH"

+(define_insn "*floathidf2_i387"
[(set (match_operand:DF 0 "register_operand" "=f,f")
- (float:DF (match_operand:HI 1 "nonimmediate_operand" "m,r")))]
- "TARGET_80387 && (!TARGET_SSE2 || !TARGET_SSE_MATH)"
+ (float:DF (match_operand:HI 1 "nonimmediate_operand" "m,?r")))]
+ "TARGET_80387"



Similarly, except obviously we can enable it if !SSE2, since all DFmode arithmetic will be going through the 387 stack in that case.



For floathidf2 we have similar expander:

(define_expand "floathidf2"
 [(set (match_operand:DF 0 "register_operand" "")
   (float:DF (match_operand:HI 1 "nonimmediate_operand" "")))]
 "TARGET_80387 || (TARGET_SSE2 && TARGET_SSE_MATH)"
{
 if (TARGET_SSE2 && TARGET_SSE_MATH)
   {
     emit_insn (gen_floatsidf2 (operands[0],
                convert_to_mode (SImode, operands[1], 0)));
     DONE;
   }
})

But also in this case, constraint for *floathidf2_i387 is changed to:
 "TARGET_80387 && !(TARGET_SSE2 && TARGET_SSE_MATH)"

Uros,


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