1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
3 * Copyright (C) 2022 Paul Cercueil <paul@crapouillou.net>
6 #ifndef __LIGHTREC_CONSTPROP_H__
7 #define __LIGHTREC_CONSTPROP_H__
11 #define LIGHTREC_CONSTPROP_INITIALIZER { { 0, 0xffffffff, 0 }, }
15 struct constprop_data {
21 static inline _Bool is_known(const struct constprop_data *v, u8 reg)
23 return v[reg].known == 0xffffffff;
26 static inline _Bool bits_are_known_zero(const struct constprop_data *v,
29 return !(~v[reg].known & mask) && !(v[reg].value & mask);
32 static inline _Bool is_known_zero(const struct constprop_data *v, u8 reg)
34 return bits_are_known_zero(v, reg, 0xffffffff);
37 void lightrec_consts_propagate(const struct block *block,
39 struct constprop_data *v);
42 lightrec_get_constprop_map(const struct lightrec_state *state,
43 const struct constprop_data *v, u8 reg, s16 imm);
45 #endif /* __LIGHTREC_CONSTPROP_H__ */