Commit 576e5acc by Jeffrey A Law Committed by Jeff Law

mn10300.c (print_operand): Handle 'S'.

        * mn10300.c (print_operand): Handle 'S'.
        * mn10300.md (ashlsi3, lshrsi3, ashrsi3): Use %S for
        shift amount in last alternative

From-SVN: r16134
parent 5d29a95f
Tue Oct 21 10:06:40 1997 Jeffrey A Law (law@cygnus.com) Tue Oct 21 10:06:40 1997 Jeffrey A Law (law@cygnus.com)
* mn10300.c (print_operand): Handle 'S'.
* mn10300.md (ashlsi3, lshrsi3, ashrsi3): Use %S for
shift amount in last alternative
* mn10300.c (expand_epilogue): Rework to handle register restores * mn10300.c (expand_epilogue): Rework to handle register restores
in "ret" and "retf" instructions correctly. in "ret" and "retf" instructions correctly.
......
...@@ -254,6 +254,18 @@ print_operand (file, x, code) ...@@ -254,6 +254,18 @@ print_operand (file, x, code)
output_address (GEN_INT ((~INTVAL (x)) & 0xff)); output_address (GEN_INT ((~INTVAL (x)) & 0xff));
break; break;
/* For shift counts. The hardware ignores the upper bits of
any immediate, but the assembler will flag an out of range
shift count as an error. So we mask off the high bits
of the immediate here. */
case 'S':
if (GET_CODE (x) == CONST_INT)
{
fprintf (file, "%d", INTVAL (x) & 0x1f);
break;
}
/* FALL THROUGH */
default: default:
switch (GET_CODE (x)) switch (GET_CODE (x))
{ {
......
...@@ -1269,7 +1269,7 @@ ...@@ -1269,7 +1269,7 @@
asl2 %0 asl2 %0
asl2 %0\;add %0,%0 asl2 %0\;add %0,%0
asl2 %0\;asl2 %0 asl2 %0\;asl2 %0
asl %2,%0" asl %S2,%0"
[(set_attr "cc" "set_zn")]) [(set_attr "cc" "set_zn")])
(define_insn "lshrsi3" (define_insn "lshrsi3"
...@@ -1278,7 +1278,7 @@ ...@@ -1278,7 +1278,7 @@
(match_operand:SI 1 "register_operand" "0") (match_operand:SI 1 "register_operand" "0")
(match_operand:QI 2 "nonmemory_operand" "di")))] (match_operand:QI 2 "nonmemory_operand" "di")))]
"" ""
"lsr %2,%0" "lsr %S2,%0"
[(set_attr "cc" "set_zn")]) [(set_attr "cc" "set_zn")])
(define_insn "ashrsi3" (define_insn "ashrsi3"
...@@ -1287,7 +1287,7 @@ ...@@ -1287,7 +1287,7 @@
(match_operand:SI 1 "register_operand" "0") (match_operand:SI 1 "register_operand" "0")
(match_operand:QI 2 "nonmemory_operand" "di")))] (match_operand:QI 2 "nonmemory_operand" "di")))]
"" ""
"asr %2,%0" "asr %S2,%0"
[(set_attr "cc" "set_zn")]) [(set_attr "cc" "set_zn")])
;; ---------------------------------------------------------------------- ;; ----------------------------------------------------------------------
......
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