diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2009-05-10 07:19:22 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2009-05-10 07:19:22 +0000 |
commit | 789c91ef396252e7fedbc5c5b02b91df6daa08c3 (patch) | |
tree | 96db644c21b6544a62797955ad8d2e962616024d /target-sparc/op_helper.c | |
parent | bdf9f35dad46b3f20235b9a19f0a6633362e10ed (diff) | |
download | hqemu-789c91ef396252e7fedbc5c5b02b91df6daa08c3.zip hqemu-789c91ef396252e7fedbc5c5b02b91df6daa08c3.tar.gz |
Convert addx
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-sparc/op_helper.c')
-rw-r--r-- | target-sparc/op_helper.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c index e0d5aec..6455f95 100644 --- a/target-sparc/op_helper.c +++ b/target-sparc/op_helper.c @@ -860,6 +860,48 @@ static uint32_t compute_C_add_xcc(void) } #endif +static uint32_t compute_all_addx(void) +{ + uint32_t ret; + + ret = get_NZ_icc(CC_DST); + ret |= get_C_add_icc(CC_DST - CC_SRC2, CC_SRC); + ret |= get_C_add_icc(CC_DST, CC_SRC); + ret |= get_V_add_icc(CC_DST, CC_SRC, CC_SRC2); + return ret; +} + +static uint32_t compute_C_addx(void) +{ + uint32_t ret; + + ret = get_C_add_icc(CC_DST - CC_SRC2, CC_SRC); + ret |= get_C_add_icc(CC_DST, CC_SRC); + return ret; +} + +#ifdef TARGET_SPARC64 +static uint32_t compute_all_addx_xcc(void) +{ + uint32_t ret; + + ret = get_NZ_xcc(CC_DST); + ret |= get_C_add_xcc(CC_DST - CC_SRC2, CC_SRC); + ret |= get_C_add_xcc(CC_DST, CC_SRC); + ret |= get_V_add_xcc(CC_DST, CC_SRC, CC_SRC2); + return ret; +} + +static uint32_t compute_C_addx_xcc(void) +{ + uint32_t ret; + + ret = get_C_add_xcc(CC_DST - CC_SRC2, CC_SRC); + ret |= get_C_add_xcc(CC_DST, CC_SRC); + return ret; +} +#endif + typedef struct CCTable { uint32_t (*compute_all)(void); /* return all the flags */ uint32_t (*compute_c)(void); /* return the C flag */ @@ -869,6 +911,7 @@ static const CCTable icc_table[CC_OP_NB] = { /* CC_OP_DYNAMIC should never happen */ [CC_OP_FLAGS] = { compute_all_flags, compute_C_flags }, [CC_OP_ADD] = { compute_all_add, compute_C_add }, + [CC_OP_ADDX] = { compute_all_addx, compute_C_addx }, }; #ifdef TARGET_SPARC64 @@ -876,6 +919,7 @@ static const CCTable xcc_table[CC_OP_NB] = { /* CC_OP_DYNAMIC should never happen */ [CC_OP_FLAGS] = { compute_all_flags_xcc, compute_C_flags_xcc }, [CC_OP_ADD] = { compute_all_add_xcc, compute_C_add_xcc }, + [CC_OP_ADDX] = { compute_all_addx_xcc, compute_C_addx_xcc }, }; #endif |