-
Notifications
You must be signed in to change notification settings - Fork 9
/
optimizer.h
28 lines (21 loc) · 839 Bytes
/
optimizer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2014-2021 Paul Cercueil <[email protected]>
*/
#ifndef __OPTIMIZER_H__
#define __OPTIMIZER_H__
#include "disassembler.h"
struct block;
struct opcode;
__cnst _Bool opcode_reads_register(union code op, u8 reg);
__cnst _Bool opcode_writes_register(union code op, u8 reg);
__cnst u64 opcode_write_mask(union code op);
__cnst _Bool has_delay_slot(union code op);
_Bool is_delay_slot(const struct opcode *list, unsigned int offset);
__cnst _Bool opcode_has_load_delay(union code op);
__cnst _Bool opcode_is_io(union code op);
__cnst _Bool is_unconditional_jump(union code c);
__cnst _Bool is_syscall(union code c);
_Bool should_emulate(const struct opcode *op);
int lightrec_optimize(struct lightrec_state *state, struct block *block);
#endif /* __OPTIMIZER_H__ */