Commit d413e3cc by Jakub Jelinek Committed by Jakub Jelinek

i386.md (ffsdi2, clzdi2): New expanders.

	* config/i386/i386.md (ffsdi2, clzdi2): New expanders.
	(ffs_rex64): New splitter.
	(ffsdi_1, ctzdi2, bsr_rex64): New instructions.

From-SVN: r83604
parent d42093a1
2004-06-24 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.md (ffsdi2, clzdi2): New expanders.
(ffs_rex64): New splitter.
(ffsdi_1, ctzdi2, bsr_rex64): New instructions.
2004-06-24 Andrew Pinski <apinski@apple.com>
* config/darwin7.h (MATH_LIBRARY): Remove.
......
......@@ -14005,6 +14005,44 @@
"bsf{l}\t{%1, %0|%0, %1}"
[(set_attr "prefix_0f" "1")])
(define_expand "ffsdi2"
[(parallel
[(set (match_operand:DI 0 "register_operand" "")
(ffs:DI (match_operand:DI 1 "nonimmediate_operand" "")))
(clobber (match_scratch:DI 2 ""))
(clobber (reg:CC 17))])]
"TARGET_64BIT && TARGET_CMOVE"
"")
(define_insn_and_split "*ffs_rex64"
[(set (match_operand:DI 0 "register_operand" "=r")
(ffs:DI (match_operand:DI 1 "nonimmediate_operand" "rm")))
(clobber (match_scratch:DI 2 "=&r"))
(clobber (reg:CC 17))]
"TARGET_64BIT && TARGET_CMOVE"
"#"
"&& reload_completed"
[(set (match_dup 2) (const_int -1))
(parallel [(set (reg:CCZ 17) (compare:CCZ (match_dup 1) (const_int 0)))
(set (match_dup 0) (ctz:DI (match_dup 1)))])
(set (match_dup 0) (if_then_else:DI
(eq (reg:CCZ 17) (const_int 0))
(match_dup 2)
(match_dup 0)))
(parallel [(set (match_dup 0) (plus:DI (match_dup 0) (const_int 1)))
(clobber (reg:CC 17))])]
"")
(define_insn "*ffsdi_1"
[(set (reg:CCZ 17)
(compare:CCZ (match_operand:DI 1 "nonimmediate_operand" "rm")
(const_int 0)))
(set (match_operand:DI 0 "register_operand" "=r")
(ctz:DI (match_dup 1)))]
"TARGET_64BIT"
"bsf{q}\t{%1, %0|%0, %1}"
[(set_attr "prefix_0f" "1")])
(define_insn "ctzsi2"
[(set (match_operand:SI 0 "register_operand" "=r")
(ctz:SI (match_operand:SI 1 "nonimmediate_operand" "rm")))
......@@ -14013,6 +14051,14 @@
"bsf{l}\t{%1, %0|%0, %1}"
[(set_attr "prefix_0f" "1")])
(define_insn "ctzdi2"
[(set (match_operand:DI 0 "register_operand" "=r")
(ctz:DI (match_operand:DI 1 "nonimmediate_operand" "rm")))
(clobber (reg:CC 17))]
"TARGET_64BIT"
"bsf{q}\t{%1, %0|%0, %1}"
[(set_attr "prefix_0f" "1")])
(define_expand "clzsi2"
[(parallel
[(set (match_operand:SI 0 "register_operand" "")
......@@ -14033,6 +14079,27 @@
""
"bsr{l}\t{%1, %0|%0, %1}"
[(set_attr "prefix_0f" "1")])
(define_expand "clzdi2"
[(parallel
[(set (match_operand:DI 0 "register_operand" "")
(minus:DI (const_int 63)
(clz:DI (match_operand:DI 1 "nonimmediate_operand" ""))))
(clobber (reg:CC 17))])
(parallel
[(set (match_dup 0) (xor:DI (match_dup 0) (const_int 63)))
(clobber (reg:CC 17))])]
"TARGET_64BIT"
"")
(define_insn "*bsr_rex64"
[(set (match_operand:DI 0 "register_operand" "=r")
(minus:DI (const_int 63)
(clz:DI (match_operand:DI 1 "nonimmediate_operand" "rm"))))
(clobber (reg:CC 17))]
"TARGET_64BIT"
"bsr{q}\t{%1, %0|%0, %1}"
[(set_attr "prefix_0f" "1")])
;; Thread-local storage patterns for ELF.
;;
......
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