/[qemu]/qemu/target-ppc/op.c
ViewVC logotype

Diff of /qemu/target-ppc/op.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by bellard, Sun Nov 23 14:55:54 2003 UTC revision 1.2 by bellard, Sun Nov 23 16:58:08 2003 UTC
# Line 22  Line 22 
22  #include "exec.h"  #include "exec.h"
23    
24  #define regs (env)  #define regs (env)
 extern uint32_t __a;  
 extern uint32_t __b;  
 extern uint32_t __c;  
 extern uint32_t __d;  
 extern uint32_t __e;  
 extern uint32_t __f;  
25  #define Ts0 (int32_t)T0  #define Ts0 (int32_t)T0
26  #define Ts1 (int32_t)T1  #define Ts1 (int32_t)T1
27  #define Ts2 (int32_t)T2  #define Ts2 (int32_t)T2
28    
29  #include "op-multi.c"  #define FT0 (env->ft0)
30    
31  #define PPC_OP(name) void op_##name(void)  #define PPC_OP(name) void op_##name(void)
32    
33    #define REG 0
34    #include "op_template.h"
35    
36    #define REG 1
37    #include "op_template.h"
38    
39    #define REG 2
40    #include "op_template.h"
41    
42    #define REG 3
43    #include "op_template.h"
44    
45    #define REG 4
46    #include "op_template.h"
47    
48    #define REG 5
49    #include "op_template.h"
50    
51    #define REG 6
52    #include "op_template.h"
53    
54    #define REG 7
55    #include "op_template.h"
56    
57    #define REG 8
58    #include "op_template.h"
59    
60    #define REG 9
61    #include "op_template.h"
62    
63    #define REG 10
64    #include "op_template.h"
65    
66    #define REG 11
67    #include "op_template.h"
68    
69    #define REG 12
70    #include "op_template.h"
71    
72    #define REG 13
73    #include "op_template.h"
74    
75    #define REG 14
76    #include "op_template.h"
77    
78    #define REG 15
79    #include "op_template.h"
80    
81    #define REG 16
82    #include "op_template.h"
83    
84    #define REG 17
85    #include "op_template.h"
86    
87    #define REG 18
88    #include "op_template.h"
89    
90    #define REG 19
91    #include "op_template.h"
92    
93    #define REG 20
94    #include "op_template.h"
95    
96    #define REG 21
97    #include "op_template.h"
98    
99    #define REG 22
100    #include "op_template.h"
101    
102    #define REG 23
103    #include "op_template.h"
104    
105    #define REG 24
106    #include "op_template.h"
107    
108    #define REG 25
109    #include "op_template.h"
110    
111    #define REG 26
112    #include "op_template.h"
113    
114    #define REG 27
115    #include "op_template.h"
116    
117    #define REG 28
118    #include "op_template.h"
119    
120    #define REG 29
121    #include "op_template.h"
122    
123    #define REG 30
124    #include "op_template.h"
125    
126    #define REG 31
127    #include "op_template.h"
128    
129  /* PPC state maintenance operations */  /* PPC state maintenance operations */
130  /* set_Rc0 */  /* set_Rc0 */
131  PPC_OP(set_Rc0)  PPC_OP(set_Rc0)
# Line 1114  PPC_OP(stswx) Line 1204  PPC_OP(stswx)
1204      do_stsw(PARAM(1), T0, T1 + T2);      do_stsw(PARAM(1), T0, T1 + T2);
1205      RETURN();      RETURN();
1206  }  }
1207    
1208    /* SPR */
1209    PPC_OP(load_spr)
1210    {
1211        T0 = regs->spr[PARAM(1)];
1212    }
1213    
1214    PPC_OP(store_spr)
1215    {
1216        regs->spr[PARAM(1)] = T0;
1217    }
1218    
1219    /* FPSCR */
1220    PPC_OP(load_fpscr)
1221    {
1222        T0 = do_load_fpscr();
1223    }
1224    
1225    PPC_OP(store_fpscr)
1226    {
1227        do_store_fpscr(PARAM(1), T0);
1228    }
1229    
1230    /***                         Floating-point store                          ***/
1231    
1232    static inline uint32_t dtos(uint64_t f)
1233    {
1234        unsigned int e, m, s;
1235        e = (((f >> 52) & 0x7ff) - 1022) + 126;
1236        s = (f >> 63);
1237        m = (f >> 29);
1238        return (s << 31) | (e << 23) | m;
1239    }
1240    
1241    static inline uint64_t stod(uint32_t f)
1242    {
1243        unsigned int e, m, s;
1244        e = ((f >> 23) & 0xff) - 126 + 1022;
1245        s = f >> 31;
1246        m = f & ((1 << 23) - 1);
1247        return ((uint64_t)s << 63) | ((uint64_t)e << 52) | ((uint64_t)m << 29);
1248    }
1249    
1250    PPC_OP(stfd_z_FT0)
1251    {
1252        st64(SPARAM(1), FT0);
1253    }
1254    
1255    PPC_OP(stfd_FT0)
1256    {
1257        T0 += SPARAM(1);
1258        st64(T0, FT0);
1259    }
1260    
1261    PPC_OP(stfdx_z_FT0)
1262    {
1263        st64(T0, FT0);
1264    }
1265    
1266    PPC_OP(stfdx_FT0)
1267    {
1268        T0 += T1;
1269        st64(T0, FT0);
1270    }
1271    
1272    
1273    PPC_OP(stfs_z_FT0)
1274    {
1275        st32(SPARAM(1), dtos(FT0));
1276    }
1277    
1278    PPC_OP(stfs_FT0)
1279    {
1280        T0 += SPARAM(1);
1281        st32(T0, dtos(FT0));
1282    }
1283    
1284    PPC_OP(stfsx_z_FT0)
1285    {
1286        st32(T0, dtos(FT0));
1287    }
1288    
1289    PPC_OP(stfsx_FT0)
1290    {
1291        T0 += T1;
1292        st32(T0, dtos(FT0));
1293    }
1294    
1295    /***                         Floating-point load                          ***/
1296    PPC_OP(lfd_z_FT0)
1297    {
1298        FT0 = ld64(SPARAM(1));
1299    }
1300    
1301    PPC_OP(lfd_FT0)
1302    {
1303        T0 += SPARAM(1);
1304        FT0 = ld64(T0);
1305    }
1306    
1307    PPC_OP(lfdx_z_FT0)
1308    {
1309        FT0 = ld64(T0);
1310    }
1311    
1312    PPC_OP(lfdx_FT0)
1313    {
1314        T0 += T1;
1315        FT0 = ld64(T0);
1316    }
1317    
1318    PPC_OP(lfs_z_FT0)
1319    {
1320        FT0 = stod(ld32(SPARAM(1)));
1321    }
1322    
1323    PPC_OP(lfs_FT0)
1324    {
1325        T0 += SPARAM(1);
1326        FT0 = stod(ld32(T0));
1327    }
1328    
1329    PPC_OP(lfsx_z_FT0)
1330    {
1331        FT0 = stod(ld32(T0));
1332    }
1333    
1334    PPC_OP(lfsx_FT0)
1335    {
1336        T0 += T1;
1337        FT0 = stod(ld32(T0));
1338    }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26