diff options
author | Jeffrey A Law <law@cygnus.com> | 1997-10-21 19:10:24 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1997-10-21 13:10:24 -0600 |
commit | 576e5accbda5cfee3abf23a411d7baf53e7cd729 (patch) | |
tree | 0f4cf005f0eed17b939942e0c70ccac871bb5596 | |
parent | 5d29a95f92918a9354b8b23624a67d2d08ffa6bb (diff) | |
download | gcc-576e5accbda5cfee3abf23a411d7baf53e7cd729.zip gcc-576e5accbda5cfee3abf23a411d7baf53e7cd729.tar.gz gcc-576e5accbda5cfee3abf23a411d7baf53e7cd729.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/config/mn10300/mn10300.c | 12 | ||||
-rw-r--r-- | gcc/config/mn10300/mn10300.md | 6 |
3 files changed, 19 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c349ff9..93351b8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 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 in "ret" and "retf" instructions correctly. diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c index 7706061..e555921 100644 --- a/gcc/config/mn10300/mn10300.c +++ b/gcc/config/mn10300/mn10300.c @@ -254,6 +254,18 @@ print_operand (file, x, code) output_address (GEN_INT ((~INTVAL (x)) & 0xff)); 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: switch (GET_CODE (x)) { diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md index f821e49..c835043 100644 --- a/gcc/config/mn10300/mn10300.md +++ b/gcc/config/mn10300/mn10300.md @@ -1269,7 +1269,7 @@ asl2 %0 asl2 %0\;add %0,%0 asl2 %0\;asl2 %0 - asl %2,%0" + asl %S2,%0" [(set_attr "cc" "set_zn")]) (define_insn "lshrsi3" @@ -1278,7 +1278,7 @@ (match_operand:SI 1 "register_operand" "0") (match_operand:QI 2 "nonmemory_operand" "di")))] "" - "lsr %2,%0" + "lsr %S2,%0" [(set_attr "cc" "set_zn")]) (define_insn "ashrsi3" @@ -1287,7 +1287,7 @@ (match_operand:SI 1 "register_operand" "0") (match_operand:QI 2 "nonmemory_operand" "di")))] "" - "asr %2,%0" + "asr %S2,%0" [(set_attr "cc" "set_zn")]) ;; ---------------------------------------------------------------------- |