mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
Hexagon (target/hexagon) fix bug in fLSBNEW*
Change fLSBNEW/fLSBNEW0/fLSBNEW1 from copy to "x & 1" Remove gen_logical_not function Clean up fLSBNEWNOT to use andi-1 followed by xori-1 Test cases added to tests/tcg/hexagon/misc.c Signed-off-by: Taylor Simpson <tsimpson@quicinc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <1622589584-22571-2-git-send-email-tsimpson@quicinc.com>
This commit is contained in:
parent
13d5f87cc3
commit
07c0f65385
3 changed files with 48 additions and 23 deletions
|
@ -239,33 +239,26 @@ static inline void gen_pred_cancel(TCGv pred, int slot_num)
|
|||
#endif
|
||||
|
||||
#ifdef QEMU_GENERATE
|
||||
#define fLSBNEW(PVAL) tcg_gen_mov_tl(LSB, (PVAL))
|
||||
#define fLSBNEW0 tcg_gen_mov_tl(LSB, hex_new_pred_value[0])
|
||||
#define fLSBNEW1 tcg_gen_mov_tl(LSB, hex_new_pred_value[1])
|
||||
#define fLSBNEW(PVAL) tcg_gen_andi_tl(LSB, (PVAL), 1)
|
||||
#define fLSBNEW0 tcg_gen_andi_tl(LSB, hex_new_pred_value[0], 1)
|
||||
#define fLSBNEW1 tcg_gen_andi_tl(LSB, hex_new_pred_value[1], 1)
|
||||
#else
|
||||
#define fLSBNEW(PVAL) (PVAL)
|
||||
#define fLSBNEW0 new_pred_value(env, 0)
|
||||
#define fLSBNEW1 new_pred_value(env, 1)
|
||||
#define fLSBNEW(PVAL) ((PVAL) & 1)
|
||||
#define fLSBNEW0 (env->new_pred_value[0] & 1)
|
||||
#define fLSBNEW1 (env->new_pred_value[1] & 1)
|
||||
#endif
|
||||
|
||||
#ifdef QEMU_GENERATE
|
||||
static inline void gen_logical_not(TCGv dest, TCGv src)
|
||||
{
|
||||
TCGv one = tcg_const_tl(1);
|
||||
TCGv zero = tcg_const_tl(0);
|
||||
|
||||
tcg_gen_movcond_tl(TCG_COND_NE, dest, src, zero, zero, one);
|
||||
|
||||
tcg_temp_free(one);
|
||||
tcg_temp_free(zero);
|
||||
}
|
||||
#define fLSBOLDNOT(VAL) \
|
||||
do { \
|
||||
tcg_gen_andi_tl(LSB, (VAL), 1); \
|
||||
tcg_gen_xori_tl(LSB, LSB, 1); \
|
||||
} while (0)
|
||||
#define fLSBNEWNOT(PNUM) \
|
||||
gen_logical_not(LSB, (PNUM))
|
||||
do { \
|
||||
tcg_gen_andi_tl(LSB, (PNUM), 1); \
|
||||
tcg_gen_xori_tl(LSB, LSB, 1); \
|
||||
} while (0)
|
||||
#else
|
||||
#define fLSBNEWNOT(PNUM) (!fLSBNEW(PNUM))
|
||||
#define fLSBOLDNOT(VAL) (!fLSBOLD(VAL))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue