diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2019-02-25 10:29:25 -0800 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2019-04-24 13:04:33 -0700 |
commit | fce1296f135669eca85dc42154a2a352c818ad76 (patch) | |
tree | 847ec48009722f8cc322e1661a080de798d77bc1 /tcg/optimize.c | |
parent | 2089fcc9e7b4174d1c351eaa7d277c02188a6dd2 (diff) | |
download | qemu-fce1296f135669eca85dc42154a2a352c818ad76.zip qemu-fce1296f135669eca85dc42154a2a352c818ad76.tar.gz qemu-fce1296f135669eca85dc42154a2a352c818ad76.tar.bz2 |
tcg: Add INDEX_op_extract2_{i32,i64}
This will let backends implement the double-word shift operation.
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/optimize.c')
-rw-r--r-- | tcg/optimize.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c index 01e80c3..5150c38 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1202,6 +1202,22 @@ void tcg_optimize(TCGContext *s) } goto do_default; + CASE_OP_32_64(extract2): + if (arg_is_const(op->args[1]) && arg_is_const(op->args[2])) { + TCGArg v1 = arg_info(op->args[1])->val; + TCGArg v2 = arg_info(op->args[2])->val; + + if (opc == INDEX_op_extract2_i64) { + tmp = (v1 >> op->args[3]) | (v2 << (64 - op->args[3])); + } else { + tmp = (v1 >> op->args[3]) | (v2 << (32 - op->args[3])); + tmp = (int32_t)tmp; + } + tcg_opt_gen_movi(s, op, op->args[0], tmp); + break; + } + goto do_default; + CASE_OP_32_64(setcond): tmp = do_constant_folding_cond(opc, op->args[1], op->args[2], op->args[3]); |