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