xref: /qemu/target/mips/tcg/rel6_translate.c (revision 3f7a927847a41fb6def742d5cb8c3dec55755844)
1 /*
2  *  MIPS emulation for QEMU - # Release 6 translation routines
3  *
4  *  Copyright (c) 2004-2005 Jocelyn Mayer
5  *  Copyright (c) 2006 Marius Groeger (FPU operations)
6  *  Copyright (c) 2006 Thiemo Seufer (MIPS32R2 support)
7  *  Copyright (c) 2020 Philippe Mathieu-Daudé
8  *
9  * This code is licensed under the GNU GPLv2 and later.
10  */
11 
12 #include "qemu/osdep.h"
13 #include "tcg/tcg-op.h"
14 #include "exec/helper-gen.h"
15 #include "translate.h"
16 
17 /* Include the auto-generated decoder.  */
18 #include "decode-mips32r6.c.inc"
19 #include "decode-mips64r6.c.inc"
20 
21 static bool trans_LSA(DisasContext *ctx, arg_rtype *a)
22 {
23     return gen_lsa(ctx, a->rd, a->rt, a->rs, a->sa);
24 }
25 
26 static bool trans_DLSA(DisasContext *ctx, arg_rtype *a)
27 {
28     return gen_dlsa(ctx, a->rd, a->rt, a->rs, a->sa);
29 }
30 
31 bool decode_isa_rel6(DisasContext *ctx, uint32_t insn)
32 {
33     if (TARGET_LONG_BITS == 64 && decode_mips64r6(ctx, insn)) {
34         return true;
35     }
36     return decode_mips32r6(ctx, insn);
37 }
38