diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2009-05-10 10:38:34 +0300 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2009-05-10 10:38:34 +0300 |
commit | 2ca1d92b0785b65c48b415ee9074f3674432edde (patch) | |
tree | 784864e9b4201f412b7c28fb2a66005a028858b3 /target-sparc/op_helper.c | |
parent | d4b0d46898ec67e733b64b14d623550d1e7f6b9d (diff) |
Convert subx
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 5890f2902d..0df6bb045a 100644 --- a/target-sparc/op_helper.c +++ b/target-sparc/op_helper.c @@ -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 |