Commit 65a650c2a5ed2f33357ba9d29d0f56f6b131333a
1 parent
6bb72b18
Fix compiler warnings in nwfpe code.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Showing
5 changed files
with
47 additions
and
86 deletions
linux-user/arm/nwfpe/fpa11.c
... | ... | @@ -30,11 +30,6 @@ |
30 | 30 | |
31 | 31 | #include <stdio.h> |
32 | 32 | |
33 | -/* forward declarations */ | |
34 | -unsigned int EmulateCPDO(const unsigned int); | |
35 | -unsigned int EmulateCPDT(const unsigned int); | |
36 | -unsigned int EmulateCPRT(const unsigned int); | |
37 | - | |
38 | 33 | FPA11* qemufpa=0; |
39 | 34 | CPUARMState* user_registers; |
40 | 35 | ... | ... |
linux-user/arm/nwfpe/fpa11.h
... | ... | @@ -116,6 +116,15 @@ static inline void writeConditionCodes(unsigned int x) |
116 | 116 | |
117 | 117 | unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, CPUARMState* qregs); |
118 | 118 | |
119 | +unsigned int EmulateCPDO(const unsigned int); | |
120 | +unsigned int EmulateCPDT(const unsigned int); | |
121 | +unsigned int EmulateCPRT(const unsigned int); | |
122 | + | |
123 | +unsigned int SingleCPDO(const unsigned int opcode); | |
124 | +unsigned int DoubleCPDO(const unsigned int opcode); | |
125 | +unsigned int ExtendedCPDO(const unsigned int opcode); | |
126 | + | |
127 | + | |
119 | 128 | /* included only for get_user/put_user macros */ |
120 | 129 | #include "qemu.h" |
121 | 130 | ... | ... |
linux-user/arm/nwfpe/fpa11_cpdo.c
... | ... | @@ -22,10 +22,6 @@ |
22 | 22 | #include "fpa11.h" |
23 | 23 | #include "fpopcode.h" |
24 | 24 | |
25 | -unsigned int SingleCPDO(const unsigned int opcode); | |
26 | -unsigned int DoubleCPDO(const unsigned int opcode); | |
27 | -unsigned int ExtendedCPDO(const unsigned int opcode); | |
28 | - | |
29 | 25 | unsigned int EmulateCPDO(const unsigned int opcode) |
30 | 26 | { |
31 | 27 | FPA11 *fpa11 = GET_FPA11(); | ... | ... |
linux-user/arm/nwfpe/fpa11_cpdt.c
... | ... | @@ -29,9 +29,8 @@ |
29 | 29 | //#include <asm/uaccess.h> |
30 | 30 | |
31 | 31 | static inline |
32 | -void loadSingle(const unsigned int Fn,const unsigned int *pMem) | |
32 | +void loadSingle(const unsigned int Fn, target_ulong addr) | |
33 | 33 | { |
34 | - target_ulong addr = (target_ulong)(long)pMem; | |
35 | 34 | FPA11 *fpa11 = GET_FPA11(); |
36 | 35 | fpa11->fType[Fn] = typeSingle; |
37 | 36 | /* FIXME - handle failure of get_user() */ |
... | ... | @@ -39,9 +38,8 @@ void loadSingle(const unsigned int Fn,const unsigned int *pMem) |
39 | 38 | } |
40 | 39 | |
41 | 40 | static inline |
42 | -void loadDouble(const unsigned int Fn,const unsigned int *pMem) | |
41 | +void loadDouble(const unsigned int Fn, target_ulong addr) | |
43 | 42 | { |
44 | - target_ulong addr = (target_ulong)(long)pMem; | |
45 | 43 | FPA11 *fpa11 = GET_FPA11(); |
46 | 44 | unsigned int *p; |
47 | 45 | p = (unsigned int*)&fpa11->fpreg[Fn].fDouble; |
... | ... | @@ -58,9 +56,8 @@ void loadDouble(const unsigned int Fn,const unsigned int *pMem) |
58 | 56 | } |
59 | 57 | |
60 | 58 | static inline |
61 | -void loadExtended(const unsigned int Fn,const unsigned int *pMem) | |
59 | +void loadExtended(const unsigned int Fn, target_ulong addr) | |
62 | 60 | { |
63 | - target_ulong addr = (target_ulong)(long)pMem; | |
64 | 61 | FPA11 *fpa11 = GET_FPA11(); |
65 | 62 | unsigned int *p; |
66 | 63 | p = (unsigned int*)&fpa11->fpreg[Fn].fExtended; |
... | ... | @@ -72,9 +69,8 @@ void loadExtended(const unsigned int Fn,const unsigned int *pMem) |
72 | 69 | } |
73 | 70 | |
74 | 71 | static inline |
75 | -void loadMultiple(const unsigned int Fn,const unsigned int *pMem) | |
72 | +void loadMultiple(const unsigned int Fn, target_ulong addr) | |
76 | 73 | { |
77 | - target_ulong addr = (target_ulong)(long)pMem; | |
78 | 74 | FPA11 *fpa11 = GET_FPA11(); |
79 | 75 | register unsigned int *p; |
80 | 76 | unsigned long x; |
... | ... | @@ -108,9 +104,8 @@ void loadMultiple(const unsigned int Fn,const unsigned int *pMem) |
108 | 104 | } |
109 | 105 | |
110 | 106 | static inline |
111 | -void storeSingle(const unsigned int Fn,unsigned int *pMem) | |
107 | +void storeSingle(const unsigned int Fn, target_ulong addr) | |
112 | 108 | { |
113 | - target_ulong addr = (target_ulong)(long)pMem; | |
114 | 109 | FPA11 *fpa11 = GET_FPA11(); |
115 | 110 | float32 val; |
116 | 111 | register unsigned int *p = (unsigned int*)&val; |
... | ... | @@ -133,9 +128,8 @@ void storeSingle(const unsigned int Fn,unsigned int *pMem) |
133 | 128 | } |
134 | 129 | |
135 | 130 | static inline |
136 | -void storeDouble(const unsigned int Fn,unsigned int *pMem) | |
131 | +void storeDouble(const unsigned int Fn, target_ulong addr) | |
137 | 132 | { |
138 | - target_ulong addr = (target_ulong)(long)pMem; | |
139 | 133 | FPA11 *fpa11 = GET_FPA11(); |
140 | 134 | float64 val; |
141 | 135 | register unsigned int *p = (unsigned int*)&val; |
... | ... | @@ -163,9 +157,8 @@ void storeDouble(const unsigned int Fn,unsigned int *pMem) |
163 | 157 | } |
164 | 158 | |
165 | 159 | static inline |
166 | -void storeExtended(const unsigned int Fn,unsigned int *pMem) | |
160 | +void storeExtended(const unsigned int Fn, target_ulong addr) | |
167 | 161 | { |
168 | - target_ulong addr = (target_ulong)(long)pMem; | |
169 | 162 | FPA11 *fpa11 = GET_FPA11(); |
170 | 163 | floatx80 val; |
171 | 164 | register unsigned int *p = (unsigned int*)&val; |
... | ... | @@ -190,9 +183,8 @@ void storeExtended(const unsigned int Fn,unsigned int *pMem) |
190 | 183 | } |
191 | 184 | |
192 | 185 | static inline |
193 | -void storeMultiple(const unsigned int Fn,unsigned int *pMem) | |
186 | +void storeMultiple(const unsigned int Fn, target_ulong addr) | |
194 | 187 | { |
195 | - target_ulong addr = (target_ulong)(long)pMem; | |
196 | 188 | FPA11 *fpa11 = GET_FPA11(); |
197 | 189 | register unsigned int nType, *p; |
198 | 190 | |
... | ... | @@ -220,25 +212,26 @@ void storeMultiple(const unsigned int Fn,unsigned int *pMem) |
220 | 212 | } |
221 | 213 | } |
222 | 214 | |
223 | -unsigned int PerformLDF(const unsigned int opcode) | |
215 | +static unsigned int PerformLDF(const unsigned int opcode) | |
224 | 216 | { |
225 | - unsigned int *pBase, *pAddress, *pFinal, nRc = 1, | |
217 | + target_ulong pBase, pAddress, pFinal; | |
218 | + unsigned int nRc = 1, | |
226 | 219 | write_back = WRITE_BACK(opcode); |
227 | 220 | |
228 | 221 | //printk("PerformLDF(0x%08x), Fd = 0x%08x\n",opcode,getFd(opcode)); |
229 | 222 | |
230 | - pBase = (unsigned int*)readRegister(getRn(opcode)); | |
223 | + pBase = readRegister(getRn(opcode)); | |
231 | 224 | if (REG_PC == getRn(opcode)) |
232 | 225 | { |
233 | - pBase += 2; | |
226 | + pBase += 8; | |
234 | 227 | write_back = 0; |
235 | 228 | } |
236 | 229 | |
237 | 230 | pFinal = pBase; |
238 | 231 | if (BIT_UP_SET(opcode)) |
239 | - pFinal += getOffset(opcode); | |
232 | + pFinal += getOffset(opcode) * 4; | |
240 | 233 | else |
241 | - pFinal -= getOffset(opcode); | |
234 | + pFinal -= getOffset(opcode) * 4; | |
242 | 235 | |
243 | 236 | if (PREINDEXED(opcode)) pAddress = pFinal; else pAddress = pBase; |
244 | 237 | |
... | ... | @@ -254,26 +247,27 @@ unsigned int PerformLDF(const unsigned int opcode) |
254 | 247 | return nRc; |
255 | 248 | } |
256 | 249 | |
257 | -unsigned int PerformSTF(const unsigned int opcode) | |
250 | +static unsigned int PerformSTF(const unsigned int opcode) | |
258 | 251 | { |
259 | - unsigned int *pBase, *pAddress, *pFinal, nRc = 1, | |
252 | + target_ulong pBase, pAddress, pFinal; | |
253 | + unsigned int nRc = 1, | |
260 | 254 | write_back = WRITE_BACK(opcode); |
261 | 255 | |
262 | 256 | //printk("PerformSTF(0x%08x), Fd = 0x%08x\n",opcode,getFd(opcode)); |
263 | 257 | SetRoundingMode(ROUND_TO_NEAREST); |
264 | 258 | |
265 | - pBase = (unsigned int*)readRegister(getRn(opcode)); | |
259 | + pBase = readRegister(getRn(opcode)); | |
266 | 260 | if (REG_PC == getRn(opcode)) |
267 | 261 | { |
268 | - pBase += 2; | |
262 | + pBase += 8; | |
269 | 263 | write_back = 0; |
270 | 264 | } |
271 | 265 | |
272 | 266 | pFinal = pBase; |
273 | 267 | if (BIT_UP_SET(opcode)) |
274 | - pFinal += getOffset(opcode); | |
268 | + pFinal += getOffset(opcode) * 4; | |
275 | 269 | else |
276 | - pFinal -= getOffset(opcode); | |
270 | + pFinal -= getOffset(opcode) * 4; | |
277 | 271 | |
278 | 272 | if (PREINDEXED(opcode)) pAddress = pFinal; else pAddress = pBase; |
279 | 273 | |
... | ... | @@ -289,23 +283,24 @@ unsigned int PerformSTF(const unsigned int opcode) |
289 | 283 | return nRc; |
290 | 284 | } |
291 | 285 | |
292 | -unsigned int PerformLFM(const unsigned int opcode) | |
286 | +static unsigned int PerformLFM(const unsigned int opcode) | |
293 | 287 | { |
294 | - unsigned int i, Fd, *pBase, *pAddress, *pFinal, | |
288 | + unsigned int i, Fd, | |
295 | 289 | write_back = WRITE_BACK(opcode); |
290 | + target_ulong pBase, pAddress, pFinal; | |
296 | 291 | |
297 | - pBase = (unsigned int*)readRegister(getRn(opcode)); | |
292 | + pBase = readRegister(getRn(opcode)); | |
298 | 293 | if (REG_PC == getRn(opcode)) |
299 | 294 | { |
300 | - pBase += 2; | |
295 | + pBase += 8; | |
301 | 296 | write_back = 0; |
302 | 297 | } |
303 | 298 | |
304 | 299 | pFinal = pBase; |
305 | 300 | if (BIT_UP_SET(opcode)) |
306 | - pFinal += getOffset(opcode); | |
301 | + pFinal += getOffset(opcode) * 4; | |
307 | 302 | else |
308 | - pFinal -= getOffset(opcode); | |
303 | + pFinal -= getOffset(opcode) * 4; | |
309 | 304 | |
310 | 305 | if (PREINDEXED(opcode)) pAddress = pFinal; else pAddress = pBase; |
311 | 306 | |
... | ... | @@ -313,7 +308,7 @@ unsigned int PerformLFM(const unsigned int opcode) |
313 | 308 | for (i=getRegisterCount(opcode);i>0;i--) |
314 | 309 | { |
315 | 310 | loadMultiple(Fd,pAddress); |
316 | - pAddress += 3; Fd++; | |
311 | + pAddress += 12; Fd++; | |
317 | 312 | if (Fd == 8) Fd = 0; |
318 | 313 | } |
319 | 314 | |
... | ... | @@ -321,23 +316,24 @@ unsigned int PerformLFM(const unsigned int opcode) |
321 | 316 | return 1; |
322 | 317 | } |
323 | 318 | |
324 | -unsigned int PerformSFM(const unsigned int opcode) | |
319 | +static unsigned int PerformSFM(const unsigned int opcode) | |
325 | 320 | { |
326 | - unsigned int i, Fd, *pBase, *pAddress, *pFinal, | |
321 | + unsigned int i, Fd, | |
327 | 322 | write_back = WRITE_BACK(opcode); |
323 | + target_ulong pBase, pAddress, pFinal; | |
328 | 324 | |
329 | - pBase = (unsigned int*)readRegister(getRn(opcode)); | |
325 | + pBase = readRegister(getRn(opcode)); | |
330 | 326 | if (REG_PC == getRn(opcode)) |
331 | 327 | { |
332 | - pBase += 2; | |
328 | + pBase += 8; | |
333 | 329 | write_back = 0; |
334 | 330 | } |
335 | 331 | |
336 | 332 | pFinal = pBase; |
337 | 333 | if (BIT_UP_SET(opcode)) |
338 | - pFinal += getOffset(opcode); | |
334 | + pFinal += getOffset(opcode) * 4; | |
339 | 335 | else |
340 | - pFinal -= getOffset(opcode); | |
336 | + pFinal -= getOffset(opcode) * 4; | |
341 | 337 | |
342 | 338 | if (PREINDEXED(opcode)) pAddress = pFinal; else pAddress = pBase; |
343 | 339 | |
... | ... | @@ -345,7 +341,7 @@ unsigned int PerformSFM(const unsigned int opcode) |
345 | 341 | for (i=getRegisterCount(opcode);i>0;i--) |
346 | 342 | { |
347 | 343 | storeMultiple(Fd,pAddress); |
348 | - pAddress += 3; Fd++; | |
344 | + pAddress += 12; Fd++; | |
349 | 345 | if (Fd == 8) Fd = 0; |
350 | 346 | } |
351 | 347 | ... | ... |
linux-user/arm/nwfpe/fpopcode.c
... | ... | @@ -59,21 +59,6 @@ const float32 float32Constant[] = { |
59 | 59 | 0x41200000 /* single 10.0 */ |
60 | 60 | }; |
61 | 61 | |
62 | -unsigned int getTransferLength(const unsigned int opcode) | |
63 | -{ | |
64 | - unsigned int nRc; | |
65 | - | |
66 | - switch (opcode & MASK_TRANSFER_LENGTH) | |
67 | - { | |
68 | - case 0x00000000: nRc = 1; break; /* single precision */ | |
69 | - case 0x00008000: nRc = 2; break; /* double precision */ | |
70 | - case 0x00400000: nRc = 3; break; /* extended precision */ | |
71 | - default: nRc = 0; | |
72 | - } | |
73 | - | |
74 | - return(nRc); | |
75 | -} | |
76 | - | |
77 | 62 | unsigned int getRegisterCount(const unsigned int opcode) |
78 | 63 | { |
79 | 64 | unsigned int nRc; |
... | ... | @@ -90,21 +75,6 @@ unsigned int getRegisterCount(const unsigned int opcode) |
90 | 75 | return(nRc); |
91 | 76 | } |
92 | 77 | |
93 | -unsigned int getRoundingPrecision(const unsigned int opcode) | |
94 | -{ | |
95 | - unsigned int nRc; | |
96 | - | |
97 | - switch (opcode & MASK_ROUNDING_PRECISION) | |
98 | - { | |
99 | - case 0x00000000: nRc = 1; break; | |
100 | - case 0x00000080: nRc = 2; break; | |
101 | - case 0x00080000: nRc = 3; break; | |
102 | - default: nRc = 0; | |
103 | - } | |
104 | - | |
105 | - return(nRc); | |
106 | -} | |
107 | - | |
108 | 78 | unsigned int getDestinationSize(const unsigned int opcode) |
109 | 79 | { |
110 | 80 | unsigned int nRc; |
... | ... | @@ -141,8 +111,3 @@ static const unsigned short aCC[16] = { |
141 | 111 | 0xFFFF, // AL always |
142 | 112 | 0 // NV |
143 | 113 | }; |
144 | - | |
145 | -unsigned int checkCondition(const unsigned int opcode, const unsigned int ccodes) | |
146 | -{ | |
147 | - return (aCC[opcode>>28] >> (ccodes>>28)) & 1; | |
148 | -} | ... | ... |