Commit a0c4cb4a7026977266d08d3e6af27d4dd04ed1e4

Authored by bellard
1 parent 188d8579

sparc fixes


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1117 c046a42c-6fe2-441c-8c8c-71466251a162
target-sparc/exec.h
@@ -25,6 +25,8 @@ void helper_st_asi(int asi, int size, int sign); @@ -25,6 +25,8 @@ void helper_st_asi(int asi, int size, int sign);
25 void helper_rett(void); 25 void helper_rett(void);
26 void helper_ldfsr(void); 26 void helper_ldfsr(void);
27 void set_cwp(int new_cwp); 27 void set_cwp(int new_cwp);
  28 +void do_fitos(void);
  29 +void do_fitod(void);
28 void do_fabss(void); 30 void do_fabss(void);
29 void do_fsqrts(void); 31 void do_fsqrts(void);
30 void do_fsqrtd(void); 32 void do_fsqrtd(void);
target-sparc/op.c
@@ -932,20 +932,32 @@ void OPPROTO op_fcmpd(void) @@ -932,20 +932,32 @@ void OPPROTO op_fcmpd(void)
932 do_fcmpd(); 932 do_fcmpd();
933 } 933 }
934 934
  935 +#ifdef USE_INT_TO_FLOAT_HELPERS
935 void OPPROTO op_fitos(void) 936 void OPPROTO op_fitos(void)
936 { 937 {
937 - FT0 = (float) *((int32_t *)&FT1); 938 + do_fitos();
938 } 939 }
939 940
940 -void OPPROTO op_fdtos(void) 941 +void OPPROTO op_fitod(void)
941 { 942 {
942 - FT0 = (float) DT1; 943 + do_fitod();
  944 +}
  945 +#else
  946 +void OPPROTO op_fitos(void)
  947 +{
  948 + FT0 = (float) *((int32_t *)&FT1);
943 } 949 }
944 950
945 void OPPROTO op_fitod(void) 951 void OPPROTO op_fitod(void)
946 { 952 {
947 DT0 = (double) *((int32_t *)&FT1); 953 DT0 = (double) *((int32_t *)&FT1);
948 } 954 }
  955 +#endif
  956 +
  957 +void OPPROTO op_fdtos(void)
  958 +{
  959 + FT0 = (float) DT1;
  960 +}
949 961
950 void OPPROTO op_fstod(void) 962 void OPPROTO op_fstod(void)
951 { 963 {
target-sparc/op_helper.c
@@ -2,22 +2,34 @@ @@ -2,22 +2,34 @@
2 #include <fenv.h> 2 #include <fenv.h>
3 #include "exec.h" 3 #include "exec.h"
4 4
5 -void OPPROTO do_fabss(void) 5 +#ifdef USE_INT_TO_FLOAT_HELPERS
  6 +void do_fitos(void)
  7 +{
  8 + FT0 = (float) *((int32_t *)&FT1);
  9 +}
  10 +
  11 +void do_fitod(void)
  12 +{
  13 + DT0 = (double) *((int32_t *)&FT1);
  14 +}
  15 +#endif
  16 +
  17 +void do_fabss(void)
6 { 18 {
7 FT0 = fabsf(FT1); 19 FT0 = fabsf(FT1);
8 } 20 }
9 21
10 -void OPPROTO do_fsqrts(void) 22 +void do_fsqrts(void)
11 { 23 {
12 FT0 = sqrtf(FT1); 24 FT0 = sqrtf(FT1);
13 } 25 }
14 26
15 -void OPPROTO do_fsqrtd(void) 27 +void do_fsqrtd(void)
16 { 28 {
17 DT0 = sqrt(DT1); 29 DT0 = sqrt(DT1);
18 } 30 }
19 31
20 -void OPPROTO do_fcmps (void) 32 +void do_fcmps (void)
21 { 33 {
22 if (isnan(FT0) || isnan(FT1)) { 34 if (isnan(FT0) || isnan(FT1)) {
23 T0 = FSR_FCC1 | FSR_FCC0; 35 T0 = FSR_FCC1 | FSR_FCC0;
@@ -31,7 +43,7 @@ void OPPROTO do_fcmps (void) @@ -31,7 +43,7 @@ void OPPROTO do_fcmps (void)
31 env->fsr = T0; 43 env->fsr = T0;
32 } 44 }
33 45
34 -void OPPROTO do_fcmpd (void) 46 +void do_fcmpd (void)
35 { 47 {
36 if (isnan(DT0) || isnan(DT1)) { 48 if (isnan(DT0) || isnan(DT1)) {
37 T0 = FSR_FCC1 | FSR_FCC0; 49 T0 = FSR_FCC1 | FSR_FCC0;
@@ -45,7 +57,7 @@ void OPPROTO do_fcmpd (void) @@ -45,7 +57,7 @@ void OPPROTO do_fcmpd (void)
45 env->fsr = T0; 57 env->fsr = T0;
46 } 58 }
47 59
48 -void OPPROTO helper_ld_asi(int asi, int size, int sign) 60 +void helper_ld_asi(int asi, int size, int sign)
49 { 61 {
50 switch(asi) { 62 switch(asi) {
51 case 3: /* MMU probe */ 63 case 3: /* MMU probe */
@@ -76,7 +88,7 @@ void OPPROTO helper_ld_asi(int asi, int size, int sign) @@ -76,7 +88,7 @@ void OPPROTO helper_ld_asi(int asi, int size, int sign)
76 } 88 }
77 } 89 }
78 90
79 -void OPPROTO helper_st_asi(int asi, int size, int sign) 91 +void helper_st_asi(int asi, int size, int sign)
80 { 92 {
81 switch(asi) { 93 switch(asi) {
82 case 3: /* MMU flush */ 94 case 3: /* MMU flush */
@@ -125,7 +137,7 @@ void do_ldd_kernel(uint32_t addr) @@ -125,7 +137,7 @@ void do_ldd_kernel(uint32_t addr)
125 #endif 137 #endif
126 #endif 138 #endif
127 139
128 -void OPPROTO helper_rett() 140 +void helper_rett()
129 { 141 {
130 int cwp; 142 int cwp;
131 env->psret = 1; 143 env->psret = 1;
target-sparc/translate.c
@@ -291,7 +291,10 @@ GEN32(gen_op_store_DT2_fpr, gen_op_store_DT2_fpr_fprf); @@ -291,7 +291,10 @@ GEN32(gen_op_store_DT2_fpr, gen_op_store_DT2_fpr_fprf);
291 291
292 #if defined(CONFIG_USER_ONLY) 292 #if defined(CONFIG_USER_ONLY)
293 #define gen_op_ldst(name) gen_op_##name##_raw() 293 #define gen_op_ldst(name) gen_op_##name##_raw()
294 -#define OP_LD_TABLE(width) 294 +#define OP_LD_TABLE(width) \
  295 +static void gen_op_##width##a(int insn, int is_ld, int size, int sign) \
  296 +{ \
  297 +}
295 #define supervisor(dc) 0 298 #define supervisor(dc) 0
296 #else 299 #else
297 #define gen_op_ldst(name) (*gen_op_##name[dc->mem_idx])() 300 #define gen_op_ldst(name) (*gen_op_##name[dc->mem_idx])()