Revision 5fafdf24 target-arm/nwfpe/fpa11_cpdt.c

b/target-arm/nwfpe/fpa11_cpdt.c
52 52
   p[0] = tget32(addr + 4);
53 53
   p[1] = tget32(addr); /* sign & exponent */
54 54
#endif
55
}   
55
}  
56 56

  
57 57
static inline
58 58
void loadExtended(const unsigned int Fn,const unsigned int *pMem)
......
65 65
   p[0] = tget32(addr);  /* sign & exponent */
66 66
   p[1] = tget32(addr + 8);  /* ls bits */
67 67
   p[2] = tget32(addr + 4);  /* ms bits */
68
}   
68
}  
69 69

  
70 70
static inline
71 71
void loadMultiple(const unsigned int Fn,const unsigned int *pMem)
......
78 78
   p = (unsigned int*)&(fpa11->fpreg[Fn]);
79 79
   x = tget32(addr);
80 80
   fpa11->fType[Fn] = (x >> 14) & 0x00000003;
81
   
81
  
82 82
   switch (fpa11->fType[Fn])
83 83
   {
84 84
      case typeSingle:
......
88 88
         p[1] = tget32(addr + 4);  /* double msw */
89 89
         p[2] = 0;        /* empty */
90 90
      }
91
      break; 
92
   
91
      break;
92
  
93 93
      case typeExtended:
94 94
      {
95 95
         p[1] = tget32(addr + 8);
96 96
         p[2] = tget32(addr + 4);  /* msw */
97
         p[0] = (x & 0x80003fff);      
97
         p[0] = (x & 0x80003fff);     
98 98
      }
99 99
      break;
100 100
   }
......
107 107
   FPA11 *fpa11 = GET_FPA11();
108 108
   float32 val;
109 109
   register unsigned int *p = (unsigned int*)&val;
110
   
110
  
111 111
   switch (fpa11->fType[Fn])
112 112
   {
113
      case typeDouble: 
113
      case typeDouble:
114 114
         val = float64_to_float32(fpa11->fpreg[Fn].fDouble, &fpa11->fp_status);
115 115
      break;
116 116

  
117
      case typeExtended: 
117
      case typeExtended:
118 118
         val = floatx80_to_float32(fpa11->fpreg[Fn].fExtended, &fpa11->fp_status);
119 119
      break;
120 120

  
121 121
      default: val = fpa11->fpreg[Fn].fSingle;
122 122
   }
123
  
123
 
124 124
   tput32(addr, p[0]);
125
}   
125
}  
126 126

  
127 127
static inline
128 128
void storeDouble(const unsigned int Fn,unsigned int *pMem)
......
134 134

  
135 135
   switch (fpa11->fType[Fn])
136 136
   {
137
      case typeSingle: 
137
      case typeSingle:
138 138
         val = float32_to_float64(fpa11->fpreg[Fn].fSingle, &fpa11->fp_status);
139 139
      break;
140 140

  
......
151 151
   tput32(addr, p[1]);	/* msw */
152 152
   tput32(addr + 4, p[0]);	/* lsw */
153 153
#endif
154
}   
154
}  
155 155

  
156 156
static inline
157 157
void storeExtended(const unsigned int Fn,unsigned int *pMem)
......
160 160
   FPA11 *fpa11 = GET_FPA11();
161 161
   floatx80 val;
162 162
   register unsigned int *p = (unsigned int*)&val;
163
   
163
  
164 164
   switch (fpa11->fType[Fn])
165 165
   {
166
      case typeSingle: 
166
      case typeSingle:
167 167
         val = float32_to_floatx80(fpa11->fpreg[Fn].fSingle, &fpa11->fp_status);
168 168
      break;
169 169

  
170
      case typeDouble: 
170
      case typeDouble:
171 171
         val = float64_to_floatx80(fpa11->fpreg[Fn].fDouble, &fpa11->fp_status);
172 172
      break;
173 173

  
174 174
      default: val = fpa11->fpreg[Fn].fExtended;
175 175
   }
176
   
176
  
177 177
   tput32(addr, p[0]); /* sign & exp */
178 178
   tput32(addr + 8, p[1]);
179 179
   tput32(addr + 4, p[2]); /* msw */
180
}   
180
}  
181 181

  
182 182
static inline
183 183
void storeMultiple(const unsigned int Fn,unsigned int *pMem)
......
185 185
   target_ulong addr = (target_ulong)(long)pMem;
186 186
   FPA11 *fpa11 = GET_FPA11();
187 187
   register unsigned int nType, *p;
188
   
188
  
189 189
   p = (unsigned int*)&(fpa11->fpreg[Fn]);
190 190
   nType = fpa11->fType[Fn];
191
   
191
  
192 192
   switch (nType)
193 193
   {
194 194
      case typeSingle:
......
198 198
	 tput32(addr + 4, p[1]); /* double msw */
199 199
	 tput32(addr, nType << 14);
200 200
      }
201
      break; 
202
   
201
      break;
202
  
203 203
      case typeExtended:
204 204
      {
205 205
	 tput32(addr + 4, p[2]); /* msw */
......
239 239
      case TRANSFER_EXTENDED: loadExtended(getFd(opcode),pAddress); break;
240 240
      default: nRc = 0;
241 241
   }
242
   
242
  
243 243
   if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal);
244 244
   return nRc;
245 245
}
......
248 248
{
249 249
   unsigned int *pBase, *pAddress, *pFinal, nRc = 1,
250 250
     write_back = WRITE_BACK(opcode);
251
   
251
  
252 252
   //printk("PerformSTF(0x%08x), Fd = 0x%08x\n",opcode,getFd(opcode));
253 253
   SetRoundingMode(ROUND_TO_NEAREST);
254
   
254
  
255 255
   pBase = (unsigned int*)readRegister(getRn(opcode));
256 256
   if (REG_PC == getRn(opcode))
257 257
   {
......
274 274
      case TRANSFER_EXTENDED: storeExtended(getFd(opcode),pAddress); break;
275 275
      default: nRc = 0;
276 276
   }
277
   
277
  
278 278
   if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal);
279 279
   return nRc;
280 280
}
......
315 315
{
316 316
   unsigned int i, Fd, *pBase, *pAddress, *pFinal,
317 317
     write_back = WRITE_BACK(opcode);
318
   
318
  
319 319
   pBase = (unsigned int*)readRegister(getRn(opcode));
320 320
   if (REG_PC == getRn(opcode))
321 321
   {
322 322
     pBase += 2;
323 323
     write_back = 0;
324 324
   }
325
   
325
  
326 326
   pFinal = pBase;
327 327
   if (BIT_UP_SET(opcode))
328 328
     pFinal += getOffset(opcode);
......
349 349
  unsigned int nRc = 0;
350 350

  
351 351
  //printk("EmulateCPDT(0x%08x)\n",opcode);
352
  
352
 
353 353
  if (LDF_OP(opcode))
354 354
  {
355 355
    nRc = PerformLDF(opcode);
......
361 361
  else if (STF_OP(opcode))
362 362
  {
363 363
    nRc = PerformSTF(opcode);
364
  } 
364
  }
365 365
  else if (SFM_OP(opcode))
366 366
  {
367 367
    nRc = PerformSFM(opcode);
......
370 370
  {
371 371
    nRc = 0;
372 372
  }
373
  
373
 
374 374
  return nRc;
375 375
}
376 376
#endif

Also available in: Unified diff