From: Richard Henderson <r...@redhat.com>
Date: Fri, 30 Sep 2011 14:03:52 -0700

>   (3) Use optimize-mode-switching to minimize the number of changes
>       to the global state.  This includes the use of SIAM vs %fsr,
>       especially when a subroutine call could have changed the
>       global rounding mode.

Indeed, and I incidentally took a look at the mode switching
optimization framework and it appears that I could use it for
providing insn patterns for 'rint' and friends like i386 does.

> All of which is a lot of work.
> 
>> +(define_insn "bmask<P:mode>_vis"
>> +  [(set (match_operand:P 0 "register_operand" "=r")
>> +        (plus:P (match_operand:P 1 "register_operand" "rJ")
>> +                (match_operand:P 2 "register_operand" "rJ")))
>> +   (clobber (reg:SI GSR_REG))]
>> +  "TARGET_VIS2"
>> +  "bmask\t%r1, %r2, %0"
>> +  [(set_attr "type" "array")])
> 
> I think this is wrong.  I think you want to model this as
 ...
>> +(define_insn "bshuffle<V64I:mode>_vis"
>> +  [(set (match_operand:V64I 0 "register_operand" "=e")
>> +        (unspec:V64I [(match_operand:V64I 1 "register_operand" "e")
>> +                  (match_operand:V64I 2 "register_operand" "e")]
>> +                     UNSPEC_BSHUFFLE))
>> +   (use (reg:SI GSR_REG))]
> 
> Better to push the use of the GSR_REG into the unspec, and not leave
> it separate in the parallel.

Thanks Richard, I'll fix these up.  In general, the GSR tracking needs
a bit more work.

Reply via email to