summaryrefslogtreecommitdiff
path: root/target-sparc/op_helper.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-05-10 10:38:35 +0300
committerBlue Swirl <blauwirbel@gmail.com>2009-05-10 10:38:35 +0300
commit3b2d1e9286e1ddbb36499c9fd59e14b736441969 (patch)
tree01d5c63997d3cec2c1c8409dc545ded1ef55cab2 /target-sparc/op_helper.c
parent2ca1d92b0785b65c48b415ee9074f3674432edde (diff)
downloadqemu-3b2d1e9286e1ddbb36499c9fd59e14b736441969.tar.gz
Convert tagged ops
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-sparc/op_helper.c')
-rw-r--r--target-sparc/op_helper.c77
1 files changed, 77 insertions, 0 deletions
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index 0df6bb045a..ddfe152000 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -902,6 +902,45 @@ static uint32_t compute_C_addx_xcc(void)
}
#endif
+static inline uint32_t get_V_tag_icc(target_ulong src1, target_ulong src2)
+{
+ uint32_t ret = 0;
+
+ if ((src1 | src2) & 0x3)
+ ret |= PSR_OVF;
+ return ret;
+}
+
+static uint32_t compute_all_tadd(void)
+{
+ uint32_t ret;
+
+ ret = get_NZ_icc(CC_DST);
+ ret |= get_C_add_icc(CC_DST, CC_SRC);
+ ret |= get_V_add_icc(CC_DST, CC_SRC, CC_SRC2);
+ ret |= get_V_tag_icc(CC_SRC, CC_SRC2);
+ return ret;
+}
+
+static uint32_t compute_C_tadd(void)
+{
+ return get_C_add_icc(CC_DST, CC_SRC);
+}
+
+static uint32_t compute_all_taddtv(void)
+{
+ uint32_t ret;
+
+ ret = get_NZ_icc(CC_DST);
+ ret |= get_C_add_icc(CC_DST, CC_SRC);
+ return ret;
+}
+
+static uint32_t compute_C_taddtv(void)
+{
+ return get_C_add_icc(CC_DST, CC_SRC);
+}
+
static inline uint32_t get_C_sub_icc(target_ulong src1, target_ulong src2)
{
uint32_t ret = 0;
@@ -1014,6 +1053,36 @@ static uint32_t compute_C_subx_xcc(void)
}
#endif
+static uint32_t compute_all_tsub(void)
+{
+ uint32_t ret;
+
+ ret = get_NZ_icc(CC_DST);
+ ret |= get_C_sub_icc(CC_DST, CC_SRC);
+ ret |= get_V_sub_icc(CC_DST, CC_SRC, CC_SRC2);
+ ret |= get_V_tag_icc(CC_SRC, CC_SRC2);
+ return ret;
+}
+
+static uint32_t compute_C_tsub(void)
+{
+ return get_C_sub_icc(CC_DST, CC_SRC);
+}
+
+static uint32_t compute_all_tsubtv(void)
+{
+ uint32_t ret;
+
+ ret = get_NZ_icc(CC_DST);
+ ret |= get_C_sub_icc(CC_DST, CC_SRC);
+ return ret;
+}
+
+static uint32_t compute_C_tsubtv(void)
+{
+ return get_C_sub_icc(CC_DST, CC_SRC);
+}
+
static uint32_t compute_all_logic(void)
{
return get_NZ_icc(CC_DST);
@@ -1041,8 +1110,12 @@ static const CCTable icc_table[CC_OP_NB] = {
[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 },
+ [CC_OP_TADD] = { compute_all_tadd, compute_C_tadd },
+ [CC_OP_TADDTV] = { compute_all_taddtv, compute_C_taddtv },
[CC_OP_SUB] = { compute_all_sub, compute_C_sub },
[CC_OP_SUBX] = { compute_all_subx, compute_C_subx },
+ [CC_OP_TSUB] = { compute_all_tsub, compute_C_tsub },
+ [CC_OP_TSUBTV] = { compute_all_tsubtv, compute_C_tsubtv },
[CC_OP_LOGIC] = { compute_all_logic, compute_C_logic },
};
@@ -1052,8 +1125,12 @@ static const CCTable xcc_table[CC_OP_NB] = {
[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 },
+ [CC_OP_TADD] = { compute_all_add_xcc, compute_C_add_xcc },
+ [CC_OP_TADDTV] = { compute_all_add_xcc, compute_C_add_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_TSUB] = { compute_all_sub_xcc, compute_C_sub_xcc },
+ [CC_OP_TSUBTV] = { compute_all_sub_xcc, compute_C_sub_xcc },
[CC_OP_LOGIC] = { compute_all_logic_xcc, compute_C_logic },
};
#endif