Skip to content

Commit c0ded7b

Browse files
Claudiu Zissulescuartemiy-volkov
authored andcommitted
arc64: Add compare with 0 xbfu insns
1 parent 442b0ff commit c0ded7b

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

gcc/config/arc64/arc64.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1996,6 +1996,46 @@ vfins, vfsub, vfmul, vfdiv, vfrep, vpack, xbfu, xor, xorl"
19961996
(set_attr "length" "8,8")
19971997
(set_attr "predicable" "no")])
19981998

1999+
(define_insn "*extzvsi_cmp0"
2000+
[(set (reg:CC_ZN CC_REGNUM)
2001+
(compare:CC_ZN
2002+
(zero_extract:SI
2003+
(match_operand:SI 1 "register_operand" "0,r")
2004+
(match_operand 2 "const_int_operand" "n,n")
2005+
(match_operand 3 "const_int_operand" "n,n"))
2006+
(const_int 0)))
2007+
(set (match_operand:SI 0 "register_operand" "=r,r")
2008+
(zero_extract:SI (match_dup 1)
2009+
(match_dup 2)
2010+
(match_dup 3)))]
2011+
""
2012+
{
2013+
int assemble_op2 = (((INTVAL (operands[2]) - 1) & 0x1f) << 5)
2014+
| (INTVAL (operands[3]) & 0x1f);
2015+
operands[2] = GEN_INT (assemble_op2);
2016+
return "xbfu.f\\t%0,%1,%2";
2017+
}
2018+
[(set_attr "type" "xbfu")
2019+
(set_attr "length" "4,8")])
2020+
2021+
(define_insn "*extzvsi_cmp0_noout"
2022+
[(set (reg:CC_ZN CC_REGNUM)
2023+
(compare:CC_ZN
2024+
(zero_extract:SI
2025+
(match_operand:SI 0 "register_operand" "r")
2026+
(match_operand 1 "const_int_operand" "n")
2027+
(match_operand 2 "const_int_operand" "n"))
2028+
(const_int 0)))]
2029+
""
2030+
{
2031+
int assemble_op2 = (((INTVAL (operands[1]) - 1) & 0x1f) << 5)
2032+
| (INTVAL (operands[2]) & 0x1f);
2033+
operands[2] = GEN_INT (assemble_op2);
2034+
return "xbfu.f\\t0,%1,%2";
2035+
}
2036+
[(set_attr "type" "xbfu")
2037+
(set_attr "length" "8")])
2038+
19992039
;; -------------------------------------------------------------------
20002040
;; Bitscan
20012041
;; -------------------------------------------------------------------

0 commit comments

Comments
 (0)