aboutsummaryrefslogtreecommitdiff
path: root/tcg-runtime.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2013-02-19 23:51:55 -0800
committerBlue Swirl <blauwirbel@gmail.com>2013-02-23 17:25:28 +0000
commit696a8be6a077a5760bbf9822209999c908cdf0b1 (patch)
tree694113e02d0e3fde6418eea4703b330480397348 /tcg-runtime.c
parent3c51a98507f9ff64fc2a3841c0e5b8a0c9e3c2b7 (diff)
tcg: Implement multiword multiply helpers
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'tcg-runtime.c')
-rw-r--r--tcg-runtime.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/tcg-runtime.c b/tcg-runtime.c
index abfc36498f..4b66e51ce7 100644
--- a/tcg-runtime.c
+++ b/tcg-runtime.c
@@ -22,7 +22,7 @@
* THE SOFTWARE.
*/
#include <stdint.h>
-
+#include "qemu/host-utils.h"
#include "tcg/tcg-runtime.h"
/* 32-bit helpers */
@@ -83,3 +83,17 @@ uint64_t tcg_helper_remu_i64(uint64_t arg1, uint64_t arg2)
{
return arg1 % arg2;
}
+
+uint64_t tcg_helper_muluh_i64(uint64_t arg1, uint64_t arg2)
+{
+ uint64_t l, h;
+ mulu64(&l, &h, arg1, arg2);
+ return h;
+}
+
+int64_t tcg_helper_mulsh_i64(int64_t arg1, int64_t arg2)
+{
+ uint64_t l, h;
+ muls64(&l, &h, arg1, arg2);
+ return h;
+}