aboutsummaryrefslogtreecommitdiff
path: root/target-sparc/op_helper.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-05-10 07:42:54 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-05-10 07:42:54 +0000
commit6c78ea32e1f02216f45dee69a0c6ee0ca968fdac (patch)
tree2a26af16290773fde11a974834a12ea54b4305f0 /target-sparc/op_helper.c
parent3b2d1e9286e1ddbb36499c9fd59e14b736441969 (diff)
Convert udiv/sdiv
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-sparc/op_helper.c')
-rw-r--r--target-sparc/op_helper.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index ddfe152000..9de74c46c2 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -790,6 +790,29 @@ static inline uint32_t get_NZ_xcc(target_ulong dst)
}
#endif
+static inline uint32_t get_V_div_icc(target_ulong src2)
+{
+ uint32_t ret = 0;
+
+ if (src2 != 0)
+ ret |= PSR_OVF;
+ return ret;
+}
+
+static uint32_t compute_all_div(void)
+{
+ uint32_t ret;
+
+ ret = get_NZ_icc(CC_DST);
+ ret |= get_V_div_icc(CC_SRC2);
+ return ret;
+}
+
+static uint32_t compute_C_div(void)
+{
+ return 0;
+}
+
static inline uint32_t get_C_add_icc(target_ulong dst, target_ulong src1)
{
uint32_t ret = 0;
@@ -1108,6 +1131,7 @@ typedef struct CCTable {
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_DIV] = { compute_all_div, compute_C_div },
[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 },
@@ -1123,6 +1147,7 @@ static const CCTable icc_table[CC_OP_NB] = {
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_DIV] = { compute_all_logic_xcc, compute_C_logic },
[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 },