Convert subx

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2009-05-10 10:38:34 +03:00
parent d4b0d46898
commit 2ca1d92b07
2 changed files with 50 additions and 31 deletions

View file

@ -972,6 +972,48 @@ static uint32_t compute_C_sub_xcc(void)
}
#endif
static uint32_t compute_all_subx(void)
{
uint32_t ret;
ret = get_NZ_icc(CC_DST);
ret |= get_C_sub_icc(CC_DST - CC_SRC2, CC_SRC);
ret |= get_C_sub_icc(CC_DST, CC_SRC2);
ret |= get_V_sub_icc(CC_DST, CC_SRC, CC_SRC2);
return ret;
}
static uint32_t compute_C_subx(void)
{
uint32_t ret;
ret = get_C_sub_icc(CC_DST - CC_SRC2, CC_SRC);
ret |= get_C_sub_icc(CC_DST, CC_SRC2);
return ret;
}
#ifdef TARGET_SPARC64
static uint32_t compute_all_subx_xcc(void)
{
uint32_t ret;
ret = get_NZ_xcc(CC_DST);
ret |= get_C_sub_xcc(CC_DST - CC_SRC2, CC_SRC);
ret |= get_C_sub_xcc(CC_DST, CC_SRC2);
ret |= get_V_sub_xcc(CC_DST, CC_SRC, CC_SRC2);
return ret;
}
static uint32_t compute_C_subx_xcc(void)
{
uint32_t ret;
ret = get_C_sub_xcc(CC_DST - CC_SRC2, CC_SRC);
ret |= get_C_sub_xcc(CC_DST, CC_SRC2);
return ret;
}
#endif
static uint32_t compute_all_logic(void)
{
return get_NZ_icc(CC_DST);
@ -1000,6 +1042,7 @@ static const CCTable icc_table[CC_OP_NB] = {
[CC_OP_ADD] = { compute_all_add, compute_C_add },
[CC_OP_ADDX] = { compute_all_addx, compute_C_addx },
[CC_OP_SUB] = { compute_all_sub, compute_C_sub },
[CC_OP_SUBX] = { compute_all_subx, compute_C_subx },
[CC_OP_LOGIC] = { compute_all_logic, compute_C_logic },
};
@ -1010,6 +1053,7 @@ static const CCTable xcc_table[CC_OP_NB] = {
[CC_OP_ADD] = { compute_all_add_xcc, compute_C_add_xcc },
[CC_OP_ADDX] = { compute_all_addx_xcc, compute_C_addx_xcc },
[CC_OP_SUB] = { compute_all_sub_xcc, compute_C_sub_xcc },
[CC_OP_SUBX] = { compute_all_subx_xcc, compute_C_subx_xcc },
[CC_OP_LOGIC] = { compute_all_logic_xcc, compute_C_logic },
};
#endif