Commit ba0443bb by Torbjorn Granlund

(Recognizer for zdepi_operand in HImode): New pattern.

(Recognizer for zdepi_operand in SImode): Call output_zdepi for output.
(shift patterns and recognizers): Handle 32 bit ints and truncate them for output.

From-SVN: r1788
parent f093cb8f
...@@ -767,39 +767,18 @@ ...@@ -767,39 +767,18 @@
"" ""
"* "*
{ {
unsigned long x = INTVAL (operands[1]); return output_zdepi (operands);
int i; }"
[(set_attr "type" "move")
for (i = 0; i < 32; i++) (set_attr "length" "1")])
{
if ((x & 1) != 0)
break;
x >>= 1;
}
if ((x & 0x10) == 0)
{
operands[1] = gen_rtx (CONST_INT, VOIDmode, x);
operands[2] = gen_rtx (CONST_INT, VOIDmode, 31 - i);
operands[3] = gen_rtx (CONST_INT, VOIDmode, 32 - i < 4 ? 32 - i : 4);
}
else
{
operands[1] = gen_rtx (CONST_INT, VOIDmode, (x & 0xf) - 0x10);
operands[2] = gen_rtx (CONST_INT, VOIDmode, 31 - i);
x >>= 5;
for (i = 0; i < 32; i++)
{
if ((x & 1) == 0)
break;
x >>= 1;
}
operands[3] = gen_rtx (CONST_INT, VOIDmode, i + 5);
}
return \"zdepi %1,%2,%3,%0\"; (define_insn ""
[(set (match_operand:HI 0 "register_operand" "=r")
(match_operand:HI 1 "zdepi_operand" "n"))]
""
"*
{
return output_zdepi (operands);
}" }"
[(set_attr "type" "move") [(set_attr "type" "move")
(set_attr "length" "1")]) (set_attr "length" "1")])
...@@ -1896,7 +1875,7 @@ ...@@ -1896,7 +1875,7 @@
(define_expand "ashlsi3" (define_expand "ashlsi3"
[(set (match_operand:SI 0 "register_operand" "") [(set (match_operand:SI 0 "register_operand" "")
(ashift:SI (match_operand:SI 1 "register_operand" "") (ashift:SI (match_operand:SI 1 "register_operand" "")
(match_operand:SI 2 "arith5_operand" "")))] (match_operand:SI 2 "arith32_operand" "")))]
"" ""
" "
{ {
...@@ -1921,18 +1900,15 @@ ...@@ -1921,18 +1900,15 @@
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
(ashift:SI (match_operand:SI 1 "register_operand" "r") (ashift:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "int5_operand" "L")))] (match_operand:SI 2 "const_int_operand" "n")))]
"" ""
"* "*
{ {
rtx xoperands[4]; operands[3] = gen_rtx (CONST_INT, VOIDmode,
xoperands[0] = operands[0]; xoperands[1] = operands[1]; 32 - (INTVAL (operands[2]) & 31));
xoperands[2] = gen_rtx (CONST_INT, VOIDmode, operands[2] = gen_rtx (CONST_INT, VOIDmode,
31 - INTVAL (operands[2])); 31 - (INTVAL (operands[2]) & 31));
xoperands[3] = gen_rtx (CONST_INT, VOIDmode, return \"zdep %1,%2,%3,%0\";
32 - INTVAL (operands[2]));
output_asm_insn (\"zdep %1,%2,%3,%0\", xoperands);
return \"\";
}") }")
(define_insn "" (define_insn ""
...@@ -1946,7 +1922,7 @@ ...@@ -1946,7 +1922,7 @@
(define_expand "ashrsi3" (define_expand "ashrsi3"
[(set (match_operand:SI 0 "register_operand" "") [(set (match_operand:SI 0 "register_operand" "")
(ashiftrt:SI (match_operand:SI 1 "register_operand" "") (ashiftrt:SI (match_operand:SI 1 "register_operand" "")
(match_operand:SI 2 "arith5_operand" "")))] (match_operand:SI 2 "arith32_operand" "")))]
"" ""
" "
{ {
...@@ -1971,21 +1947,17 @@ ...@@ -1971,21 +1947,17 @@
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
(ashiftrt:SI (match_operand:SI 1 "register_operand" "r") (ashiftrt:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "int5_operand" "L")))] (match_operand:SI 2 "const_int_operand" "n")))]
"" ""
"* "*
{ {
rtx xoperands[4]; operands[3] = gen_rtx (CONST_INT, VOIDmode,
xoperands[0] = operands[0]; xoperands[1] = operands[1]; 32 - (INTVAL (operands[2]) & 31));
xoperands[2] = gen_rtx (CONST_INT, VOIDmode, operands[2] = gen_rtx (CONST_INT, VOIDmode,
31 - INTVAL (operands[2])); 31 - (INTVAL (operands[2]) & 31));
xoperands[3] = gen_rtx (CONST_INT, VOIDmode, return \"extrs %1,%2,%3,%0\";
32 - INTVAL (operands[2]));
output_asm_insn (\"extrs %1,%2,%3,%0\", xoperands);
return \"\";
}") }")
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
(ashiftrt:SI (match_operand:SI 1 "register_operand" "r") (ashiftrt:SI (match_operand:SI 1 "register_operand" "r")
...@@ -1997,7 +1969,7 @@ ...@@ -1997,7 +1969,7 @@
(define_expand "lshrsi3" (define_expand "lshrsi3"
[(set (match_operand:SI 0 "register_operand" "") [(set (match_operand:SI 0 "register_operand" "")
(lshiftrt:SI (match_operand:SI 1 "register_operand" "") (lshiftrt:SI (match_operand:SI 1 "register_operand" "")
(match_operand:SI 2 "arith5_operand" "")))] (match_operand:SI 2 "arith32_operand" "")))]
"" ""
" "
{ {
...@@ -2022,18 +1994,15 @@ ...@@ -2022,18 +1994,15 @@
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
(lshiftrt:SI (match_operand:SI 1 "register_operand" "r") (lshiftrt:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "uint5_operand" "K")))] (match_operand:SI 2 "const_int_operand" "n")))]
"" ""
"* "*
{ {
rtx xoperands[4]; operands[3] = gen_rtx (CONST_INT, VOIDmode,
xoperands[0] = operands[0]; xoperands[1] = operands[1]; 32 - (INTVAL (operands[2]) & 31));
xoperands[2] = gen_rtx (CONST_INT, VOIDmode, operands[2] = gen_rtx (CONST_INT, VOIDmode,
31 - INTVAL (operands[2])); 31 - (INTVAL (operands[2]) & 31));
xoperands[3] = gen_rtx (CONST_INT, VOIDmode, return \"extru %1,%2,%3,%0\";
32 - INTVAL (operands[2]));
output_asm_insn (\"extru %1,%2,%3,%0\", xoperands);
return \"\";
}") }")
(define_insn "" (define_insn ""
......
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