"&& 1"
[(parallel
[(set (match_dup 6)
- (ior:DWIH (ashift:DWIH (match_dup 6) (match_dup 2))
- (lshiftrt:DWIH (match_dup 5)
- (minus:QI (match_dup 8) (match_dup 2)))))
+ (ior:DWIH (ashift:DWIH (match_dup 6)
+ (and:QI (match_dup 2) (match_dup 8)))
+ (subreg:DWIH
+ (lshiftrt:<DWI> (zero_extend:<DWI> (match_dup 5))
+ (minus:QI (match_dup 9)
+ (and:QI (match_dup 2) (match_dup 8)))) 0)))
(clobber (reg:CC FLAGS_REG))])
(parallel
[(set (match_dup 4)
{
split_double_mode (<DWI>mode, &operands[0], 2, &operands[4], &operands[6]);
- operands[8] = GEN_INT (<MODE_SIZE> * BITS_PER_UNIT);
+ operands[8] = GEN_INT (<MODE_SIZE> * BITS_PER_UNIT - 1);
+ operands[9] = GEN_INT (<MODE_SIZE> * BITS_PER_UNIT);
if ((INTVAL (operands[3]) & ((<MODE_SIZE> * BITS_PER_UNIT) - 1))
!= ((<MODE_SIZE> * BITS_PER_UNIT) - 1))
"&& 1"
[(parallel
[(set (match_dup 6)
- (ior:DWIH (ashift:DWIH (match_dup 6) (match_dup 2))
- (lshiftrt:DWIH (match_dup 5)
- (minus:QI (match_dup 8) (match_dup 2)))))
+ (ior:DWIH (ashift:DWIH (match_dup 6)
+ (and:QI (match_dup 2) (match_dup 8)))
+ (subreg:DWIH
+ (lshiftrt:<DWI> (zero_extend:<DWI> (match_dup 5))
+ (minus:QI (match_dup 9)
+ (and:QI (match_dup 2) (match_dup 8)))) 0)))
(clobber (reg:CC FLAGS_REG))])
(parallel
[(set (match_dup 4)
{
split_double_mode (<DWI>mode, &operands[0], 2, &operands[4], &operands[6]);
- operands[8] = GEN_INT (<MODE_SIZE> * BITS_PER_UNIT);
+ operands[8] = GEN_INT (<MODE_SIZE> * BITS_PER_UNIT - 1);
+ operands[9] = GEN_INT (<MODE_SIZE> * BITS_PER_UNIT);
if ((INTVAL (operands[3]) & ((<MODE_SIZE> * BITS_PER_UNIT) - 1))
!= ((<MODE_SIZE> * BITS_PER_UNIT) - 1))
(define_insn "x86_64_shld"
[(set (match_operand:DI 0 "nonimmediate_operand" "+r*m")
(ior:DI (ashift:DI (match_dup 0)
- (match_operand:QI 2 "nonmemory_operand" "Jc"))
- (lshiftrt:DI (match_operand:DI 1 "register_operand" "r")
- (minus:QI (const_int 64) (match_dup 2)))))
+ (and:QI (match_operand:QI 2 "nonmemory_operand" "Jc")
+ (const_int 63)))
+ (subreg:DI
+ (lshiftrt:TI
+ (zero_extend:TI
+ (match_operand:DI 1 "register_operand" "r"))
+ (minus:QI (const_int 64)
+ (and:QI (match_dup 2) (const_int 63)))) 0)))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT"
"shld{q}\t{%s2%1, %0|%0, %1, %2}"
(set_attr "amdfam10_decode" "vector")
(set_attr "bdver1_decode" "vector")])
+(define_insn "*x86_64_shld_1"
+ [(set (match_operand:DI 0 "nonimmediate_operand" "+r*m")
+ (ior:DI (ashift:DI (match_dup 0)
+ (match_operand:QI 2 "const_0_to_63_operand" "J"))
+ (subreg:DI
+ (lshiftrt:TI
+ (zero_extend:TI
+ (match_operand:DI 1 "register_operand" "r"))
+ (match_operand:QI 3 "const_0_to_255_operand" "N")) 0)))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_64BIT
+ && INTVAL (operands[3]) == 64 - INTVAL (operands[2])"
+ "shld{q}\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "prefix_0f" "1")
+ (set_attr "mode" "DI")
+ (set_attr "athlon_decode" "vector")
+ (set_attr "amdfam10_decode" "vector")
+ (set_attr "bdver1_decode" "vector")])
+
+(define_insn_and_split "*x86_64_shld_2"
+ [(set (match_operand:DI 0 "nonimmediate_operand")
+ (ior:DI (ashift:DI (match_dup 0)
+ (match_operand:QI 2 "nonmemory_operand"))
+ (lshiftrt:DI (match_operand:DI 1 "register_operand")
+ (minus:QI (const_int 64) (match_dup 2)))))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_64BIT && ix86_pre_reload_split ()"
+ "#"
+ "&& 1"
+ [(parallel [(set (match_dup 0)
+ (ior:DI (ashift:DI (match_dup 0)
+ (and:QI (match_dup 2) (const_int 63)))
+ (subreg:DI
+ (lshiftrt:TI
+ (zero_extend:TI (match_dup 1))
+ (minus:QI (const_int 64)
+ (and:QI (match_dup 2)
+ (const_int 63)))) 0)))
+ (clobber (reg:CC FLAGS_REG))])])
+
(define_insn "x86_shld"
[(set (match_operand:SI 0 "nonimmediate_operand" "+r*m")
(ior:SI (ashift:SI (match_dup 0)
- (match_operand:QI 2 "nonmemory_operand" "Ic"))
- (lshiftrt:SI (match_operand:SI 1 "register_operand" "r")
- (minus:QI (const_int 32) (match_dup 2)))))
+ (and:QI (match_operand:QI 2 "nonmemory_operand" "Ic")
+ (const_int 31)))
+ (subreg:SI
+ (lshiftrt:DI
+ (zero_extend:DI
+ (match_operand:SI 1 "register_operand" "r"))
+ (minus:QI (const_int 32)
+ (and:QI (match_dup 2) (const_int 31)))) 0)))
(clobber (reg:CC FLAGS_REG))]
""
"shld{l}\t{%s2%1, %0|%0, %1, %2}"
(set_attr "amdfam10_decode" "vector")
(set_attr "bdver1_decode" "vector")])
+(define_insn "*x86_shld_1"
+ [(set (match_operand:SI 0 "nonimmediate_operand" "+r*m")
+ (ior:SI (ashift:SI (match_dup 0)
+ (match_operand:QI 2 "const_0_to_31_operand" "I"))
+ (subreg:SI
+ (lshiftrt:DI
+ (zero_extend:DI
+ (match_operand:SI 1 "register_operand" "r"))
+ (match_operand:QI 3 "const_0_to_63_operand" "J")) 0)))
+ (clobber (reg:CC FLAGS_REG))]
+ "INTVAL (operands[3]) == 32 - INTVAL (operands[2])"
+ "shld{l}\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "prefix_0f" "1")
+ (set_attr "mode" "SI")
+ (set_attr "pent_pair" "np")
+ (set_attr "athlon_decode" "vector")
+ (set_attr "amdfam10_decode" "vector")
+ (set_attr "bdver1_decode" "vector")])
+
+(define_insn_and_split "*x86_shld_2"
+ [(set (match_operand:SI 0 "nonimmediate_operand")
+ (ior:SI (ashift:SI (match_dup 0)
+ (match_operand:QI 2 "nonmemory_operand"))
+ (lshiftrt:SI (match_operand:SI 1 "register_operand")
+ (minus:QI (const_int 32) (match_dup 2)))))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_64BIT && ix86_pre_reload_split ()"
+ "#"
+ "&& 1"
+ [(parallel [(set (match_dup 0)
+ (ior:SI (ashift:SI (match_dup 0)
+ (and:QI (match_dup 2) (const_int 31)))
+ (subreg:SI
+ (lshiftrt:DI
+ (zero_extend:DI (match_dup 1))
+ (minus:QI (const_int 32)
+ (and:QI (match_dup 2)
+ (const_int 31)))) 0)))
+ (clobber (reg:CC FLAGS_REG))])])
+
(define_expand "@x86_shift<mode>_adj_1"
[(set (reg:CCZ FLAGS_REG)
(compare:CCZ (and:QI (match_operand:QI 2 "register_operand")
"&& 1"
[(parallel
[(set (match_dup 4)
- (ior:DWIH (lshiftrt:DWIH (match_dup 4) (match_dup 2))
- (ashift:DWIH (match_dup 7)
- (minus:QI (match_dup 8) (match_dup 2)))))
+ (ior:DWIH (lshiftrt:DWIH (match_dup 4)
+ (and:QI (match_dup 2) (match_dup 8)))
+ (subreg:DWIH
+ (ashift:<DWI> (zero_extend:<DWI> (match_dup 7))
+ (minus:QI (match_dup 9)
+ (and:QI (match_dup 2) (match_dup 8)))) 0)))
(clobber (reg:CC FLAGS_REG))])
(parallel
[(set (match_dup 6)
{
split_double_mode (<DWI>mode, &operands[0], 2, &operands[4], &operands[6]);
- operands[8] = GEN_INT (<MODE_SIZE> * BITS_PER_UNIT);
+ operands[8] = GEN_INT (<MODE_SIZE> * BITS_PER_UNIT - 1);
+ operands[9] = GEN_INT (<MODE_SIZE> * BITS_PER_UNIT);
if ((INTVAL (operands[3]) & ((<MODE_SIZE> * BITS_PER_UNIT) - 1))
!= ((<MODE_SIZE> * BITS_PER_UNIT) - 1))
"&& 1"
[(parallel
[(set (match_dup 4)
- (ior:DWIH (lshiftrt:DWIH (match_dup 4) (match_dup 2))
- (ashift:DWIH (match_dup 7)
- (minus:QI (match_dup 8) (match_dup 2)))))
+ (ior:DWIH (lshiftrt:DWIH (match_dup 4)
+ (and:QI (match_dup 2) (match_dup 8)))
+ (subreg:DWIH
+ (ashift:<DWI> (zero_extend:<DWI> (match_dup 7))
+ (minus:QI (match_dup 9)
+ (and:QI (match_dup 2) (match_dup 8)))) 0)))
(clobber (reg:CC FLAGS_REG))])
(parallel
[(set (match_dup 6)
{
split_double_mode (<DWI>mode, &operands[0], 2, &operands[4], &operands[6]);
- operands[8] = GEN_INT (<MODE_SIZE> * BITS_PER_UNIT);
+ operands[8] = GEN_INT (<MODE_SIZE> * BITS_PER_UNIT - 1);
+ operands[9] = GEN_INT (<MODE_SIZE> * BITS_PER_UNIT);
if ((INTVAL (operands[3]) & ((<MODE_SIZE> * BITS_PER_UNIT) - 1))
!= ((<MODE_SIZE> * BITS_PER_UNIT) - 1))
(define_insn "x86_64_shrd"
[(set (match_operand:DI 0 "nonimmediate_operand" "+r*m")
(ior:DI (lshiftrt:DI (match_dup 0)
- (match_operand:QI 2 "nonmemory_operand" "Jc"))
- (ashift:DI (match_operand:DI 1 "register_operand" "r")
- (minus:QI (const_int 64) (match_dup 2)))))
+ (and:QI (match_operand:QI 2 "nonmemory_operand" "Jc")
+ (const_int 63)))
+ (subreg:DI
+ (ashift:TI
+ (zero_extend:TI
+ (match_operand:DI 1 "register_operand" "r"))
+ (minus:QI (const_int 64)
+ (and:QI (match_dup 2) (const_int 63)))) 0)))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT"
"shrd{q}\t{%s2%1, %0|%0, %1, %2}"
(set_attr "amdfam10_decode" "vector")
(set_attr "bdver1_decode" "vector")])
+(define_insn "*x86_64_shrd_1"
+ [(set (match_operand:DI 0 "nonimmediate_operand" "+r*m")
+ (ior:DI (lshiftrt:DI (match_dup 0)
+ (match_operand:QI 2 "const_0_to_63_operand" "J"))
+ (subreg:DI
+ (ashift:TI
+ (zero_extend:TI
+ (match_operand:DI 1 "register_operand" "r"))
+ (match_operand:QI 3 "const_0_to_255_operand" "N")) 0)))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_64BIT
+ && INTVAL (operands[3]) == 64 - INTVAL (operands[2])"
+ "shrd{q}\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "prefix_0f" "1")
+ (set_attr "mode" "DI")
+ (set_attr "athlon_decode" "vector")
+ (set_attr "amdfam10_decode" "vector")
+ (set_attr "bdver1_decode" "vector")])
+
+(define_insn_and_split "*x86_64_shrd_2"
+ [(set (match_operand:DI 0 "nonimmediate_operand")
+ (ior:DI (lshiftrt:DI (match_dup 0)
+ (match_operand:QI 2 "nonmemory_operand"))
+ (ashift:DI (match_operand:DI 1 "register_operand")
+ (minus:QI (const_int 64) (match_dup 2)))))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_64BIT && ix86_pre_reload_split ()"
+ "#"
+ "&& 1"
+ [(parallel [(set (match_dup 0)
+ (ior:DI (lshiftrt:DI (match_dup 0)
+ (and:QI (match_dup 2) (const_int 63)))
+ (subreg:DI
+ (ashift:TI
+ (zero_extend:TI (match_dup 1))
+ (minus:QI (const_int 64)
+ (and:QI (match_dup 2)
+ (const_int 63)))) 0)))
+ (clobber (reg:CC FLAGS_REG))])])
+
(define_insn "x86_shrd"
[(set (match_operand:SI 0 "nonimmediate_operand" "+r*m")
(ior:SI (lshiftrt:SI (match_dup 0)
- (match_operand:QI 2 "nonmemory_operand" "Ic"))
- (ashift:SI (match_operand:SI 1 "register_operand" "r")
- (minus:QI (const_int 32) (match_dup 2)))))
+ (and:QI (match_operand:QI 2 "nonmemory_operand" "Ic")
+ (const_int 31)))
+ (subreg:SI
+ (ashift:DI
+ (zero_extend:DI
+ (match_operand:SI 1 "register_operand" "r"))
+ (minus:QI (const_int 32)
+ (and:QI (match_dup 2) (const_int 31)))) 0)))
(clobber (reg:CC FLAGS_REG))]
""
"shrd{l}\t{%s2%1, %0|%0, %1, %2}"
(set_attr "amdfam10_decode" "vector")
(set_attr "bdver1_decode" "vector")])
+(define_insn "*x86_shrd_1"
+ [(set (match_operand:SI 0 "nonimmediate_operand" "+r*m")
+ (ior:SI (lshiftrt:SI (match_dup 0)
+ (match_operand:QI 2 "const_0_to_31_operand" "I"))
+ (subreg:SI
+ (ashift:DI
+ (zero_extend:DI
+ (match_operand:SI 1 "register_operand" "r"))
+ (match_operand:QI 3 "const_0_to_63_operand" "J")) 0)))
+ (clobber (reg:CC FLAGS_REG))]
+ "INTVAL (operands[3]) == 32 - INTVAL (operands[2])"
+ "shrd{l}\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "prefix_0f" "1")
+ (set_attr "mode" "SI")
+ (set_attr "pent_pair" "np")
+ (set_attr "athlon_decode" "vector")
+ (set_attr "amdfam10_decode" "vector")
+ (set_attr "bdver1_decode" "vector")])
+
+(define_insn_and_split "*x86_shrd_2"
+ [(set (match_operand:SI 0 "nonimmediate_operand")
+ (ior:SI (lshiftrt:SI (match_dup 0)
+ (match_operand:QI 2 "nonmemory_operand"))
+ (ashift:SI (match_operand:SI 1 "register_operand")
+ (minus:QI (const_int 32) (match_dup 2)))))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_64BIT && ix86_pre_reload_split ()"
+ "#"
+ "&& 1"
+ [(parallel [(set (match_dup 0)
+ (ior:SI (lshiftrt:SI (match_dup 0)
+ (and:QI (match_dup 2) (const_int 31)))
+ (subreg:SI
+ (ashift:DI
+ (zero_extend:DI (match_dup 1))
+ (minus:QI (const_int 32)
+ (and:QI (match_dup 2)
+ (const_int 31)))) 0)))
+ (clobber (reg:CC FLAGS_REG))])])
+
;; Base name for insn mnemonic.
(define_mode_attr cvt_mnemonic
[(SI "{cltd|cdq}") (DI "{cqto|cqo}")])
[(set (match_dup 3) (match_dup 4))
(parallel
[(set (match_dup 4)
- (ior:DWIH (ashift:DWIH (match_dup 4) (match_dup 2))
- (lshiftrt:DWIH (match_dup 5)
- (minus:QI (match_dup 6) (match_dup 2)))))
+ (ior:DWIH (ashift:DWIH (match_dup 4)
+ (and:QI (match_dup 2) (match_dup 6)))
+ (subreg:DWIH
+ (lshiftrt:<DWI> (zero_extend:<DWI> (match_dup 5))
+ (minus:QI (match_dup 7)
+ (and:QI (match_dup 2)
+ (match_dup 6)))) 0)))
(clobber (reg:CC FLAGS_REG))])
(parallel
[(set (match_dup 5)
- (ior:DWIH (ashift:DWIH (match_dup 5) (match_dup 2))
- (lshiftrt:DWIH (match_dup 3)
- (minus:QI (match_dup 6) (match_dup 2)))))
+ (ior:DWIH (ashift:DWIH (match_dup 5)
+ (and:QI (match_dup 2) (match_dup 6)))
+ (subreg:DWIH
+ (lshiftrt:<DWI> (zero_extend:<DWI> (match_dup 3))
+ (minus:QI (match_dup 7)
+ (and:QI (match_dup 2)
+ (match_dup 6)))) 0)))
(clobber (reg:CC FLAGS_REG))])]
{
- operands[6] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode));
+ operands[6] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode) - 1);
+ operands[7] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode));
split_double_mode (<DWI>mode, &operands[0], 1, &operands[4], &operands[5]);
})
[(set (match_dup 3) (match_dup 4))
(parallel
[(set (match_dup 4)
- (ior:DWIH (lshiftrt:DWIH (match_dup 4) (match_dup 2))
- (ashift:DWIH (match_dup 5)
- (minus:QI (match_dup 6) (match_dup 2)))))
+ (ior:DWIH (lshiftrt:DWIH (match_dup 4)
+ (and:QI (match_dup 2) (match_dup 6)))
+ (subreg:DWIH
+ (ashift:<DWI> (zero_extend:<DWI> (match_dup 5))
+ (minus:QI (match_dup 7)
+ (and:QI (match_dup 2)
+ (match_dup 6)))) 0)))
(clobber (reg:CC FLAGS_REG))])
(parallel
[(set (match_dup 5)
- (ior:DWIH (lshiftrt:DWIH (match_dup 5) (match_dup 2))
- (ashift:DWIH (match_dup 3)
- (minus:QI (match_dup 6) (match_dup 2)))))
+ (ior:DWIH (lshiftrt:DWIH (match_dup 5)
+ (and:QI (match_dup 2) (match_dup 6)))
+ (subreg:DWIH
+ (ashift:<DWI> (zero_extend:<DWI> (match_dup 3))
+ (minus:QI (match_dup 7)
+ (and:QI (match_dup 2)
+ (match_dup 6)))) 0)))
(clobber (reg:CC FLAGS_REG))])]
{
- operands[6] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode));
+ operands[6] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode) - 1);
+ operands[7] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode));
split_double_mode (<DWI>mode, &operands[0], 1, &operands[4], &operands[5]);
})