diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2022-10-20 09:08:52 +1000 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2023-02-04 06:19:42 -1000 |
commit | 4e5712f9037c34bbd9ffd78baa9d1ebea13a430d (patch) | |
tree | f8eb05d0c523dac92f5f3f1f2e3ebb9091ddf4a4 /target/s390x/tcg/translate.c | |
parent | 6d28ff406c71c2c6f8a79edb1ccfc17978aa95fb (diff) | |
download | qemu-4e5712f9037c34bbd9ffd78baa9d1ebea13a430d.zip qemu-4e5712f9037c34bbd9ffd78baa9d1ebea13a430d.tar.gz qemu-4e5712f9037c34bbd9ffd78baa9d1ebea13a430d.tar.bz2 |
target/s390x: Use a single return for helper_divs64/u64
Pack the quotient and remainder into a single Int128.
Use the divu128 primitive to remove the cpu_abort on
32-bit hosts.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
v2: Extended div test case to cover these insns.
Diffstat (limited to 'target/s390x/tcg/translate.c')
-rw-r--r-- | target/s390x/tcg/translate.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 169f7ee..6953b81 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -2409,15 +2409,21 @@ static DisasJumpType op_divu32(DisasContext *s, DisasOps *o) static DisasJumpType op_divs64(DisasContext *s, DisasOps *o) { - gen_helper_divs64(o->out2, cpu_env, o->in1, o->in2); - return_low128(o->out); + TCGv_i128 t = tcg_temp_new_i128(); + + gen_helper_divs64(t, cpu_env, o->in1, o->in2); + tcg_gen_extr_i128_i64(o->out2, o->out, t); + tcg_temp_free_i128(t); return DISAS_NEXT; } static DisasJumpType op_divu64(DisasContext *s, DisasOps *o) { - gen_helper_divu64(o->out2, cpu_env, o->out, o->out2, o->in2); - return_low128(o->out); + TCGv_i128 t = tcg_temp_new_i128(); + + gen_helper_divu64(t, cpu_env, o->out, o->out2, o->in2); + tcg_gen_extr_i128_i64(o->out2, o->out, t); + tcg_temp_free_i128(t); return DISAS_NEXT; } |