]> git.proxmox.com Git - mirror_qemu.git/blame - target/loongarch/translate.h
Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into...
[mirror_qemu.git] / target / loongarch / translate.h
CommitLineData
f8da88d7
SG
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * LoongArch translation routines.
4 *
5 * Copyright (c) 2021 Loongson Technology Corporation Limited
6 */
7
8#ifndef TARGET_LOONGARCH_TRANSLATE_H
9#define TARGET_LOONGARCH_TRANSLATE_H
10
11#include "exec/translator.h"
12
143d6785
SG
13#define TRANS(NAME, FUNC, ...) \
14 static bool trans_##NAME(DisasContext *ctx, arg_##NAME * a) \
15 { return FUNC(ctx, a, __VA_ARGS__); }
16
17/*
18 * If an operation is being performed on less than TARGET_LONG_BITS,
19 * it may require the inputs to be sign- or zero-extended; which will
20 * depend on the exact operation being performed.
21 */
22typedef enum {
23 EXT_NONE,
24 EXT_SIGN,
25 EXT_ZERO,
26} DisasExtend;
27
f8da88d7
SG
28typedef struct DisasContext {
29 DisasContextBase base;
30 target_ulong page_start;
31 uint32_t opcode;
c8885b88
RW
32 uint16_t mem_idx;
33 uint16_t plv;
143d6785
SG
34 TCGv zero;
35 /* Space for 3 operands plus 1 extra for address computation. */
36 TCGv temp[4];
37 uint8_t ntemp;
f8da88d7
SG
38} DisasContext;
39
40void generate_exception(DisasContext *ctx, int excp);
41
42extern TCGv cpu_gpr[32], cpu_pc;
43extern TCGv_i32 cpu_fscr0;
44extern TCGv_i64 cpu_fpr[32];
45
46#endif