beetle-psx-libretro/deps/lightrec/regcache.h

75 lines
2.7 KiB
C
Raw Normal View History

Add deps for dynarec Fix subrepos due to squashing history git subrepo pull (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "81d07d4e" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "807c6fe7" git-subrepo: version: "0.4.0" origin: "https://github.com/ingydotnet/git-subrepo" commit: "5d6aba9" git subrepo pull (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "5084f032" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "e56284be" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2" git subrepo commit (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "a349e172" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "e077ae7b" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2" git subrepo commit (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "f8db9295" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "85195183" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2" git subrepo commit (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "11267e7c" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "f7121d08" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2" git subrepo pull (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "57c58dbf" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "6c9d6551" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2" git subrepo commit (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "eddfccd0" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "452f23f0" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2" git subrepo commit (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "342c892e" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "72881247" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2" git subrepo pull (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "3e1cf147" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "a6ac0156" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2"
2019-12-31 19:02:39 +00:00
/*
* Copyright (C) 2014-2020 Paul Cercueil <paul@crapouillou.net>
Add deps for dynarec Fix subrepos due to squashing history git subrepo pull (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "81d07d4e" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "807c6fe7" git-subrepo: version: "0.4.0" origin: "https://github.com/ingydotnet/git-subrepo" commit: "5d6aba9" git subrepo pull (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "5084f032" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "e56284be" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2" git subrepo commit (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "a349e172" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "e077ae7b" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2" git subrepo commit (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "f8db9295" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "85195183" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2" git subrepo commit (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "11267e7c" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "f7121d08" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2" git subrepo pull (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "57c58dbf" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "6c9d6551" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2" git subrepo commit (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "eddfccd0" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "452f23f0" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2" git subrepo commit (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "342c892e" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "72881247" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2" git subrepo pull (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "3e1cf147" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "a6ac0156" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2"
2019-12-31 19:02:39 +00:00
*
* 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.
*/
#ifndef __REGCACHE_H__
#define __REGCACHE_H__
#include "lightrec-private.h"
#define NUM_REGS (JIT_V_NUM - 2)
#define NUM_TEMPS (JIT_R_NUM)
#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
struct register_value {
_Bool known;
u32 value;
};
struct native_register;
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_request_reg_in(struct regcache *cache, jit_state_t *_jit,
u8 reg, u8 jit_reg);
void lightrec_regcache_reset(struct regcache *cache);
void lightrec_lock_reg(struct regcache *cache, jit_state_t *_jit, u8 jit_reg);
void lightrec_free_reg(struct regcache *cache, u8 jit_reg);
void lightrec_free_regs(struct regcache *cache);
void lightrec_clean_reg(struct regcache *cache, jit_state_t *_jit, u8 jit_reg);
void lightrec_clean_regs(struct regcache *cache, jit_state_t *_jit);
void lightrec_unload_reg(struct regcache *cache, jit_state_t *_jit, u8 jit_reg);
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);
u8 lightrec_alloc_reg_in_address(struct regcache *cache,
jit_state_t *_jit, u8 reg, s16 offset);
struct native_register * lightrec_regcache_enter_branch(struct regcache *cache);
void lightrec_regcache_leave_branch(struct regcache *cache,
struct native_register *regs);
struct regcache * lightrec_regcache_init(struct lightrec_state *state);
void lightrec_free_regcache(struct regcache *cache);
const char * lightrec_reg_name(u8 reg);
void lightrec_regcache_mark_live(struct regcache *cache, jit_state_t *_jit);
#endif /* __REGCACHE_H__ */