summaryrefslogtreecommitdiff
path: root/target-microblaze/op_helper.c
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>2011-01-22 12:02:53 +0100
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2011-01-22 12:02:53 +0100
commit40cbf5b7098981f66ef161e6ce7a9f6770537ea4 (patch)
tree7e478289e6c8733e271a723cd9b08704e52ea651 /target-microblaze/op_helper.c
parent2accfb5fa6f097845915973a06824bc72fb26e94 (diff)
downloadqemu-40cbf5b7098981f66ef161e6ce7a9f6770537ea4.tar.gz
microblaze: Improve addkc
* Optimize handling when carry is not updated. * Optimize handling for adds with nop semantics. * Move code from helper_addkc to the translator making helper_addkc PURE and CONST. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'target-microblaze/op_helper.c')
-rw-r--r--target-microblaze/op_helper.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/target-microblaze/op_helper.c b/target-microblaze/op_helper.c
index 97461aed6e..eb5a8b7df3 100644
--- a/target-microblaze/op_helper.c
+++ b/target-microblaze/op_helper.c
@@ -128,26 +128,14 @@ uint32_t helper_cmpu(uint32_t a, uint32_t b)
return t;
}
-uint32_t helper_addkc(uint32_t a, uint32_t b, uint32_t k, uint32_t c)
+uint32_t helper_addkc(uint32_t a, uint32_t b, uint32_t cf)
{
- uint32_t d, cf = 0, ncf;
+ uint32_t d, ncf;
- if (c)
- cf = env->sregs[SR_MSR] >> 31;
- assert(cf == 0 || cf == 1);
d = a + b + cf;
- if (!k) {
- ncf = compute_carry(a, b, cf);
- assert(ncf == 0 || ncf == 1);
- if (ncf)
- env->sregs[SR_MSR] |= MSR_C | MSR_CC;
- else
- env->sregs[SR_MSR] &= ~(MSR_C | MSR_CC);
- }
- D(qemu_log("%x = %x + %x cf=%d ncf=%d k=%d c=%d\n",
- d, a, b, cf, ncf, k, c));
- return d;
+ ncf = compute_carry(a, b, cf);
+ return ncf;
}
uint32_t helper_subkc(uint32_t a, uint32_t b, uint32_t k, uint32_t c)