aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJ"orn Rennecke <joern.rennecke@superh.com>2002-07-25 19:38:54 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2002-07-25 20:38:54 +0100
commit593246856334576980d2623c609223af19165117 (patch)
tree30b5ae60a5a44c7834136d3b07ad68825229669b /gcc
parent9b331d8d72e553110c391de8621d5e71da031823 (diff)
downloadgcc-593246856334576980d2623c609223af19165117.zip
gcc-593246856334576980d2623c609223af19165117.tar.gz
gcc-593246856334576980d2623c609223af19165117.tar.bz2
sh.h (LOAD_EXTEND_OP): QImode zero-extends on SHmedia.
* sh.h (LOAD_EXTEND_OP): QImode zero-extends on SHmedia. * sh.md (truncdiqi2, movqi_media): Likewise. From-SVN: r55757
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sh/sh.h5
-rw-r--r--gcc/config/sh/sh.md12
3 files changed, 14 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3665609..ec0b396 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jul 25 20:34:50 2002 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (LOAD_EXTEND_OP): QImode zero-extends on SHmedia.
+ * sh.md (truncdiqi2, movqi_media): Likewise.
+
2002-07-25 Neil Booth <neil@daikokuya.co.uk>
* gcse.c (obstack_chunk_alloc): Remove.
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index fc1cfb4..3002c3e 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -2623,9 +2623,12 @@ while (0)
will either zero-extend or sign-extend. The value of this macro should
be the code that says which one of the two operations is implicitly
done, NIL if none. */
+/* For SHmedia, we can truncate to QImode easier using zero extension. */
/* FP registers can load SImode values, but don't implicitly sign-extend
them to DImode. */
-#define LOAD_EXTEND_OP(MODE) ((MODE) != SImode ? SIGN_EXTEND : NIL)
+#define LOAD_EXTEND_OP(MODE) \
+ (((MODE) == QImode && TARGET_SHMEDIA) ? ZERO_EXTEND \
+ : (MODE) != SImode ? SIGN_EXTEND : NIL)
/* Define if loading short immediate values into registers sign extends. */
#define SHORT_IMMEDIATES_SIGN_EXTEND
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 48ae813..aa64bf5 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -3382,17 +3382,15 @@
[(set_attr "type" "arith_media,store_media")
(set_attr "length" "8,4")])
-; N.B. we want sign-extension here because
-; - we need to be consistent with LOAD_EXTEND_OP and movqi
-; - only sign extension allows us to do signed compares transparently.
-; unsigned compares don't care about the kind of extension as long as
-; it's consistent.
+; N.B. This should agree with LOAD_EXTEND_OP and movqi.
+; Because we use zero extension, we can't provide signed QImode compares
+; using a simple compare or conditional banch insn.
(define_insn "truncdiqi2"
[(set (match_operand:QI 0 "general_movdst_operand" "=r,m")
(truncate:QI (match_operand:DI 1 "register_operand" "r,r")))]
"TARGET_SHMEDIA"
"@
- ori %1, -256, %0
+ and %1, 255, %0
st%M0.b %m0, %1"
[(set_attr "type" "arith_media,store")])
@@ -3741,7 +3739,7 @@
"@
add.l %1, r63, %0
movi %1, %0
- ld%M1.b %m1, %0
+ ld%M1.ub %m1, %0
st%M0.b %m0, %1"
[(set_attr "type" "arith_media,arith_media,load_media,store_media")])