X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=deps%2Flightrec%2Foptimizer.h;h=266665208d230b2d6aafb1cfe5c301347fcb4224;hb=a5a6f7b82ed88f1ac3178c32c9bda22eb612814b;hp=d8def69253c9058dccb9d56de068f87c7c336a3d;hpb=d16005f843cd28ae90f091bd4e39a90b355e1d45;p=pcsx_rearmed.git diff --git a/deps/lightrec/optimizer.h b/deps/lightrec/optimizer.h index d8def692..26666520 100644 --- a/deps/lightrec/optimizer.h +++ b/deps/lightrec/optimizer.h @@ -1,15 +1,6 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* - * Copyright (C) 2014 Paul Cercueil - * - * 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 */ #ifndef __OPTIMIZER_H__ @@ -18,12 +9,20 @@ #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__ */