X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=deps%2Flightrec%2Fregcache.h;h=5aa5050f65c71c5f4d6f2f533a1c5a4ef8211686;hb=03535202b4b624c534340322646fb7f4062e3f53;hp=956cc3c47f110150631bb24fac8194ed8186500c;hpb=0adc619b5a5705d16cc6caea64951776ababbb96;p=pcsx_rearmed.git diff --git a/deps/lightrec/regcache.h b/deps/lightrec/regcache.h index 956cc3c4..5aa5050f 100644 --- a/deps/lightrec/regcache.h +++ b/deps/lightrec/regcache.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 __REGCACHE_H__ @@ -22,8 +13,9 @@ #define LIGHTREC_REG_STATE (JIT_V(JIT_V_NUM - 1)) #define LIGHTREC_REG_CYCLE (JIT_V(JIT_V_NUM - 2)) -#define REG_LO 32 -#define REG_HI 33 +/* Flags for lightrec_alloc_reg_in / lightrec_alloc_reg_out. */ +#define REG_EXT BIT(0) /* register is sign-extended */ +#define REG_ZEXT BIT(1) /* register is zero-extended */ struct register_value { _Bool known; @@ -35,15 +27,17 @@ struct regcache; u8 lightrec_alloc_reg(struct regcache *cache, jit_state_t *_jit, u8 jit_reg); u8 lightrec_alloc_reg_temp(struct regcache *cache, jit_state_t *_jit); -u8 lightrec_alloc_reg_out(struct regcache *cache, jit_state_t *_jit, u8 reg); -u8 lightrec_alloc_reg_in(struct regcache *cache, jit_state_t *_jit, u8 reg); -u8 lightrec_alloc_reg_out_ext(struct regcache *cache, - jit_state_t *_jit, u8 reg); -u8 lightrec_alloc_reg_in_ext(struct regcache *cache, jit_state_t *_jit, u8 reg); +u8 lightrec_alloc_reg_out(struct regcache *cache, jit_state_t *_jit, + u8 reg, u8 flags); +u8 lightrec_alloc_reg_in(struct regcache *cache, jit_state_t *_jit, + u8 reg, u8 flags); u8 lightrec_request_reg_in(struct regcache *cache, jit_state_t *_jit, u8 reg, u8 jit_reg); +u8 lightrec_get_reg_in_flags(struct regcache *cache, u8 jit_reg); +void lightrec_set_reg_out_flags(struct regcache *cache, u8 jit_reg, u8 flags); + void lightrec_regcache_reset(struct regcache *cache); void lightrec_lock_reg(struct regcache *cache, jit_state_t *_jit, u8 jit_reg); @@ -56,6 +50,7 @@ void lightrec_storeback_regs(struct regcache *cache, jit_state_t *_jit); void lightrec_clean_reg_if_loaded(struct regcache *cache, jit_state_t *_jit, u8 reg, _Bool unload); +void lightrec_discard_reg_if_loaded(struct regcache *cache, u8 reg); u8 lightrec_alloc_reg_in_address(struct regcache *cache, jit_state_t *_jit, u8 reg, s16 offset);