diff options
author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-10-26 21:08:47 +0000 |
---|---|---|
committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-10-26 21:08:47 +0000 |
commit | 8db8f925bb16c45edc28e39807839fc550057d1f (patch) | |
tree | ab3eec2549480c58c3489e32d06fb9fe879a97f4 | |
parent | bab5a44db9b7eb6d8397cfbed93b0e881954092f (diff) | |
download | gcc-8db8f925bb16c45edc28e39807839fc550057d1f.tar.gz |
* config/h8300/h8300.c (get_shift_alg): Remove redundant code.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46560 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.c | 198 |
2 files changed, 25 insertions, 177 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6e4d58dfe4b..3ae47434d0f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2001-10-26 Kazu Hirata <kazu@hxi.com> + + * config/h8300/h8300.c (get_shift_alg): Remove redundant code. + 2001-10-26 Neil Booth <neil@daikokuya.demon.co.uk> * c-typeck.c (convert_arguments): When comparing for enumeral diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index f0a8258fc30..c713f522782 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -2280,117 +2280,29 @@ get_shift_alg (shift_type, shift_mode, count, info) goto return_shift_special; } } - else if (count == 8) + else if (8 <= count && count <= 12) { + info->remainder = count - 8; + switch (shift_type) { case SHIFT_ASHIFT: info->special = "mov.b\t%s0,%t0\n\tsub.b\t%s0,%s0"; + info->shift1 = "shal.b\t%t0"; + info->shift2 = "shal.b\t#2,%t0"; goto return_shift_special; case SHIFT_LSHIFTRT: info->special = "mov.b\t%t0,%s0\n\tsub.b\t%t0,%t0"; + info->shift1 = "shlr.b\t%s0"; + info->shift2 = "shlr.b\t#2,%s0"; goto return_shift_special; case SHIFT_ASHIFTRT: if (TARGET_H8300) - info->special = "mov.b\t%t0,%s0\n\tshll\t%t0\n\tsubx\t%t0,%t0"; + info->special = "mov.b\t%t0,%s0\n\tbld\t#7,%s0\n\tsubx\t%t0,%t0"; else info->special = "mov.b\t%t0,%s0\n\texts.w\t%T0"; - goto return_shift_special; - } - } - else if (count == 9) - { - switch (shift_type) - { - case SHIFT_ASHIFT: - info->special = "mov.b\t%s0,%t0\n\tsub.b\t%s0,%s0\n\tshal.b\t%t0"; - goto return_shift_special; - case SHIFT_LSHIFTRT: - info->special = "mov.b\t%t0,%s0\n\tsub.b\t%t0,%t0\n\tshlr.b\t%s0"; - goto return_shift_special; - case SHIFT_ASHIFTRT: - if (TARGET_H8300) - info->special = "mov.b\t%t0,%s0\n\tbld\t#7,%s0\n\tsubx\t%t0,%t0\n\tshar.b\t%s0"; - else - info->special = "mov.b\t%t0,%s0\n\texts.w\t%T0\n\tshar.b\t%s0"; - goto return_shift_special; - } - } - else if (count == 10) - { - switch (shift_type) - { - case SHIFT_ASHIFT: - if (TARGET_H8300S) - info->special = "mov.b\t%s0,%t0\n\tsub.b\t%s0,%s0\n\tshal.b\t#2,%t0"; - else - info->special = "mov.b\t%s0,%t0\n\tsub.b\t%s0,%s0\n\tshal.b\t%t0\n\tshal.b\t%t0"; - goto return_shift_special; - case SHIFT_LSHIFTRT: - if (TARGET_H8300S) - info->special = "mov.b\t%t0,%s0\n\tsub.b\t%t0,%t0\n\tshlr.b\t#2,%s0"; - else - info->special = "mov.b\t%t0,%s0\n\tsub.b\t%t0,%t0\n\tshlr.b\t%s0\n\tshlr.b\t%s0"; - goto return_shift_special; - case SHIFT_ASHIFTRT: - if (TARGET_H8300) - info->special = "mov.b\t%t0,%s0\n\tbld\t#7,%s0\n\tsubx\t%t0,%t0\n\tshar.b\t%s0\n\tshar.b\t%s0"; - else if (TARGET_H8300H) - info->special = "mov.b\t%t0,%s0\n\texts.w\t%T0\n\tshar.b\t%s0\n\tshar.b\t%s0"; - else if (TARGET_H8300S) - info->special = "mov.b\t%t0,%s0\n\texts.w\t%T0\n\tshar.b\t#2,%s0"; - goto return_shift_special; - } - } - else if (count == 11) - { - switch (shift_type) - { - case SHIFT_ASHIFT: - if (TARGET_H8300S) - info->special = "mov.b\t%s0,%t0\n\tsub.b\t%s0,%s0\n\tshal.b\t#2,%t0\n\tshal.b\t%t0"; - else - info->special = "mov.b\t%s0,%t0\n\tsub.b\t%s0,%s0\n\tshal.b\t%t0\n\tshal.b\t%t0\n\tshal.b\t%t0"; - goto return_shift_special; - case SHIFT_LSHIFTRT: - if (TARGET_H8300S) - info->special = "mov.b\t%t0,%s0\n\tsub.b\t%t0,%t0\n\tshlr.b\t#2,%s0\n\tshlr.b\t%s0"; - else - info->special = "mov.b\t%t0,%s0\n\tsub.b\t%t0,%t0\n\tshlr.b\t%s0\n\tshlr.b\t%s0\n\tshlr.b\t%s0"; - goto return_shift_special; - case SHIFT_ASHIFTRT: - if (TARGET_H8300) - info->special = "mov.b\t%t0,%s0\n\tbld\t#7,%s0\n\tsubx\t%t0,%t0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0"; - else if (TARGET_H8300H) - info->special = "mov.b\t%t0,%s0\n\texts.w\t%T0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0"; - else if (TARGET_H8300S) - info->special = "mov.b\t%t0,%s0\n\texts.w\t%T0\n\tshar.b\t#2,%s0\n\tshar.b\t%s0"; - goto return_shift_special; - } - } - else if (count == 12) - { - switch (shift_type) - { - case SHIFT_ASHIFT: - if (TARGET_H8300S) - info->special = "mov.b\t%s0,%t0\n\tsub.b\t%s0,%s0\n\tshal.b\t#2,%t0\n\tshal.b\t#2,%t0"; - else - info->special = "mov.b\t%s0,%t0\n\tsub.b\t%s0,%s0\n\tshal.b\t%t0\n\tshal.b\t%t0\n\tshal.b\t%t0\n\tshal.b\t%t0"; - goto return_shift_special; - case SHIFT_LSHIFTRT: - if (TARGET_H8300S) - info->special = "mov.b\t%t0,%s0\n\tsub.b\t%t0,%t0\n\tshlr.b\t#2,%s0\n\tshlr.b\t#2,%s0"; - else - info->special = "mov.b\t%t0,%s0\n\tsub.b\t%t0,%t0\n\tshlr.b\t%s0\n\tshlr.b\t%s0\n\tshlr.b\t%s0\n\tshlr.b\t%s0"; - goto return_shift_special; - case SHIFT_ASHIFTRT: - if (TARGET_H8300) - info->special = "mov.b\t%t0,%s0\n\tbld\t#7,%s0\n\tsubx\t%t0,%t0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0"; - else if (TARGET_H8300H) - info->special = "mov.b\t%t0,%s0\n\texts.w\t%T0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0"; - else if (TARGET_H8300S) - info->special = "mov.b\t%t0,%s0\n\texts.w\t%T0\n\tshar.b\t#2,%s0\n\tshar.b\t#2,%s0"; + info->shift1 = "shar.b\t%s0"; + info->shift2 = "shar.b\t#2,%s0"; goto return_shift_special; } } @@ -2446,99 +2358,31 @@ get_shift_alg (shift_type, shift_mode, count, info) goto return_shift_special; } } - else if (count == 16) + else if ((TARGET_H8300 && count == 16) + || (TARGET_H8300H && 16 <= count && count <= 19) + || (TARGET_H8300S && 16 <= count && count <= 20)) { + info->remainder = count - 16; + switch (shift_type) { case SHIFT_ASHIFT: info->special = "mov.w\t%f0,%e0\n\tsub.w\t%f0,%f0"; + info->shift1 = "shll.l\t%S0"; + info->shift2 = "shll.l\t#2,%S0"; goto return_shift_special; case SHIFT_LSHIFTRT: info->special = "mov.w\t%e0,%f0\n\tsub.w\t%e0,%e0"; + info->shift1 = "shlr.l\t%S0"; + info->shift2 = "shlr.l\t#2,%S0"; goto return_shift_special; case SHIFT_ASHIFTRT: if (TARGET_H8300) info->special = "mov.w\t%e0,%f0\n\tshll\t%z0\n\tsubx\t%z0,%z0\n\tmov.b\t%z0,%y0"; else info->special = "mov.w\t%e0,%f0\n\texts.l\t%S0"; - goto return_shift_special; - } - } - else if (count == 17 && !TARGET_H8300) - { - switch (shift_type) - { - case SHIFT_ASHIFT: - info->special = "mov.w\t%f0,%e0\n\tsub.w\t%f0,%f0\n\tshll.l\t%S0"; - goto return_shift_special; - case SHIFT_LSHIFTRT: - info->special = "mov.w\t%e0,%f0\n\tsub.w\t%e0,%e0\n\tshlr.l\t%S0"; - goto return_shift_special; - case SHIFT_ASHIFTRT: - info->special = "mov.w\t%e0,%f0\n\texts.l\t%S0\n\tshar.l\t%S0"; - goto return_shift_special; - } - } - else if (count == 18 && !TARGET_H8300) - { - switch (shift_type) - { - case SHIFT_ASHIFT: - if (TARGET_H8300S) - info->special = "mov.w\t%f0,%e0\n\tsub.w\t%f0,%f0\n\tshll.l\t#2,%S0"; - else - info->special = "mov.w\t%f0,%e0\n\tsub.w\t%f0,%f0\n\tshll.l\t%S0\n\tshll.l\t%S0"; - goto return_shift_special; - case SHIFT_LSHIFTRT: - if (TARGET_H8300S) - info->special = "mov.w\t%e0,%f0\n\tsub.w\t%e0,%e0\n\tshlr.l\t#2,%S0"; - else - info->special = "mov.w\t%e0,%f0\n\tsub.w\t%e0,%e0\n\tshlr.l\t%S0\n\tshlr.l\t%S0"; - goto return_shift_special; - case SHIFT_ASHIFTRT: - if (TARGET_H8300S) - info->special = "mov.w\t%e0,%f0\n\texts.l\t%S0\n\tshar.l\t#2,%S0"; - else - info->special = "mov.w\t%e0,%f0\n\texts.l\t%S0\n\tshar.l\t%S0\n\tshar.l\t%S0"; - goto return_shift_special; - } - } - else if (count == 19 && !TARGET_H8300) - { - switch (shift_type) - { - case SHIFT_ASHIFT: - if (TARGET_H8300S) - info->special = "mov.w\t%f0,%e0\n\tsub.w\t%f0,%f0\n\tshll.l\t#2,%S0\n\tshll.l\t%S0"; - else - info->special = "mov.w\t%f0,%e0\n\tsub.w\t%f0,%f0\n\tshll.l\t%S0\n\tshll.l\t%S0\n\tshll.l\t%S0"; - goto return_shift_special; - case SHIFT_LSHIFTRT: - if (TARGET_H8300S) - info->special = "mov.w\t%e0,%f0\n\tsub.w\t%e0,%e0\n\tshlr.l\t#2,%S0\n\tshlr.l\t%S0"; - else - info->special = "mov.w\t%e0,%f0\n\tsub.w\t%e0,%e0\n\tshlr.l\t%S0\n\tshlr.l\t%S0\n\tshlr.l\t%S0"; - goto return_shift_special; - case SHIFT_ASHIFTRT: - if (TARGET_H8300S) - info->special = "mov.w\t%e0,%f0\n\texts.l\t%S0\n\tshar.l\t#2,%S0\n\tshar.l\t%S0"; - else - info->special = "mov.w\t%e0,%f0\n\texts.l\t%S0\n\tshar.l\t%S0\n\tshar.l\t%S0\n\tshar.l\t%S0"; - goto return_shift_special; - } - } - else if (count == 20 && TARGET_H8300S) - { - switch (shift_type) - { - case SHIFT_ASHIFT: - info->special = "mov.w\t%f0,%e0\n\tsub.w\t%f0,%f0\n\tshll.l\t#2,%S0\n\tshll.l\t#2,%S0"; - goto return_shift_special; - case SHIFT_LSHIFTRT: - info->special = "mov.w\t%e0,%f0\n\tsub.w\t%e0,%e0\n\tshlr.l\t#2,%S0\n\tshlr.l\t#2,%S0"; - goto return_shift_special; - case SHIFT_ASHIFTRT: - info->special = "mov.w\t%e0,%f0\n\texts.l\t%S0\n\tshar.l\t#2,%S0\n\tshar.l\t#2,%S0"; + info->shift1 = "shar.l\t%S0"; + info->shift2 = "shar.l\t#2,%S0"; goto return_shift_special; } } |