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

b/target-arm/nwfpe/fpa11.c
43 43
{
44 44
  int i;
45 45
  FPA11 *fpa11 = GET_FPA11();
46
  
46
 
47 47
  /* initialize the register type array */
48 48
  for (i=0;i<=7;i++)
49 49
  {
50 50
    fpa11->fType[i] = typeNone;
51 51
  }
52
  
52
 
53 53
  /* FPSR: set system id to FP_EMULATOR, set AC, clear all other bits */
54 54
  fpa11->fpsr = FP_EMULATOR | BIT_AC;
55
  
55
 
56 56
  /* FPCR: set SB, AB and DA bits, clear all others */
57 57
#if MAINTAIN_FPCR
58 58
  fpa11->fpcr = MASK_RESET;
......
66 66

  
67 67
#if MAINTAIN_FPCR
68 68
   fpa11->fpcr &= ~MASK_ROUNDING_MODE;
69
#endif   
69
#endif  
70 70
   switch (opcode & MASK_ROUNDING_MODE)
71 71
   {
72 72
      default:
73 73
      case ROUND_TO_NEAREST:
74 74
         rounding_mode = float_round_nearest_even;
75
#if MAINTAIN_FPCR         
75
#if MAINTAIN_FPCR        
76 76
         fpa11->fpcr |= ROUND_TO_NEAREST;
77
#endif         
77
#endif        
78 78
      break;
79
      
79
     
80 80
      case ROUND_TO_PLUS_INFINITY:
81 81
         rounding_mode = float_round_up;
82
#if MAINTAIN_FPCR         
82
#if MAINTAIN_FPCR        
83 83
         fpa11->fpcr |= ROUND_TO_PLUS_INFINITY;
84
#endif         
84
#endif        
85 85
      break;
86
      
86
     
87 87
      case ROUND_TO_MINUS_INFINITY:
88 88
         rounding_mode = float_round_down;
89
#if MAINTAIN_FPCR         
89
#if MAINTAIN_FPCR        
90 90
         fpa11->fpcr |= ROUND_TO_MINUS_INFINITY;
91
#endif         
91
#endif        
92 92
      break;
93
      
93
     
94 94
      case ROUND_TO_ZERO:
95 95
         rounding_mode = float_round_to_zero;
96
#if MAINTAIN_FPCR         
96
#if MAINTAIN_FPCR        
97 97
         fpa11->fpcr |= ROUND_TO_ZERO;
98
#endif         
98
#endif        
99 99
      break;
100 100
  }
101 101
   set_float_rounding_mode(rounding_mode, &fpa11->fp_status);
......
107 107
   FPA11 *fpa11 = GET_FPA11();
108 108
#if MAINTAIN_FPCR
109 109
   fpa11->fpcr &= ~MASK_ROUNDING_PRECISION;
110
#endif   
110
#endif  
111 111
   switch (opcode & MASK_ROUNDING_PRECISION)
112 112
   {
113 113
      case ROUND_SINGLE:
114 114
         rounding_precision = 32;
115
#if MAINTAIN_FPCR         
115
#if MAINTAIN_FPCR        
116 116
         fpa11->fpcr |= ROUND_SINGLE;
117
#endif         
117
#endif        
118 118
      break;
119
      
119
     
120 120
      case ROUND_DOUBLE:
121 121
         rounding_precision = 64;
122
#if MAINTAIN_FPCR         
122
#if MAINTAIN_FPCR        
123 123
         fpa11->fpcr |= ROUND_DOUBLE;
124
#endif         
124
#endif        
125 125
      break;
126
      
126
     
127 127
      case ROUND_EXTENDED:
128 128
         rounding_precision = 80;
129
#if MAINTAIN_FPCR         
129
#if MAINTAIN_FPCR        
130 130
         fpa11->fpcr |= ROUND_EXTENDED;
131
#endif         
131
#endif        
132 132
      break;
133
      
133
     
134 134
      default: rounding_precision = 80;
135 135
  }
136 136
   set_floatx80_rounding_precision(rounding_precision, &fpa11->fp_status);
......
142 142
{
143 143
  unsigned int nRc = 0;
144 144
//  unsigned long flags;
145
  FPA11 *fpa11; 
145
  FPA11 *fpa11;
146 146
//  save_flags(flags); sti();
147 147

  
148 148
  qemufpa=qfpa;
149 149
  user_registers=qregs;
150
  
150
 
151 151
#if 0
152 152
  fprintf(stderr,"emulating FP insn 0x%08x, PC=0x%08x\n",
153 153
          opcode, qregs[REG_PC]);
......
222 222
          }
223 223
      }
224 224
     break;
225
     
226
     case 0xe: 
225
    
226
     case 0xe:
227 227
       if (opcode & 0x10)
228 228
         return EmulateCPDO(opcode);
229 229
       else
230 230
         return EmulateCPRT(opcode);
231 231
     break;
232
  
232
 
233 233
     default: return 0;
234 234
  }
235 235
}

Also available in: Unified diff