aboutsummaryrefslogtreecommitdiff
path: root/target-arm/helper.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-31 03:46:19 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-31 03:46:19 +0000
commit3670669ce25ef337a6e5e99b7a97b83997c06721 (patch)
tree7b15f6ba52aee927d833ac1aacde641f2631ac17 /target-arm/helper.c
parent8f01245ee768775d5fa4f1dd0930e7062eb5dc27 (diff)
ARM TCG conversion 6/16.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4143 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-arm/helper.c')
-rw-r--r--target-arm/helper.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 2c35ea4baf..c61c610919 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -347,6 +347,35 @@ uint32_t HELPER(clz)(uint32_t x)
return count;
}
+int32_t HELPER(sdiv)(int32_t num, int32_t den)
+{
+ if (den == 0)
+ return 0;
+ return num / den;
+}
+
+uint32_t HELPER(udiv)(uint32_t num, uint32_t den)
+{
+ if (den == 0)
+ return 0;
+ return num / den;
+}
+
+uint32_t HELPER(rbit)(uint32_t x)
+{
+ x = ((x & 0xff000000) >> 24)
+ | ((x & 0x00ff0000) >> 8)
+ | ((x & 0x0000ff00) << 8)
+ | ((x & 0x000000ff) << 24);
+ x = ((x & 0xf0f0f0f0) >> 4)
+ | ((x & 0x0f0f0f0f) << 4);
+ x = ((x & 0x88888888) >> 3)
+ | ((x & 0x44444444) >> 1)
+ | ((x & 0x22222222) << 1)
+ | ((x & 0x11111111) << 3);
+ return x;
+}
+
#if defined(CONFIG_USER_ONLY)
void do_interrupt (CPUState *env)