Re: GCC won`t emit my instriction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alex,

On Fri, Jun 07, 2019 at 07:42:26AM +0300, Alex Hill via gcc-help wrote:
> I wrote a pattern in machine description file *.md to avoid branches:
>     (define_insn "smin<GPR:mode>3"
>       [
>         (set 
>           (match_operand:GPR 0 "register_operand" "=r")
>             (if_then_else:GPR
>           (lt:GPR 
>             (match_operand:GPR 1 "register_operand" " r")
>             (match_operand:GPR 2 "register_operand" " r"))
>         (match_dup 1)
>         (match_dup 2)))
>       ]
>       ""
>       "min\t%0,%1,%2"
>       [(set_attr "type" "move")
>        (set_attr "mode" "<MODE>")]) 

You could just do

(define_insn "smin<mode>3"
  [(set (match_operand:GPR 0 "register_operand" "=r")
        (smin:GPR (match_operand:GPR 1 "register_operand" "r")
                  (match_operand:GPR 2 "register_operand" "r")))]
  ""
  "min\t%0,%1,%2"
  [(set_attr "type" "move")
   (set_attr "mode" "<MODE>")])

Does that work better?


Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux