File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -113,12 +113,33 @@ typedef union {
113
113
static __inline void
114
114
x87_push (double i )
115
115
{
116
+ #ifdef X87_INLINE_ASM
117
+ unsigned char buffer [10 ];
118
+ #else
119
+ x87_conv_t test ;
120
+ #endif
116
121
#ifdef USE_NEW_DYNAREC
117
122
cpu_state .TOP -- ;
118
123
#else
119
124
cpu_state .TOP = (cpu_state .TOP - 1 ) & 7 ;
120
125
#endif
121
126
cpu_state .ST [cpu_state .TOP & 7 ] = i ;
127
+
128
+ #ifdef X87_INLINE_ASM
129
+ __asm volatile (""
130
+ :
131
+ :
132
+ : "memory" );
133
+
134
+ __asm volatile ("fldl %1\n"
135
+ "fstpt %0\n" : "=m" (buffer ) : "m" (i ));
136
+
137
+ cpu_state .MM [cpu_state .TOP & 7 ].q = (* (uint64_t * )buffer );
138
+ #else
139
+ x87_to80 (i , & test );
140
+ cpu_state .MM [cpu_state .TOP & 7 ].q = test .eind .ll ;
141
+ #endif
142
+
122
143
#ifdef USE_NEW_DYNAREC
123
144
cpu_state .tag [cpu_state .TOP & 7 ] = TAG_VALID ;
124
145
#else
@@ -129,6 +150,11 @@ x87_push(double i)
129
150
static __inline void
130
151
x87_push_u64 (uint64_t i )
131
152
{
153
+ #ifdef X87_INLINE_ASM
154
+ unsigned char buffer [10 ];
155
+ #else
156
+ x87_conv_t test ;
157
+ #endif
132
158
union {
133
159
double d ;
134
160
uint64_t ll ;
@@ -142,6 +168,21 @@ x87_push_u64(uint64_t i)
142
168
cpu_state .TOP = (cpu_state .TOP - 1 ) & 7 ;
143
169
#endif
144
170
cpu_state .ST [cpu_state .TOP & 7 ] = td .d ;
171
+
172
+ #ifdef X87_INLINE_ASM
173
+ __asm volatile (""
174
+ :
175
+ :
176
+ : "memory" );
177
+
178
+ __asm volatile ("fldl %1\n"
179
+ "fstpt %0\n" : "=m" (buffer ) : "m" (td .d ));
180
+
181
+ cpu_state .MM [cpu_state .TOP & 7 ].q = (* (uint64_t * )buffer );
182
+ #else
183
+ x87_to80 (td .d , & test );
184
+ cpu_state .MM [cpu_state .TOP & 7 ].q = test .eind .ll ;
185
+ #endif
145
186
#ifdef USE_NEW_DYNAREC
146
187
cpu_state .tag [cpu_state .TOP & 7 ] = TAG_VALID ;
147
188
#else
You can’t perform that action at this time.
0 commit comments