aboutsummaryrefslogtreecommitdiff
path: root/sim/sh/gencode.c
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-08-31 01:14:27 +0000
committerJason Molenda <jmolenda@apple.com>1999-08-31 01:14:27 +0000
commit104c1213b4821a4b8664e66db4643a951b461576 (patch)
treed77adb32fcf044a485e1d4e0bb58e9da0ce39671 /sim/sh/gencode.c
parentfd485a97b145f7b8abe7c5f5ec63edd8268a4182 (diff)
downloadfsf-binutils-gdb-104c1213b4821a4b8664e66db4643a951b461576.zip
fsf-binutils-gdb-104c1213b4821a4b8664e66db4643a951b461576.tar.gz
fsf-binutils-gdb-104c1213b4821a4b8664e66db4643a951b461576.tar.bz2
import gdb-1999-08-30 snapshot
Diffstat (limited to 'sim/sh/gencode.c')
-rw-r--r--sim/sh/gencode.c40
1 files changed, 28 insertions, 12 deletions
diff --git a/sim/sh/gencode.c b/sim/sh/gencode.c
index be10e59..3aa3918 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",