From 944eea962be94b98f8f6f570f9c4eb3b58dc296d Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 7 Apr 2014 23:08:47 -0700 Subject: tcg: Push tcg-runtime routines into exec/helper-* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rather than special casing them, use the standard mechanisms for tcg helper generation. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg-runtime.c | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'tcg-runtime.c') diff --git a/tcg-runtime.c b/tcg-runtime.c index 4b66e51..9daba69 100644 --- a/tcg-runtime.c +++ b/tcg-runtime.c @@ -23,75 +23,85 @@ */ #include #include "qemu/host-utils.h" -#include "tcg/tcg-runtime.h" + +/* This file is compiled once, and thus we can't include the standard + "exec/helper-proto.h", which has includes that are target specific. */ + +#include "exec/helper-head.h" + +#define DEF_HELPER_FLAGS_2(name, flags, ret, t1, t2) \ + dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2)); + +#include "tcg-runtime.h" + /* 32-bit helpers */ -int32_t tcg_helper_div_i32(int32_t arg1, int32_t arg2) +int32_t HELPER(div_i32)(int32_t arg1, int32_t arg2) { return arg1 / arg2; } -int32_t tcg_helper_rem_i32(int32_t arg1, int32_t arg2) +int32_t HELPER(rem_i32)(int32_t arg1, int32_t arg2) { return arg1 % arg2; } -uint32_t tcg_helper_divu_i32(uint32_t arg1, uint32_t arg2) +uint32_t HELPER(divu_i32)(uint32_t arg1, uint32_t arg2) { return arg1 / arg2; } -uint32_t tcg_helper_remu_i32(uint32_t arg1, uint32_t arg2) +uint32_t HELPER(remu_i32)(uint32_t arg1, uint32_t arg2) { return arg1 % arg2; } /* 64-bit helpers */ -int64_t tcg_helper_shl_i64(int64_t arg1, int64_t arg2) +uint64_t HELPER(shl_i64)(uint64_t arg1, uint64_t arg2) { return arg1 << arg2; } -int64_t tcg_helper_shr_i64(int64_t arg1, int64_t arg2) +uint64_t HELPER(shr_i64)(uint64_t arg1, uint64_t arg2) { - return (uint64_t)arg1 >> arg2; + return arg1 >> arg2; } -int64_t tcg_helper_sar_i64(int64_t arg1, int64_t arg2) +int64_t HELPER(sar_i64)(int64_t arg1, int64_t arg2) { return arg1 >> arg2; } -int64_t tcg_helper_div_i64(int64_t arg1, int64_t arg2) +int64_t HELPER(div_i64)(int64_t arg1, int64_t arg2) { return arg1 / arg2; } -int64_t tcg_helper_rem_i64(int64_t arg1, int64_t arg2) +int64_t HELPER(rem_i64)(int64_t arg1, int64_t arg2) { return arg1 % arg2; } -uint64_t tcg_helper_divu_i64(uint64_t arg1, uint64_t arg2) +uint64_t HELPER(divu_i64)(uint64_t arg1, uint64_t arg2) { return arg1 / arg2; } -uint64_t tcg_helper_remu_i64(uint64_t arg1, uint64_t arg2) +uint64_t 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 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) +int64_t HELPER(mulsh_i64)(int64_t arg1, int64_t arg2) { uint64_t l, h; muls64(&l, &h, arg1, arg2); -- cgit v1.1