175 return ((jfloat)fmod((double)x,(double)y));
176 JRT_END
177
178
179 JRT_LEAF(jdouble, SharedRuntime::drem(jdouble x, jdouble y))
180 #ifdef _WIN64
181 union { jdouble d; julong l; } xbits, ybits;
182 xbits.d = x;
183 ybits.d = y;
184 // x Mod Infinity == x unless x is infinity
185 if ( ((xbits.l & double_sign_mask) != double_infinity) &&
186 ((ybits.l & double_sign_mask) == double_infinity) ) {
187 return x;
188 }
189 #endif
190 return ((jdouble)fmod((double)x,(double)y));
191 JRT_END
192
193
194 JRT_LEAF(jint, SharedRuntime::f2i(jfloat x))
195 if (g_isnan(x)) {return 0;}
196 jlong lltmp = (jlong)x;
197 jint ltmp = (jint)lltmp;
198 if (ltmp == lltmp) {
199 return ltmp;
200 } else {
201 if (x < 0) {
202 return min_jint;
203 } else {
204 return max_jint;
205 }
206 }
207 JRT_END
208
209
210 JRT_LEAF(jlong, SharedRuntime::f2l(jfloat x))
211 if (g_isnan(x)) {return 0;}
212 jlong lltmp = (jlong)x;
213 if (lltmp != min_jlong) {
214 return lltmp;
215 } else {
216 if (x < 0) {
217 return min_jlong;
218 } else {
219 return max_jlong;
220 }
221 }
222 JRT_END
223
224
225 JRT_LEAF(jint, SharedRuntime::d2i(jdouble x))
226 if (g_isnan(x)) {return 0;}
227 jlong lltmp = (jlong)x;
228 jint ltmp = (jint)lltmp;
229 if (ltmp == lltmp) {
230 return ltmp;
231 } else {
232 if (x < 0) {
233 return min_jint;
234 } else {
235 return max_jint;
236 }
237 }
238 JRT_END
239
240
241 JRT_LEAF(jlong, SharedRuntime::d2l(jdouble x))
242 if (g_isnan(x)) {return 0;}
243 jlong lltmp = (jlong)x;
244 if (lltmp != min_jlong) {
245 return lltmp;
246 } else {
247 if (x < 0) {
248 return min_jlong;
249 } else {
250 return max_jlong;
251 }
252 }
253 JRT_END
254
255
256 JRT_LEAF(jfloat, SharedRuntime::d2f(jdouble x))
257 return (jfloat)x;
258 JRT_END
259
260
261 JRT_LEAF(jfloat, SharedRuntime::l2f(jlong x))
262 return (jfloat)x;
263 JRT_END
264
265
266 JRT_LEAF(jdouble, SharedRuntime::l2d(jlong x))
267 return (jdouble)x;
268 JRT_END
269
270 // Exception handling accross interpreter/compiler boundaries
271 //
272 // exception_handler_for_return_address(...) returns the continuation address.
|
175 return ((jfloat)fmod((double)x,(double)y));
176 JRT_END
177
178
179 JRT_LEAF(jdouble, SharedRuntime::drem(jdouble x, jdouble y))
180 #ifdef _WIN64
181 union { jdouble d; julong l; } xbits, ybits;
182 xbits.d = x;
183 ybits.d = y;
184 // x Mod Infinity == x unless x is infinity
185 if ( ((xbits.l & double_sign_mask) != double_infinity) &&
186 ((ybits.l & double_sign_mask) == double_infinity) ) {
187 return x;
188 }
189 #endif
190 return ((jdouble)fmod((double)x,(double)y));
191 JRT_END
192
193
194 JRT_LEAF(jint, SharedRuntime::f2i(jfloat x))
195 if (g_isnan(x))
196 return 0;
197 if (x >= (jfloat) max_jint)
198 return max_jint;
199 if (x <= (jfloat) min_jint)
200 return min_jint;
201 return (jint) x;
202 JRT_END
203
204
205 JRT_LEAF(jlong, SharedRuntime::f2l(jfloat x))
206 if (g_isnan(x))
207 return 0;
208 if (x >= (jfloat) max_jlong)
209 return max_jlong;
210 if (x <= (jfloat) min_jlong)
211 return min_jlong;
212 return (jlong) x;
213 JRT_END
214
215
216 JRT_LEAF(jint, SharedRuntime::d2i(jdouble x))
217 if (g_isnan(x))
218 return 0;
219 if (x >= (jdouble) max_jint)
220 return max_jint;
221 if (x <= (jdouble) min_jint)
222 return min_jint;
223 return (jint) x;
224 JRT_END
225
226
227 JRT_LEAF(jlong, SharedRuntime::d2l(jdouble x))
228 if (g_isnan(x))
229 return 0;
230 if (x >= (jdouble) max_jlong)
231 return max_jlong;
232 if (x <= (jdouble) min_jlong)
233 return min_jlong;
234 return (jlong) x;
235 JRT_END
236
237
238 JRT_LEAF(jfloat, SharedRuntime::d2f(jdouble x))
239 return (jfloat)x;
240 JRT_END
241
242
243 JRT_LEAF(jfloat, SharedRuntime::l2f(jlong x))
244 return (jfloat)x;
245 JRT_END
246
247
248 JRT_LEAF(jdouble, SharedRuntime::l2d(jlong x))
249 return (jdouble)x;
250 JRT_END
251
252 // Exception handling accross interpreter/compiler boundaries
253 //
254 // exception_handler_for_return_address(...) returns the continuation address.
|