git subrepo pull --force deps/lightrec
[pcsx_rearmed.git] / deps / lightrec / optimizer.h
CommitLineData
98fa08a5 1/* SPDX-License-Identifier: LGPL-2.1-or-later */
d16005f8 2/*
98fa08a5 3 * Copyright (C) 2014-2021 Paul Cercueil <paul@crapouillou.net>
d16005f8
PC
4 */
5
6#ifndef __OPTIMIZER_H__
7#define __OPTIMIZER_H__
8
9#include "disassembler.h"
10
11struct block;
98fa08a5 12struct opcode;
d16005f8 13
cb72ea13
PC
14__cnst _Bool opcode_reads_register(union code op, u8 reg);
15__cnst _Bool opcode_writes_register(union code op, u8 reg);
16__cnst u64 opcode_write_mask(union code op);
17__cnst _Bool has_delay_slot(union code op);
9259d748 18_Bool is_delay_slot(const struct opcode *list, unsigned int offset);
a5a6f7b8 19__cnst _Bool opcode_has_load_delay(union code op);
cb72ea13
PC
20__cnst _Bool opcode_is_io(union code op);
21__cnst _Bool is_unconditional_jump(union code c);
22__cnst _Bool is_syscall(union code c);
d16005f8 23
98fa08a5
PC
24_Bool should_emulate(const struct opcode *op);
25
26int lightrec_optimize(struct lightrec_state *state, struct block *block);
d16005f8
PC
27
28#endif /* __OPTIMIZER_H__ */