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] Vectorize conversions directly


I agree with Richi that this isn't appropriate for gcc 4.6, but we 
do want this for gcc 4.7.

In my opinion, the vectorizer uses builtins for too many things;
conversions included.  We should provide direct gimple mechanisms
for this, such as extending these conversion codes to vectors.

That said, 

> +(define_insn "floatv2siv2sf2"
> +  [(set (match_operand:V2SF 0 "s_register_operand" "=w")
> +       (fix:V2SF (match_operand:V2SI 1 "s_register_operand" "w")))]

Wrong rtl code here; s/fix/float/.

I'm surprised that this actually works, given that fix_truncv4sfv4si2
should be matching this pattern and generating the wrong insn.  At a
minimum this suggests that your testing is incomplete.

> +(define_insn "floatunsv2siv2sf2"
> +  [(set (match_operand:V2SF 0 "s_register_operand" "=w")
> +       (unspec:V2SF [(match_operand:V2SI 1 "s_register_operand" "w")] 
> +                    UNSPEC_FLOATU))]

Why are you not using the unsigned_float rtl code?

> +(define_insn "fixuns_truncv2sfv2si2"
> +  [(set (match_operand:V2SI 0 "s_register_operand" "=w")
> +        (unspec:V2SI [(match_operand:V2SF 1 "s_register_operand" "w")]
> +                     UNSPEC_FIXU))]

Similarly, the unsigned_fix code.



r~


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