2 * S/390 FPU helper routines
4 * Copyright (c) 2009 Ulrich Hecht
5 * Copyright (c) 2009 Alexander Graf
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
22 #include "exec/cpu_ldst.h"
23 #include "exec/helper-proto.h"
25 /* #define DEBUG_HELPER */
27 #define HELPER_LOG(x...) qemu_log(x)
29 #define HELPER_LOG(x...)
32 #define RET128(F) (env->retxl = F.low, F.high)
34 #define convert_bit(mask, from, to) \
36 ? (mask / (from / to)) & to \
37 : (mask & from) * (to / from))
39 static void ieee_exception(CPUS390XState
*env
, uint32_t dxc
, uintptr_t retaddr
)
41 /* Install the DXC code. */
42 env
->fpc
= (env
->fpc
& ~0xff00) | (dxc
<< 8);
44 runtime_exception(env
, PGM_DATA
, retaddr
);
47 /* Should be called after any operation that may raise IEEE exceptions. */
48 static void handle_exceptions(CPUS390XState
*env
, uintptr_t retaddr
)
50 unsigned s390_exc
, qemu_exc
;
52 /* Get the exceptions raised by the current operation. Reset the
53 fpu_status contents so that the next operation has a clean slate. */
54 qemu_exc
= env
->fpu_status
.float_exception_flags
;
58 env
->fpu_status
.float_exception_flags
= 0;
60 /* Convert softfloat exception bits to s390 exception bits. */
62 s390_exc
|= convert_bit(qemu_exc
, float_flag_invalid
, 0x80);
63 s390_exc
|= convert_bit(qemu_exc
, float_flag_divbyzero
, 0x40);
64 s390_exc
|= convert_bit(qemu_exc
, float_flag_overflow
, 0x20);
65 s390_exc
|= convert_bit(qemu_exc
, float_flag_underflow
, 0x10);
66 s390_exc
|= convert_bit(qemu_exc
, float_flag_inexact
, 0x08);
68 /* Install the exceptions that we raised. */
69 env
->fpc
|= s390_exc
<< 16;
71 /* Send signals for enabled exceptions. */
72 s390_exc
&= env
->fpc
>> 24;
74 ieee_exception(env
, s390_exc
, retaddr
);
78 static inline int float_comp_to_cc(CPUS390XState
*env
, int float_compare
)
80 S390CPU
*cpu
= s390_env_get_cpu(env
);
82 switch (float_compare
) {
83 case float_relation_equal
:
85 case float_relation_less
:
87 case float_relation_greater
:
89 case float_relation_unordered
:
92 cpu_abort(CPU(cpu
), "unknown return value for float compare\n");
96 /* condition codes for unary FP ops */
97 uint32_t set_cc_nz_f32(float32 v
)
99 if (float32_is_any_nan(v
)) {
101 } else if (float32_is_zero(v
)) {
103 } else if (float32_is_neg(v
)) {
110 uint32_t set_cc_nz_f64(float64 v
)
112 if (float64_is_any_nan(v
)) {
114 } else if (float64_is_zero(v
)) {
116 } else if (float64_is_neg(v
)) {
123 uint32_t set_cc_nz_f128(float128 v
)
125 if (float128_is_any_nan(v
)) {
127 } else if (float128_is_zero(v
)) {
129 } else if (float128_is_neg(v
)) {
136 /* 32-bit FP addition */
137 uint64_t HELPER(aeb
)(CPUS390XState
*env
, uint64_t f1
, uint64_t f2
)
139 float32 ret
= float32_add(f1
, f2
, &env
->fpu_status
);
140 handle_exceptions(env
, GETPC());
144 /* 64-bit FP addition */
145 uint64_t HELPER(adb
)(CPUS390XState
*env
, uint64_t f1
, uint64_t f2
)
147 float64 ret
= float64_add(f1
, f2
, &env
->fpu_status
);
148 handle_exceptions(env
, GETPC());
152 /* 128-bit FP addition */
153 uint64_t HELPER(axb
)(CPUS390XState
*env
, uint64_t ah
, uint64_t al
,
154 uint64_t bh
, uint64_t bl
)
156 float128 ret
= float128_add(make_float128(ah
, al
),
157 make_float128(bh
, bl
),
159 handle_exceptions(env
, GETPC());
163 /* 32-bit FP subtraction */
164 uint64_t HELPER(seb
)(CPUS390XState
*env
, uint64_t f1
, uint64_t f2
)
166 float32 ret
= float32_sub(f1
, f2
, &env
->fpu_status
);
167 handle_exceptions(env
, GETPC());
171 /* 64-bit FP subtraction */
172 uint64_t HELPER(sdb
)(CPUS390XState
*env
, uint64_t f1
, uint64_t f2
)
174 float64 ret
= float64_sub(f1
, f2
, &env
->fpu_status
);
175 handle_exceptions(env
, GETPC());
179 /* 128-bit FP subtraction */
180 uint64_t HELPER(sxb
)(CPUS390XState
*env
, uint64_t ah
, uint64_t al
,
181 uint64_t bh
, uint64_t bl
)
183 float128 ret
= float128_sub(make_float128(ah
, al
),
184 make_float128(bh
, bl
),
186 handle_exceptions(env
, GETPC());
190 /* 32-bit FP division */
191 uint64_t HELPER(deb
)(CPUS390XState
*env
, uint64_t f1
, uint64_t f2
)
193 float32 ret
= float32_div(f1
, f2
, &env
->fpu_status
);
194 handle_exceptions(env
, GETPC());
198 /* 64-bit FP division */
199 uint64_t HELPER(ddb
)(CPUS390XState
*env
, uint64_t f1
, uint64_t f2
)
201 float64 ret
= float64_div(f1
, f2
, &env
->fpu_status
);
202 handle_exceptions(env
, GETPC());
206 /* 128-bit FP division */
207 uint64_t HELPER(dxb
)(CPUS390XState
*env
, uint64_t ah
, uint64_t al
,
208 uint64_t bh
, uint64_t bl
)
210 float128 ret
= float128_div(make_float128(ah
, al
),
211 make_float128(bh
, bl
),
213 handle_exceptions(env
, GETPC());
217 /* 32-bit FP multiplication */
218 uint64_t HELPER(meeb
)(CPUS390XState
*env
, uint64_t f1
, uint64_t f2
)
220 float32 ret
= float32_mul(f1
, f2
, &env
->fpu_status
);
221 handle_exceptions(env
, GETPC());
225 /* 64-bit FP multiplication */
226 uint64_t HELPER(mdb
)(CPUS390XState
*env
, uint64_t f1
, uint64_t f2
)
228 float64 ret
= float64_mul(f1
, f2
, &env
->fpu_status
);
229 handle_exceptions(env
, GETPC());
233 /* 64/32-bit FP multiplication */
234 uint64_t HELPER(mdeb
)(CPUS390XState
*env
, uint64_t f1
, uint64_t f2
)
236 float64 ret
= float32_to_float64(f2
, &env
->fpu_status
);
237 ret
= float64_mul(f1
, ret
, &env
->fpu_status
);
238 handle_exceptions(env
, GETPC());
242 /* 128-bit FP multiplication */
243 uint64_t HELPER(mxb
)(CPUS390XState
*env
, uint64_t ah
, uint64_t al
,
244 uint64_t bh
, uint64_t bl
)
246 float128 ret
= float128_mul(make_float128(ah
, al
),
247 make_float128(bh
, bl
),
249 handle_exceptions(env
, GETPC());
253 /* 128/64-bit FP multiplication */
254 uint64_t HELPER(mxdb
)(CPUS390XState
*env
, uint64_t ah
, uint64_t al
,
257 float128 ret
= float64_to_float128(f2
, &env
->fpu_status
);
258 ret
= float128_mul(make_float128(ah
, al
), ret
, &env
->fpu_status
);
259 handle_exceptions(env
, GETPC());
263 /* convert 32-bit float to 64-bit float */
264 uint64_t HELPER(ldeb
)(CPUS390XState
*env
, uint64_t f2
)
266 float64 ret
= float32_to_float64(f2
, &env
->fpu_status
);
267 handle_exceptions(env
, GETPC());
271 /* convert 128-bit float to 64-bit float */
272 uint64_t HELPER(ldxb
)(CPUS390XState
*env
, uint64_t ah
, uint64_t al
)
274 float64 ret
= float128_to_float64(make_float128(ah
, al
), &env
->fpu_status
);
275 handle_exceptions(env
, GETPC());
279 /* convert 64-bit float to 128-bit float */
280 uint64_t HELPER(lxdb
)(CPUS390XState
*env
, uint64_t f2
)
282 float128 ret
= float64_to_float128(f2
, &env
->fpu_status
);
283 handle_exceptions(env
, GETPC());
287 /* convert 32-bit float to 128-bit float */
288 uint64_t HELPER(lxeb
)(CPUS390XState
*env
, uint64_t f2
)
290 float128 ret
= float32_to_float128(f2
, &env
->fpu_status
);
291 handle_exceptions(env
, GETPC());
295 /* convert 64-bit float to 32-bit float */
296 uint64_t HELPER(ledb
)(CPUS390XState
*env
, uint64_t f2
)
298 float32 ret
= float64_to_float32(f2
, &env
->fpu_status
);
299 handle_exceptions(env
, GETPC());
303 /* convert 128-bit float to 32-bit float */
304 uint64_t HELPER(lexb
)(CPUS390XState
*env
, uint64_t ah
, uint64_t al
)
306 float32 ret
= float128_to_float32(make_float128(ah
, al
), &env
->fpu_status
);
307 handle_exceptions(env
, GETPC());
311 /* 32-bit FP compare */
312 uint32_t HELPER(ceb
)(CPUS390XState
*env
, uint64_t f1
, uint64_t f2
)
314 int cmp
= float32_compare_quiet(f1
, f2
, &env
->fpu_status
);
315 handle_exceptions(env
, GETPC());
316 return float_comp_to_cc(env
, cmp
);
319 /* 64-bit FP compare */
320 uint32_t HELPER(cdb
)(CPUS390XState
*env
, uint64_t f1
, uint64_t f2
)
322 int cmp
= float64_compare_quiet(f1
, f2
, &env
->fpu_status
);
323 handle_exceptions(env
, GETPC());
324 return float_comp_to_cc(env
, cmp
);
327 /* 128-bit FP compare */
328 uint32_t HELPER(cxb
)(CPUS390XState
*env
, uint64_t ah
, uint64_t al
,
329 uint64_t bh
, uint64_t bl
)
331 int cmp
= float128_compare_quiet(make_float128(ah
, al
),
332 make_float128(bh
, bl
),
334 handle_exceptions(env
, GETPC());
335 return float_comp_to_cc(env
, cmp
);
338 static int swap_round_mode(CPUS390XState
*env
, int m3
)
340 int ret
= env
->fpu_status
.float_rounding_mode
;
346 /* biased round no nearest */
348 /* round to nearest */
349 set_float_rounding_mode(float_round_nearest_even
, &env
->fpu_status
);
353 set_float_rounding_mode(float_round_to_zero
, &env
->fpu_status
);
357 set_float_rounding_mode(float_round_up
, &env
->fpu_status
);
361 set_float_rounding_mode(float_round_down
, &env
->fpu_status
);
367 /* convert 64-bit int to 32-bit float */
368 uint64_t HELPER(cegb
)(CPUS390XState
*env
, int64_t v2
, uint32_t m3
)
370 int hold
= swap_round_mode(env
, m3
);
371 float32 ret
= int64_to_float32(v2
, &env
->fpu_status
);
372 set_float_rounding_mode(hold
, &env
->fpu_status
);
373 handle_exceptions(env
, GETPC());
377 /* convert 64-bit int to 64-bit float */
378 uint64_t HELPER(cdgb
)(CPUS390XState
*env
, int64_t v2
, uint32_t m3
)
380 int hold
= swap_round_mode(env
, m3
);
381 float64 ret
= int64_to_float64(v2
, &env
->fpu_status
);
382 set_float_rounding_mode(hold
, &env
->fpu_status
);
383 handle_exceptions(env
, GETPC());
387 /* convert 64-bit int to 128-bit float */
388 uint64_t HELPER(cxgb
)(CPUS390XState
*env
, int64_t v2
, uint32_t m3
)
390 int hold
= swap_round_mode(env
, m3
);
391 float128 ret
= int64_to_float128(v2
, &env
->fpu_status
);
392 set_float_rounding_mode(hold
, &env
->fpu_status
);
393 handle_exceptions(env
, GETPC());
397 /* convert 64-bit uint to 32-bit float */
398 uint64_t HELPER(celgb
)(CPUS390XState
*env
, uint64_t v2
, uint32_t m3
)
400 int hold
= swap_round_mode(env
, m3
);
401 float32 ret
= uint64_to_float32(v2
, &env
->fpu_status
);
402 set_float_rounding_mode(hold
, &env
->fpu_status
);
403 handle_exceptions(env
, GETPC());
407 /* convert 64-bit uint to 64-bit float */
408 uint64_t HELPER(cdlgb
)(CPUS390XState
*env
, uint64_t v2
, uint32_t m3
)
410 int hold
= swap_round_mode(env
, m3
);
411 float64 ret
= uint64_to_float64(v2
, &env
->fpu_status
);
412 set_float_rounding_mode(hold
, &env
->fpu_status
);
413 handle_exceptions(env
, GETPC());
417 /* convert 64-bit uint to 128-bit float */
418 uint64_t HELPER(cxlgb
)(CPUS390XState
*env
, uint64_t v2
, uint32_t m3
)
420 int hold
= swap_round_mode(env
, m3
);
421 float128 ret
= uint64_to_float128(v2
, &env
->fpu_status
);
422 set_float_rounding_mode(hold
, &env
->fpu_status
);
423 handle_exceptions(env
, GETPC());
427 /* convert 32-bit float to 64-bit int */
428 uint64_t HELPER(cgeb
)(CPUS390XState
*env
, uint64_t v2
, uint32_t m3
)
430 int hold
= swap_round_mode(env
, m3
);
431 int64_t ret
= float32_to_int64(v2
, &env
->fpu_status
);
432 set_float_rounding_mode(hold
, &env
->fpu_status
);
433 handle_exceptions(env
, GETPC());
437 /* convert 64-bit float to 64-bit int */
438 uint64_t HELPER(cgdb
)(CPUS390XState
*env
, uint64_t v2
, uint32_t m3
)
440 int hold
= swap_round_mode(env
, m3
);
441 int64_t ret
= float64_to_int64(v2
, &env
->fpu_status
);
442 set_float_rounding_mode(hold
, &env
->fpu_status
);
443 handle_exceptions(env
, GETPC());
447 /* convert 128-bit float to 64-bit int */
448 uint64_t HELPER(cgxb
)(CPUS390XState
*env
, uint64_t h
, uint64_t l
, uint32_t m3
)
450 int hold
= swap_round_mode(env
, m3
);
451 float128 v2
= make_float128(h
, l
);
452 int64_t ret
= float128_to_int64(v2
, &env
->fpu_status
);
453 set_float_rounding_mode(hold
, &env
->fpu_status
);
454 handle_exceptions(env
, GETPC());
458 /* convert 32-bit float to 32-bit int */
459 uint64_t HELPER(cfeb
)(CPUS390XState
*env
, uint64_t v2
, uint32_t m3
)
461 int hold
= swap_round_mode(env
, m3
);
462 int32_t ret
= float32_to_int32(v2
, &env
->fpu_status
);
463 set_float_rounding_mode(hold
, &env
->fpu_status
);
464 handle_exceptions(env
, GETPC());
468 /* convert 64-bit float to 32-bit int */
469 uint64_t HELPER(cfdb
)(CPUS390XState
*env
, uint64_t v2
, uint32_t m3
)
471 int hold
= swap_round_mode(env
, m3
);
472 int32_t ret
= float64_to_int32(v2
, &env
->fpu_status
);
473 set_float_rounding_mode(hold
, &env
->fpu_status
);
474 handle_exceptions(env
, GETPC());
478 /* convert 128-bit float to 32-bit int */
479 uint64_t HELPER(cfxb
)(CPUS390XState
*env
, uint64_t h
, uint64_t l
, uint32_t m3
)
481 int hold
= swap_round_mode(env
, m3
);
482 float128 v2
= make_float128(h
, l
);
483 int32_t ret
= float128_to_int32(v2
, &env
->fpu_status
);
484 set_float_rounding_mode(hold
, &env
->fpu_status
);
485 handle_exceptions(env
, GETPC());
489 /* convert 32-bit float to 64-bit uint */
490 uint64_t HELPER(clgeb
)(CPUS390XState
*env
, uint64_t v2
, uint32_t m3
)
492 int hold
= swap_round_mode(env
, m3
);
494 v2
= float32_to_float64(v2
, &env
->fpu_status
);
495 ret
= float64_to_uint64(v2
, &env
->fpu_status
);
496 set_float_rounding_mode(hold
, &env
->fpu_status
);
497 handle_exceptions(env
, GETPC());
501 /* convert 64-bit float to 64-bit uint */
502 uint64_t HELPER(clgdb
)(CPUS390XState
*env
, uint64_t v2
, uint32_t m3
)
504 int hold
= swap_round_mode(env
, m3
);
505 uint64_t ret
= float64_to_uint64(v2
, &env
->fpu_status
);
506 set_float_rounding_mode(hold
, &env
->fpu_status
);
507 handle_exceptions(env
, GETPC());
511 /* convert 128-bit float to 64-bit uint */
512 uint64_t HELPER(clgxb
)(CPUS390XState
*env
, uint64_t h
, uint64_t l
, uint32_t m3
)
514 int hold
= swap_round_mode(env
, m3
);
515 float128 v2
= make_float128(h
, l
);
516 /* ??? Not 100% correct. */
517 uint64_t ret
= float128_to_int64(v2
, &env
->fpu_status
);
518 set_float_rounding_mode(hold
, &env
->fpu_status
);
519 handle_exceptions(env
, GETPC());
523 /* convert 32-bit float to 32-bit uint */
524 uint64_t HELPER(clfeb
)(CPUS390XState
*env
, uint64_t v2
, uint32_t m3
)
526 int hold
= swap_round_mode(env
, m3
);
527 uint32_t ret
= float32_to_uint32(v2
, &env
->fpu_status
);
528 set_float_rounding_mode(hold
, &env
->fpu_status
);
529 handle_exceptions(env
, GETPC());
533 /* convert 64-bit float to 32-bit uint */
534 uint64_t HELPER(clfdb
)(CPUS390XState
*env
, uint64_t v2
, uint32_t m3
)
536 int hold
= swap_round_mode(env
, m3
);
537 uint32_t ret
= float64_to_uint32(v2
, &env
->fpu_status
);
538 set_float_rounding_mode(hold
, &env
->fpu_status
);
539 handle_exceptions(env
, GETPC());
543 /* convert 128-bit float to 32-bit uint */
544 uint64_t HELPER(clfxb
)(CPUS390XState
*env
, uint64_t h
, uint64_t l
, uint32_t m3
)
546 int hold
= swap_round_mode(env
, m3
);
547 float128 v2
= make_float128(h
, l
);
548 /* Not 100% correct. */
549 uint32_t ret
= float128_to_int64(v2
, &env
->fpu_status
);
550 set_float_rounding_mode(hold
, &env
->fpu_status
);
551 handle_exceptions(env
, GETPC());
555 /* 32-bit FP multiply and add */
556 uint64_t HELPER(maeb
)(CPUS390XState
*env
, uint64_t f1
,
557 uint64_t f2
, uint64_t f3
)
559 float32 ret
= float32_muladd(f2
, f3
, f1
, 0, &env
->fpu_status
);
560 handle_exceptions(env
, GETPC());
564 /* 64-bit FP multiply and add */
565 uint64_t HELPER(madb
)(CPUS390XState
*env
, uint64_t f1
,
566 uint64_t f2
, uint64_t f3
)
568 float64 ret
= float64_muladd(f2
, f3
, f1
, 0, &env
->fpu_status
);
569 handle_exceptions(env
, GETPC());
573 /* 32-bit FP multiply and subtract */
574 uint64_t HELPER(mseb
)(CPUS390XState
*env
, uint64_t f1
,
575 uint64_t f2
, uint64_t f3
)
577 float32 ret
= float32_muladd(f2
, f3
, f1
, float_muladd_negate_c
,
579 handle_exceptions(env
, GETPC());
583 /* 64-bit FP multiply and subtract */
584 uint64_t HELPER(msdb
)(CPUS390XState
*env
, uint64_t f1
,
585 uint64_t f2
, uint64_t f3
)
587 float64 ret
= float64_muladd(f2
, f3
, f1
, float_muladd_negate_c
,
589 handle_exceptions(env
, GETPC());
593 /* test data class 32-bit */
594 uint32_t HELPER(tceb
)(uint64_t f1
, uint64_t m2
)
597 int neg
= float32_is_neg(v1
);
600 if ((float32_is_zero(v1
) && (m2
& (1 << (11-neg
)))) ||
601 (float32_is_infinity(v1
) && (m2
& (1 << (5-neg
)))) ||
602 (float32_is_any_nan(v1
) && (m2
& (1 << (3-neg
)))) ||
603 (float32_is_signaling_nan(v1
) && (m2
& (1 << (1-neg
))))) {
605 } else if (m2
& (1 << (9-neg
))) {
606 /* assume normalized number */
609 /* FIXME: denormalized? */
613 /* test data class 64-bit */
614 uint32_t HELPER(tcdb
)(uint64_t v1
, uint64_t m2
)
616 int neg
= float64_is_neg(v1
);
619 if ((float64_is_zero(v1
) && (m2
& (1 << (11-neg
)))) ||
620 (float64_is_infinity(v1
) && (m2
& (1 << (5-neg
)))) ||
621 (float64_is_any_nan(v1
) && (m2
& (1 << (3-neg
)))) ||
622 (float64_is_signaling_nan(v1
) && (m2
& (1 << (1-neg
))))) {
624 } else if (m2
& (1 << (9-neg
))) {
625 /* assume normalized number */
628 /* FIXME: denormalized? */
632 /* test data class 128-bit */
633 uint32_t HELPER(tcxb
)(uint64_t ah
, uint64_t al
, uint64_t m2
)
635 float128 v1
= make_float128(ah
, al
);
636 int neg
= float128_is_neg(v1
);
639 if ((float128_is_zero(v1
) && (m2
& (1 << (11-neg
)))) ||
640 (float128_is_infinity(v1
) && (m2
& (1 << (5-neg
)))) ||
641 (float128_is_any_nan(v1
) && (m2
& (1 << (3-neg
)))) ||
642 (float128_is_signaling_nan(v1
) && (m2
& (1 << (1-neg
))))) {
644 } else if (m2
& (1 << (9-neg
))) {
645 /* assume normalized number */
648 /* FIXME: denormalized? */
652 /* square root 32-bit */
653 uint64_t HELPER(sqeb
)(CPUS390XState
*env
, uint64_t f2
)
655 float32 ret
= float32_sqrt(f2
, &env
->fpu_status
);
656 handle_exceptions(env
, GETPC());
660 /* square root 64-bit */
661 uint64_t HELPER(sqdb
)(CPUS390XState
*env
, uint64_t f2
)
663 float64 ret
= float64_sqrt(f2
, &env
->fpu_status
);
664 handle_exceptions(env
, GETPC());
668 /* square root 128-bit */
669 uint64_t HELPER(sqxb
)(CPUS390XState
*env
, uint64_t ah
, uint64_t al
)
671 float128 ret
= float128_sqrt(make_float128(ah
, al
), &env
->fpu_status
);
672 handle_exceptions(env
, GETPC());
676 static const int fpc_to_rnd
[4] = {
677 float_round_nearest_even
,
684 void HELPER(sfpc
)(CPUS390XState
*env
, uint64_t fpc
)
686 /* Install everything in the main FPC. */
689 /* Install the rounding mode in the shadow fpu_status. */
690 set_float_rounding_mode(fpc_to_rnd
[fpc
& 3], &env
->fpu_status
);
693 /* set fpc and signal */
694 void HELPER(sfas
)(CPUS390XState
*env
, uint64_t val
)
696 uint32_t signalling
= env
->fpc
;
697 uint32_t source
= val
;
700 /* The contents of the source operand are placed in the FPC register;
701 then the flags in the FPC register are set to the logical OR of the
702 signalling flags and the source flags. */
703 env
->fpc
= source
| (signalling
& 0x00ff0000);
704 set_float_rounding_mode(fpc_to_rnd
[source
& 3], &env
->fpu_status
);
706 /* If any signalling flag is 1 and the corresponding source mask
707 is also 1, a simulated-iee-exception trap occurs. */
708 s390_exc
= (signalling
>> 16) & (source
>> 24);
710 ieee_exception(env
, s390_exc
| 3, GETPC());