git subrepo pull --force deps/lightrec
[pcsx_rearmed.git] / deps / lightrec / optimizer.h
index d8def69..2666652 100644 (file)
@@ -1,15 +1,6 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
 /*
- * Copyright (C) 2014 Paul Cercueil <paul@crapouillou.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
+ * Copyright (C) 2014-2021 Paul Cercueil <paul@crapouillou.net>
  */
 
 #ifndef __OPTIMIZER_H__
 #include "disassembler.h"
 
 struct block;
+struct opcode;
 
-_Bool opcode_reads_register(union code op, u8 reg);
-_Bool opcode_writes_register(union code op, u8 reg);
-_Bool has_delay_slot(union code op);
-_Bool load_in_delay_slot(union code op);
+__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);
 
-int lightrec_optimize(struct block *block);
+_Bool should_emulate(const struct opcode *op);
+
+int lightrec_optimize(struct lightrec_state *state, struct block *block);
 
 #endif /* __OPTIMIZER_H__ */