Commit 36013987 by Richard Henderson Committed by Richard Henderson

alpha.c (code_for_builtin): Replace special-case builtin codes with ctzdi2, clzdi2, popcountdi2.

        * config/alpha/alpha.c (code_for_builtin): Replace special-case
        builtin codes with ctzdi2, clzdi2, popcountdi2.
        (struct alpha_builtin_def): Add is_const.
        (zero_arg_builtins, one_arg_builtins, two_arg_builtins): Init it.
        (alpha_v8qi_u, alpha_v8qi_s, alpha_v4hi_u, alpha_v4hi_s): New.
        (alpha_init_builtins): Init them.  Set nothrow and const attributes
        on builtins.
        (alpha_fold_builtin_cmpbge, alpha_fold_builtin_zapnot,
        alpha_fold_builtin_extxx, alpha_fold_builtin_insxx,
        alpha_fold_builtin_mskxx, alpha_fold_builtin_umulh,
        alpha_fold_vector_minmax, alpha_fold_builtin_perr,
        alpha_fold_builtin_pklb, alpha_fold_builtin_pkwb,
        alpha_fold_builtin_unpkbl, alpha_fold_builtin_unpkbw,
        alpha_fold_builtin_cttz, alpha_fold_builtin_ctlz,
        alpha_fold_builtin_ctpop, alpha_fold_builtin): New.
        (TARGET_FOLD_BUILTIN): New.
        * config/alpha/alpha.md (UNSPEC_CTTZ): Remove.
        (UNSPEC_CTLZ, UNSPEC_CTPOP): Remove.
        (ffsdi2): Use ctz.
        (cttz, builtin_cttz, builtin_ctlz, builtin_ctpop): Remove.

From-SVN: r96098
parent fe8a06f2
2005-03-08 Richard Henderson <rth@redhat.com>
* config/alpha/alpha.c (code_for_builtin): Replace special-case
builtin codes with ctzdi2, clzdi2, popcountdi2.
(struct alpha_builtin_def): Add is_const.
(zero_arg_builtins, one_arg_builtins, two_arg_builtins): Init it.
(alpha_v8qi_u, alpha_v8qi_s, alpha_v4hi_u, alpha_v4hi_s): New.
(alpha_init_builtins): Init them. Set nothrow and const attributes
on builtins.
(alpha_fold_builtin_cmpbge, alpha_fold_builtin_zapnot,
alpha_fold_builtin_extxx, alpha_fold_builtin_insxx,
alpha_fold_builtin_mskxx, alpha_fold_builtin_umulh,
alpha_fold_vector_minmax, alpha_fold_builtin_perr,
alpha_fold_builtin_pklb, alpha_fold_builtin_pkwb,
alpha_fold_builtin_unpkbl, alpha_fold_builtin_unpkbw,
alpha_fold_builtin_cttz, alpha_fold_builtin_ctlz,
alpha_fold_builtin_ctpop, alpha_fold_builtin): New.
(TARGET_FOLD_BUILTIN): New.
* config/alpha/alpha.md (UNSPEC_CTTZ): Remove.
(UNSPEC_CTLZ, UNSPEC_CTPOP): Remove.
(ffsdi2): Use ctz.
(cttz, builtin_cttz, builtin_ctlz, builtin_ctpop): Remove.
2005-03-08 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/20122
......
......@@ -26,7 +26,6 @@
(define_constants
[(UNSPEC_ARG_HOME 0)
(UNSPEC_CTTZ 1)
(UNSPEC_INSXH 2)
(UNSPEC_MSKXH 3)
(UNSPEC_CVTQL 4)
......@@ -56,9 +55,7 @@
(UNSPEC_AMASK 24)
(UNSPEC_IMPLVER 25)
(UNSPEC_PERR 26)
(UNSPEC_CTLZ 27)
(UNSPEC_CTPOP 28)
(UNSPEC_COPYSIGN 29)
(UNSPEC_COPYSIGN 27)
])
;; UNSPEC_VOLATILE:
......@@ -1333,7 +1330,7 @@
(define_expand "ffsdi2"
[(set (match_dup 2)
(unspec:DI [(match_operand:DI 1 "register_operand" "")] UNSPEC_CTTZ))
(ctz:DI (match_operand:DI 1 "register_operand" "")))
(set (match_dup 3)
(plus:DI (match_dup 2) (const_int 1)))
(set (match_operand:DI 0 "register_operand" "")
......@@ -1345,15 +1342,6 @@
operands[3] = gen_reg_rtx (DImode);
})
(define_insn "*cttz"
[(set (match_operand:DI 0 "register_operand" "=r")
(unspec:DI [(match_operand:DI 1 "register_operand" "r")] UNSPEC_CTTZ))]
"TARGET_CIX"
"cttz %1,%0"
; EV6 calls all mvi and cttz/ctlz/popc class imisc, so just
; reuse the existing type name.
[(set_attr "type" "mvi")])
(define_insn "clzdi2"
[(set (match_operand:DI 0 "register_operand" "=r")
(clz:DI (match_operand:DI 1 "register_operand" "r")))]
......@@ -7716,29 +7704,6 @@
"TARGET_MAX"
"unpkbw %r1,%0"
[(set_attr "type" "mvi")])
(define_expand "builtin_cttz"
[(set (match_operand:DI 0 "register_operand" "")
(unspec:DI [(match_operand:DI 1 "register_operand" "")]
UNSPEC_CTTZ))]
"TARGET_CIX"
"")
(define_insn "builtin_ctlz"
[(set (match_operand:DI 0 "register_operand" "=r")
(unspec:DI [(match_operand:DI 1 "register_operand" "r")]
UNSPEC_CTLZ))]
"TARGET_CIX"
"ctlz %1,%0"
[(set_attr "type" "mvi")])
(define_insn "builtin_ctpop"
[(set (match_operand:DI 0 "register_operand" "=r")
(unspec:DI [(match_operand:DI 1 "register_operand" "r")]
UNSPEC_CTPOP))]
"TARGET_CIX"
"ctpop %1,%0"
[(set_attr "type" "mvi")])
;; The call patterns are at the end of the file because their
;; wildcard operand0 interferes with nice recognition.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment