summaryrefslogtreecommitdiff
path: root/sim/sh
diff options
context:
space:
mode:
Diffstat (limited to 'sim/sh')
-rw-r--r--sim/sh/ChangeLog8
-rw-r--r--sim/sh/gencode.c40
2 files changed, 36 insertions, 12 deletions
diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog
index 9c0f842ae5b..0d8a564bfbd 100644
--- a/sim/sh/ChangeLog
+++ b/sim/sh/ChangeLog
@@ -1,3 +1,11 @@
+Wed Aug 25 07:55:23 1999 Brendan Kehoe <brendan@cygnus.com>
+
+ * gencode.c (fcnvds <DR_N>,FPUL): Rewrite to use a local anonymous
+ union type, instead of casting to an int* then a float*.
+ (fcnvsd FPUL,<DR_N>): Likewise.
+ (flds <FREG_N>,FPUL): Likewise.
+ (fsts FPUL,<FREG_N>): Likewise.
+
1999-05-08 Felix Lee <flee@cygnus.com>
* configure: Regenerated to track ../common/aclocal.m4 changes.
diff --git a/sim/sh/gencode.c b/sim/sh/gencode.c
index be10e59c280..3aa3918146f 100644
--- a/sim/sh/gencode.c
+++ b/sim/sh/gencode.c
@@ -250,9 +250,13 @@ op tab[] =
" saved_state.asregs.exception = SIGILL;",
"else",
"{",
- " char buf[4];",
- " *(float *)buf = DR(n);",
- " FPUL = *(int *)buf;",
+ " union",
+ " {",
+ " int i;",
+ " float f;",
+ " } u;",
+ " u.f = DR(n);",
+ " FPUL = u.i;",
"}",
},
@@ -262,9 +266,13 @@ op tab[] =
" saved_state.asregs.exception = SIGILL;",
"else",
"{",
- " char buf[4];",
- " *(int *)buf = FPUL;",
- " SET_DR(n, *(float *)buf);",
+ " union",
+ " {",
+ " int i;",
+ " float f;",
+ " } u;",
+ " u.i = FPUL;",
+ " SET_DR(n, u.f);",
"}",
},
@@ -295,9 +303,13 @@ op tab[] =
/* sh3e */
{ "", "", "flds <FREG_N>,FPUL", "1111nnnn00011101",
- "char buf[4];",
- "*(float *)buf = FR(n);",
- "FPUL = *(int *)buf;",
+ " union",
+ " {",
+ " int i;",
+ " float f;",
+ " } u;",
+ " u.f = FR(n);",
+ " FPUL = u.i;",
},
/* sh3e */
@@ -464,9 +476,13 @@ op tab[] =
/* sh3e */
{ "", "", "fsts FPUL,<FREG_N>", "1111nnnn00001101",
- "char buf[4];",
- "*(int *)buf = FPUL;",
- "SET_FR (n, *(float *)buf);",
+ " union",
+ " {",
+ " int i;",
+ " float f;",
+ " } u;",
+ " u.i = FPUL;",
+ " SET_FR (n, u.f);",
},
{ "", "n", "jmp @<REG_N>", "0100nnnn00101011",