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: [x86, PATCH] More effecient code for short unsigned conversion to float-point.


On 08/06/2013 04:33 AM, Yuri Rumyantsev wrote:
> -(define_expand "floatunssi<mode>2"
> +(define_expand "floatuns<SWI124:mode><X87MODEF:mode>2"
>    [(parallel
>       [(set (match_operand:X87MODEF 0 "register_operand")
>  	   (unsigned_float:X87MODEF
> -	     (match_operand:SI 1 "nonimmediate_operand")))
> +	     (match_operand:SWI124 1 "nonimmediate_operand")))
>        (clobber (match_dup 2))
>        (clobber (match_scratch:SI 3))])]
>    "!TARGET_64BIT
>     && ((TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
>  	&& TARGET_SSE)
> -       || (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH))"
> +       || (SSE_FLOAT_MODE_P (<X87MODEF:MODE>mode) && TARGET_SSE_MATH))"
>  {
> -  if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
> +  if (GET_MODE_SIZE (<SWI124:MODE>mode) < GET_MODE_SIZE (SImode))
> +    { 
> +      operands[1] = convert_to_mode (SImode, operands[1], 1);
> +      emit_insn (gen_floatsi<X87MODEF:mode>2 (operands[0], operands[1]));
> +      DONE;
> +    }
> +  

The idea is correct, but there's no need to share the same expand,
adding a runtime test against the mode.


r~


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