]> git.proxmox.com Git - qemu.git/blame - target-openrisc/translate.c
target-or32: Add float instruction helpers
[qemu.git] / target-openrisc / translate.c
CommitLineData
e67db06e
JL
1/*
2 * OpenRISC translation
3 *
4 * Copyright (c) 2011-2012 Jia Liu <proljc@gmail.com>
5 * Feng Gao <gf91597@gmail.com>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include "cpu.h"
22#include "exec-all.h"
23#include "disas.h"
24#include "tcg-op.h"
25#include "qemu-common.h"
26#include "qemu-log.h"
27#include "config.h"
28
29#define OPENRISC_DISAS
30
31#ifdef OPENRISC_DISAS
32# define LOG_DIS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__)
33#else
34# define LOG_DIS(...) do { } while (0)
35#endif
36
37void openrisc_translate_init(void)
38{
39}
40
41static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu,
42 TranslationBlock *tb,
43 int search_pc)
44{
45}
46
47void gen_intermediate_code(CPUOpenRISCState *env, struct TranslationBlock *tb)
48{
49 gen_intermediate_code_internal(openrisc_env_get_cpu(env), tb, 0);
50}
51
52void gen_intermediate_code_pc(CPUOpenRISCState *env,
53 struct TranslationBlock *tb)
54{
55 gen_intermediate_code_internal(openrisc_env_get_cpu(env), tb, 1);
56}
57
58void cpu_dump_state(CPUOpenRISCState *env, FILE *f,
59 fprintf_function cpu_fprintf,
60 int flags)
61{
62 int i;
63 uint32_t *regs = env->gpr;
64 cpu_fprintf(f, "PC=%08x\n", env->pc);
65 for (i = 0; i < 32; ++i) {
66 cpu_fprintf(f, "R%02d=%08x%c", i, regs[i],
67 (i % 4) == 3 ? '\n' : ' ');
68 }
69}
70
71void restore_state_to_opc(CPUOpenRISCState *env, TranslationBlock *tb,
72 int pc_pos)
73{
74 env->pc = gen_opc_pc[pc_pos];
75}