Revision a8d3431a
b/target-arm/nwfpe/double_cpdo.c | ||
---|---|---|
150 | 150 |
case MNF_CODE: |
151 | 151 |
{ |
152 | 152 |
unsigned int *p = (unsigned int*)&rFm; |
153 |
#ifdef WORDS_BIGENDIAN |
|
154 |
p[0] ^= 0x80000000; |
|
155 |
#else |
|
153 | 156 |
p[1] ^= 0x80000000; |
157 |
#endif |
|
154 | 158 |
fpa11->fpreg[Fd].fDouble = rFm; |
155 | 159 |
} |
156 | 160 |
break; |
... | ... | |
158 | 162 |
case ABS_CODE: |
159 | 163 |
{ |
160 | 164 |
unsigned int *p = (unsigned int*)&rFm; |
165 |
#ifdef WORDS_BIGENDIAN |
|
166 |
p[0] &= 0x7fffffff; |
|
167 |
#else |
|
161 | 168 |
p[1] &= 0x7fffffff; |
169 |
#endif |
|
162 | 170 |
fpa11->fpreg[Fd].fDouble = rFm; |
163 | 171 |
} |
164 | 172 |
break; |
b/target-arm/nwfpe/fpa11.h | ||
---|---|---|
22 | 22 |
#ifndef __FPA11_H__ |
23 | 23 |
#define __FPA11_H__ |
24 | 24 |
|
25 |
#include <stdlib.h> |
|
26 |
#include <stdio.h> |
|
27 |
#include <errno.h> |
|
28 |
|
|
25 | 29 |
#define GET_FPA11() (qemufpa) |
26 | 30 |
|
27 | 31 |
/* |
... | ... | |
87 | 91 |
extern void SetRoundingMode(const unsigned int); |
88 | 92 |
extern void SetRoundingPrecision(const unsigned int); |
89 | 93 |
|
90 |
#define get_user(x,y) ((x)=*(y)) |
|
91 |
#define put_user(x,y) (*(y)=(x)) |
|
92 | 94 |
static inline unsigned int readRegister(unsigned int reg) |
93 | 95 |
{ |
94 | 96 |
return (user_registers[(reg)]); |
... | ... | |
128 | 130 |
|
129 | 131 |
unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, unsigned int* qregs); |
130 | 132 |
|
133 |
/* included only for get_user/put_user macros */ |
|
134 |
#include "qemu.h" |
|
135 |
|
|
131 | 136 |
#endif |
b/target-arm/nwfpe/fpa11_cpdt.c | ||
---|---|---|
43 | 43 |
unsigned int *p; |
44 | 44 |
p = (unsigned int*)&fpa11->fpreg[Fn].fDouble; |
45 | 45 |
fpa11->fType[Fn] = typeDouble; |
46 |
#ifdef WORDS_BIGENDIAN |
|
47 |
get_user(p[0], &pMem[0]); /* sign & exponent */ |
|
48 |
get_user(p[1], &pMem[1]); |
|
49 |
#else |
|
46 | 50 |
get_user(p[0], &pMem[1]); |
47 | 51 |
get_user(p[1], &pMem[0]); /* sign & exponent */ |
52 |
#endif |
|
48 | 53 |
} |
49 | 54 |
|
50 | 55 |
static inline |
... | ... | |
133 | 138 |
|
134 | 139 |
default: val = fpa11->fpreg[Fn].fDouble; |
135 | 140 |
} |
141 |
#ifdef WORDS_BIGENDIAN |
|
142 |
put_user(p[0], &pMem[0]); /* msw */ |
|
143 |
put_user(p[1], &pMem[1]); /* lsw */ |
|
144 |
#else |
|
136 | 145 |
put_user(p[1], &pMem[0]); /* msw */ |
137 | 146 |
put_user(p[0], &pMem[1]); /* lsw */ |
147 |
#endif |
|
138 | 148 |
} |
139 | 149 |
|
140 | 150 |
static inline |
Also available in: Unified diff