mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
tcg: Merge INDEX_op_mulu2_{i32,i64}
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
d37bc370fc
commit
d776198cd3
7 changed files with 22 additions and 28 deletions
|
@ -2069,13 +2069,14 @@ static bool fold_multiply2(OptContext *ctx, TCGOp *op)
|
|||
TCGOp *op2;
|
||||
|
||||
switch (op->opc) {
|
||||
case INDEX_op_mulu2_i32:
|
||||
l = (uint64_t)(uint32_t)a * (uint32_t)b;
|
||||
h = (int32_t)(l >> 32);
|
||||
l = (int32_t)l;
|
||||
break;
|
||||
case INDEX_op_mulu2_i64:
|
||||
mulu64(&l, &h, a, b);
|
||||
case INDEX_op_mulu2:
|
||||
if (ctx->type == TCG_TYPE_I32) {
|
||||
l = (uint64_t)(uint32_t)a * (uint32_t)b;
|
||||
h = (int32_t)(l >> 32);
|
||||
l = (int32_t)l;
|
||||
} else {
|
||||
mulu64(&l, &h, a, b);
|
||||
}
|
||||
break;
|
||||
case INDEX_op_muls2:
|
||||
if (ctx->type == TCG_TYPE_I32) {
|
||||
|
@ -2975,7 +2976,7 @@ void tcg_optimize(TCGContext *s)
|
|||
done = fold_mul_highpart(&ctx, op);
|
||||
break;
|
||||
case INDEX_op_muls2:
|
||||
CASE_OP_32_64(mulu2):
|
||||
case INDEX_op_mulu2:
|
||||
done = fold_multiply2(&ctx, op);
|
||||
break;
|
||||
case INDEX_op_nand:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue