Commit 25bc827cf233dcac309decd095e3f2b6095596f0

Authored by blueswir1
1 parent ddc2db50

Move 128-bit float emulation under linux-user

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4234 c046a42c-6fe2-441c-8c8c-71466251a162
Makefile.target
@@ -432,6 +432,9 @@ endif @@ -432,6 +432,9 @@ endif
432 ifeq ($(TARGET_ARCH), m68k) 432 ifeq ($(TARGET_ARCH), m68k)
433 OBJS+= m68k-sim.o m68k-semi.o 433 OBJS+= m68k-sim.o m68k-semi.o
434 endif 434 endif
  435 +ifeq ($(TARGET_BASE_ARCH), sparc)
  436 +OBJS+= sparc_quad_float.o
  437 +endif
435 438
436 ifdef CONFIG_GDBSTUB 439 ifdef CONFIG_GDBSTUB
437 OBJS+=gdbstub.o 440 OBJS+=gdbstub.o
target-sparc/op_helper.c
@@ -58,21 +58,6 @@ void helper_check_align(target_ulong addr, uint32_t align) @@ -58,21 +58,6 @@ void helper_check_align(target_ulong addr, uint32_t align)
58 58
59 #define F_HELPER(name, p) void helper_f##name##p(void) 59 #define F_HELPER(name, p) void helper_f##name##p(void)
60 60
61 -#if defined(CONFIG_USER_ONLY)  
62 -#define F_BINOP(name) \  
63 - F_HELPER(name, s) \  
64 - { \  
65 - FT0 = float32_ ## name (FT0, FT1, &env->fp_status); \  
66 - } \  
67 - F_HELPER(name, d) \  
68 - { \  
69 - DT0 = float64_ ## name (DT0, DT1, &env->fp_status); \  
70 - } \  
71 - F_HELPER(name, q) \  
72 - { \  
73 - QT0 = float128_ ## name (QT0, QT1, &env->fp_status); \  
74 - }  
75 -#else  
76 #define F_BINOP(name) \ 61 #define F_BINOP(name) \
77 F_HELPER(name, s) \ 62 F_HELPER(name, s) \
78 { \ 63 { \
@@ -82,7 +67,6 @@ void helper_check_align(target_ulong addr, uint32_t align) @@ -82,7 +67,6 @@ void helper_check_align(target_ulong addr, uint32_t align)
82 { \ 67 { \
83 DT0 = float64_ ## name (DT0, DT1, &env->fp_status); \ 68 DT0 = float64_ ## name (DT0, DT1, &env->fp_status); \
84 } 69 }
85 -#endif  
86 70
87 F_BINOP(add); 71 F_BINOP(add);
88 F_BINOP(sub); 72 F_BINOP(sub);
@@ -97,15 +81,6 @@ void helper_fsmuld(void) @@ -97,15 +81,6 @@ void helper_fsmuld(void)
97 &env->fp_status); 81 &env->fp_status);
98 } 82 }
99 83
100 -#if defined(CONFIG_USER_ONLY)  
101 -void helper_fdmulq(void)  
102 -{  
103 - QT0 = float128_mul(float64_to_float128(DT0, &env->fp_status),  
104 - float64_to_float128(DT1, &env->fp_status),  
105 - &env->fp_status);  
106 -}  
107 -#endif  
108 -  
109 F_HELPER(neg, s) 84 F_HELPER(neg, s)
110 { 85 {
111 FT0 = float32_chs(FT1); 86 FT0 = float32_chs(FT1);
@@ -116,13 +91,6 @@ F_HELPER(neg, d) @@ -116,13 +91,6 @@ F_HELPER(neg, d)
116 { 91 {
117 DT0 = float64_chs(DT1); 92 DT0 = float64_chs(DT1);
118 } 93 }
119 -  
120 -#if defined(CONFIG_USER_ONLY)  
121 -F_HELPER(neg, q)  
122 -{  
123 - QT0 = float128_chs(QT1);  
124 -}  
125 -#endif  
126 #endif 94 #endif
127 95
128 /* Integer to float conversion. */ 96 /* Integer to float conversion. */
@@ -136,13 +104,6 @@ F_HELPER(ito, d) @@ -136,13 +104,6 @@ F_HELPER(ito, d)
136 DT0 = int32_to_float64(*((int32_t *)&FT1), &env->fp_status); 104 DT0 = int32_to_float64(*((int32_t *)&FT1), &env->fp_status);
137 } 105 }
138 106
139 -#if defined(CONFIG_USER_ONLY)  
140 -F_HELPER(ito, q)  
141 -{  
142 - QT0 = int32_to_float128(*((int32_t *)&FT1), &env->fp_status);  
143 -}  
144 -#endif  
145 -  
146 #ifdef TARGET_SPARC64 107 #ifdef TARGET_SPARC64
147 F_HELPER(xto, s) 108 F_HELPER(xto, s)
148 { 109 {
@@ -153,12 +114,6 @@ F_HELPER(xto, d) @@ -153,12 +114,6 @@ F_HELPER(xto, d)
153 { 114 {
154 DT0 = int64_to_float64(*((int64_t *)&DT1), &env->fp_status); 115 DT0 = int64_to_float64(*((int64_t *)&DT1), &env->fp_status);
155 } 116 }
156 -#if defined(CONFIG_USER_ONLY)  
157 -F_HELPER(xto, q)  
158 -{  
159 - QT0 = int64_to_float128(*((int64_t *)&DT1), &env->fp_status);  
160 -}  
161 -#endif  
162 #endif 117 #endif
163 #undef F_HELPER 118 #undef F_HELPER
164 119
@@ -173,28 +128,6 @@ void helper_fstod(void) @@ -173,28 +128,6 @@ void helper_fstod(void)
173 DT0 = float32_to_float64(FT1, &env->fp_status); 128 DT0 = float32_to_float64(FT1, &env->fp_status);
174 } 129 }
175 130
176 -#if defined(CONFIG_USER_ONLY)  
177 -void helper_fqtos(void)  
178 -{  
179 - FT0 = float128_to_float32(QT1, &env->fp_status);  
180 -}  
181 -  
182 -void helper_fstoq(void)  
183 -{  
184 - QT0 = float32_to_float128(FT1, &env->fp_status);  
185 -}  
186 -  
187 -void helper_fqtod(void)  
188 -{  
189 - DT0 = float128_to_float64(QT1, &env->fp_status);  
190 -}  
191 -  
192 -void helper_fdtoq(void)  
193 -{  
194 - QT0 = float64_to_float128(DT1, &env->fp_status);  
195 -}  
196 -#endif  
197 -  
198 /* Float to integer conversion. */ 131 /* Float to integer conversion. */
199 void helper_fstoi(void) 132 void helper_fstoi(void)
200 { 133 {
@@ -206,13 +139,6 @@ void helper_fdtoi(void) @@ -206,13 +139,6 @@ void helper_fdtoi(void)
206 *((int32_t *)&FT0) = float64_to_int32_round_to_zero(DT1, &env->fp_status); 139 *((int32_t *)&FT0) = float64_to_int32_round_to_zero(DT1, &env->fp_status);
207 } 140 }
208 141
209 -#if defined(CONFIG_USER_ONLY)  
210 -void helper_fqtoi(void)  
211 -{  
212 - *((int32_t *)&FT0) = float128_to_int32_round_to_zero(QT1, &env->fp_status);  
213 -}  
214 -#endif  
215 -  
216 #ifdef TARGET_SPARC64 142 #ifdef TARGET_SPARC64
217 void helper_fstox(void) 143 void helper_fstox(void)
218 { 144 {
@@ -224,13 +150,6 @@ void helper_fdtox(void) @@ -224,13 +150,6 @@ void helper_fdtox(void)
224 *((int64_t *)&DT0) = float64_to_int64_round_to_zero(DT1, &env->fp_status); 150 *((int64_t *)&DT0) = float64_to_int64_round_to_zero(DT1, &env->fp_status);
225 } 151 }
226 152
227 -#if defined(CONFIG_USER_ONLY)  
228 -void helper_fqtox(void)  
229 -{  
230 - *((int64_t *)&DT0) = float128_to_int64_round_to_zero(QT1, &env->fp_status);  
231 -}  
232 -#endif  
233 -  
234 void helper_faligndata(void) 153 void helper_faligndata(void)
235 { 154 {
236 uint64_t tmp; 155 uint64_t tmp;
@@ -718,13 +637,6 @@ void helper_fabsd(void) @@ -718,13 +637,6 @@ void helper_fabsd(void)
718 { 637 {
719 DT0 = float64_abs(DT1); 638 DT0 = float64_abs(DT1);
720 } 639 }
721 -  
722 -#if defined(CONFIG_USER_ONLY)  
723 -void helper_fabsq(void)  
724 -{  
725 - QT0 = float128_abs(QT1);  
726 -}  
727 -#endif  
728 #endif 640 #endif
729 641
730 void helper_fsqrts(void) 642 void helper_fsqrts(void)
@@ -737,13 +649,6 @@ void helper_fsqrtd(void) @@ -737,13 +649,6 @@ void helper_fsqrtd(void)
737 DT0 = float64_sqrt(DT1, &env->fp_status); 649 DT0 = float64_sqrt(DT1, &env->fp_status);
738 } 650 }
739 651
740 -#if defined(CONFIG_USER_ONLY)  
741 -void helper_fsqrtq(void)  
742 -{  
743 - QT0 = float128_sqrt(QT1, &env->fp_status);  
744 -}  
745 -#endif  
746 -  
747 #define GEN_FCMP(name, size, reg1, reg2, FS, TRAP) \ 652 #define GEN_FCMP(name, size, reg1, reg2, FS, TRAP) \
748 void glue(helper_, name) (void) \ 653 void glue(helper_, name) (void) \
749 { \ 654 { \
@@ -781,11 +686,6 @@ GEN_FCMP(fcmpd, float64, DT0, DT1, 0, 0); @@ -781,11 +686,6 @@ GEN_FCMP(fcmpd, float64, DT0, DT1, 0, 0);
781 GEN_FCMP(fcmpes, float32, FT0, FT1, 0, 1); 686 GEN_FCMP(fcmpes, float32, FT0, FT1, 0, 1);
782 GEN_FCMP(fcmped, float64, DT0, DT1, 0, 1); 687 GEN_FCMP(fcmped, float64, DT0, DT1, 0, 1);
783 688
784 -#ifdef CONFIG_USER_ONLY  
785 -GEN_FCMP(fcmpq, float128, QT0, QT1, 0, 0);  
786 -GEN_FCMP(fcmpeq, float128, QT0, QT1, 0, 1);  
787 -#endif  
788 -  
789 #ifdef TARGET_SPARC64 689 #ifdef TARGET_SPARC64
790 GEN_FCMP(fcmps_fcc1, float32, FT0, FT1, 22, 0); 690 GEN_FCMP(fcmps_fcc1, float32, FT0, FT1, 22, 0);
791 GEN_FCMP(fcmpd_fcc1, float64, DT0, DT1, 22, 0); 691 GEN_FCMP(fcmpd_fcc1, float64, DT0, DT1, 22, 0);
@@ -804,14 +704,6 @@ GEN_FCMP(fcmped_fcc2, float64, DT0, DT1, 24, 1); @@ -804,14 +704,6 @@ GEN_FCMP(fcmped_fcc2, float64, DT0, DT1, 24, 1);
804 704
805 GEN_FCMP(fcmpes_fcc3, float32, FT0, FT1, 26, 1); 705 GEN_FCMP(fcmpes_fcc3, float32, FT0, FT1, 26, 1);
806 GEN_FCMP(fcmped_fcc3, float64, DT0, DT1, 26, 1); 706 GEN_FCMP(fcmped_fcc3, float64, DT0, DT1, 26, 1);
807 -#ifdef CONFIG_USER_ONLY  
808 -GEN_FCMP(fcmpq_fcc1, float128, QT0, QT1, 22, 0);  
809 -GEN_FCMP(fcmpq_fcc2, float128, QT0, QT1, 24, 0);  
810 -GEN_FCMP(fcmpq_fcc3, float128, QT0, QT1, 26, 0);  
811 -GEN_FCMP(fcmpeq_fcc1, float128, QT0, QT1, 22, 1);  
812 -GEN_FCMP(fcmpeq_fcc2, float128, QT0, QT1, 24, 1);  
813 -GEN_FCMP(fcmpeq_fcc3, float128, QT0, QT1, 26, 1);  
814 -#endif  
815 #endif 707 #endif
816 708
817 #if !defined(TARGET_SPARC64) && !defined(CONFIG_USER_ONLY) && defined(DEBUG_MXCC) 709 #if !defined(TARGET_SPARC64) && !defined(CONFIG_USER_ONLY) && defined(DEBUG_MXCC)