xref: /openbmc/qemu/target/mips/tcg/rel6_translate.c (revision ad1a706f)
1 /*
2  *  MIPS emulation for QEMU - Release 6 translation routines
3  *
4  *  Copyright (c) 2020 Philippe Mathieu-Daudé
5  *
6  * SPDX-License-Identifier: LGPL-2.1-or-later
7  *
8  * This code is licensed under the LGPL v2.1 or later.
9  */
10 
11 #include "qemu/osdep.h"
12 #include "tcg/tcg-op.h"
13 #include "exec/helper-gen.h"
14 #include "translate.h"
15 
16 /* Include the auto-generated decoder.  */
17 #include "decode-mips32r6.c.inc"
18 #include "decode-mips64r6.c.inc"
19 
20 bool trans_REMOVED(DisasContext *ctx, arg_REMOVED *a)
21 {
22     gen_reserved_instruction(ctx);
23 
24     return true;
25 }
26 
27 static bool trans_LSA(DisasContext *ctx, arg_rtype *a)
28 {
29     return gen_lsa(ctx, a->rd, a->rt, a->rs, a->sa);
30 }
31 
32 static bool trans_DLSA(DisasContext *ctx, arg_rtype *a)
33 {
34     return gen_dlsa(ctx, a->rd, a->rt, a->rs, a->sa);
35 }
36 
37 bool decode_isa_rel6(DisasContext *ctx, uint32_t insn)
38 {
39     if (TARGET_LONG_BITS == 64 && decode_mips64r6(ctx, insn)) {
40         return true;
41     }
42     return decode_mips32r6(ctx, insn);
43 }
44