1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * LoongArch translation routines.
5 * Copyright (c) 2021 Loongson Technology Corporation Limited
8 #ifndef TARGET_LOONGARCH_TRANSLATE_H
9 #define TARGET_LOONGARCH_TRANSLATE_H
11 #include "exec/translator.h"
13 #define TRANS(NAME, FUNC, ...) \
14 static bool trans_##NAME(DisasContext *ctx, arg_##NAME * a) \
15 { return FUNC(ctx, a, __VA_ARGS__); }
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.
28 typedef struct DisasContext {
29 DisasContextBase base;
30 target_ulong page_start;
34 /* Space for 3 operands plus 1 extra for address computation. */
39 void generate_exception(DisasContext *ctx, int excp);
41 extern TCGv cpu_gpr[32], cpu_pc;
42 extern TCGv_i32 cpu_fscr0;
43 extern TCGv_i64 cpu_fpr[32];