From: DJ Delorie <dj@redhat.com>
To: gdb-patches@sources.redhat.com
Cc: dj@redhat.com
Subject: [patch] sim/sh: fix movua for little endian
Date: Fri, 13 Aug 2004 19:34:00 -0000 [thread overview]
Message-ID: <200408131934.i7DJYbYX021478@greed.delorie.com> (raw)
The movua opcode was hardcoded for big endian; on little endian
targets it would retrieve the word backwards. Note that the global
endian compensators are keyed to the HOST endian as well and are not
usable for this purpose.
The problem and solution are obvious, but my implementation may not
be, so I await approval (global maintainers - no sim/sh maintainer).
Tested with an ABI testsuite I'm working on which is known to use
movua.
2004-08-13 DJ Delorie <dj@redhat.com>
* gencode.c (movua.l): Compensate for endianness.
Index: gencode.c
===================================================================
RCS file: /cvs/src/src/sim/sh/gencode.c,v
retrieving revision 1.28
diff -p -U1 -r1.28 gencode.c
--- gencode.c 13 Feb 2004 00:01:19 -0000 1.28
+++ gencode.c 13 Aug 2004 19:17:00 -0000
@@ -868,5 +868,6 @@ op tab[] =
"int regn = R[n];",
+ "int e = target_little_endian ? 3 : 0;",
"MA (1);",
- "R[0] = (RBAT (regn) << 24) + (RBAT (regn + 1) << 16) + ",
- " (RBAT (regn + 2) << 8) + RBAT (regn + 3);",
+ "R[0] = (RBAT (regn + (0^e)) << 24) + (RBAT (regn + (1^e)) << 16) + ",
+ " (RBAT (regn + (2^e)) << 8) + RBAT (regn + (3^e));",
"L (0);",
@@ -875,5 +876,6 @@ op tab[] =
"int regn = R[n];",
+ "int e = target_little_endian ? 3 : 0;",
"MA (1);",
- "R[0] = (RBAT (regn) << 24) + (RBAT (regn + 1) << 16) + ",
- " (RBAT (regn + 2) << 8) + RBAT (regn + 3);",
+ "R[0] = (RBAT (regn + (0^e)) << 24) + (RBAT (regn + (1^e)) << 16) + ",
+ " (RBAT (regn + (2^e)) << 8) + RBAT (regn + (3^e));",
"R[n] += 4;",
next reply other threads:[~2004-08-13 19:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-13 19:34 DJ Delorie [this message]
2004-08-23 19:48 ` Andrew Cagney
2004-08-23 20:22 ` DJ Delorie
2004-08-23 20:43 ` Andrew Cagney
2004-08-23 21:06 ` DJ Delorie
2004-08-24 13:13 ` Andrew Cagney
2004-08-24 14:55 ` DJ Delorie
2004-09-08 22:35 ` DJ Delorie
2004-09-12 15:02 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200408131934.i7DJYbYX021478@greed.delorie.com \
--to=dj@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox