[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/10 v10] target-tilegx: Add helper features for li
From: |
Chen Gang |
Subject: |
[Qemu-devel] [PATCH 08/10 v10] target-tilegx: Add helper features for linux-user |
Date: |
Mon, 11 May 2015 06:44:55 +0800 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
Add several helpers for translation.
Signed-off-by: Chen Gang <address@hidden>
---
target-tilegx/helper.c | 41 +++++++++++++++++++++++++++++++++++++++++
target-tilegx/helper.h | 3 +++
2 files changed, 44 insertions(+)
create mode 100644 target-tilegx/helper.c
create mode 100644 target-tilegx/helper.h
diff --git a/target-tilegx/helper.c b/target-tilegx/helper.c
new file mode 100644
index 0000000..5fc53a8
--- /dev/null
+++ b/target-tilegx/helper.c
@@ -0,0 +1,41 @@
+/*
+ * QEMU TILE-Gx helpers
+ *
+ * Copyright (c) 2015 Chen Gang
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+#include "cpu.h"
+#include "qemu-common.h"
+#include "exec/helper-proto.h"
+
+void helper_exception(CPUTLGState *env, uint32_t excp)
+{
+ CPUState *cs = CPU(tilegx_env_get_cpu(env));
+
+ cs->exception_index = excp;
+ cpu_loop_exit(cs);
+}
+
+uint64_t helper_cntlz(uint64_t arg)
+{
+ return clz64(arg);
+}
+
+uint64_t helper_cnttz(uint64_t arg)
+{
+ return ctz64(arg);
+}
diff --git a/target-tilegx/helper.h b/target-tilegx/helper.h
new file mode 100644
index 0000000..15f841f
--- /dev/null
+++ b/target-tilegx/helper.h
@@ -0,0 +1,3 @@
+DEF_HELPER_2(exception, noreturn, env, i32)
+DEF_HELPER_FLAGS_1(cntlz, TCG_CALL_NO_RWG_SE, i64, i64)
+DEF_HELPER_FLAGS_1(cnttz, TCG_CALL_NO_RWG_SE, i64, i64)
--
1.9.3
- [Qemu-devel] [PATCH 00/10 v10] tilegx: Firstly add tilegx target for linux-user, Chen Gang, 2015/05/10
- [Qemu-devel] [PATCH 01/10 v10] linux-user: tilegx: Firstly add architecture related features, Chen Gang, 2015/05/10
- [Qemu-devel] [PATCH 02/10 v10] linux-user: Support tilegx architecture in linux-user, Chen Gang, 2015/05/10
- [Qemu-devel] [PATCH 03/10 v10] linux-user/syscall.c: Conditionalize syscalls which are not defined in tilegx, Chen Gang, 2015/05/10
- [Qemu-devel] [PATCH 04/10 v10] target-tilegx: Add opcode basic implementation from Tilera Corporation, Chen Gang, 2015/05/10
- [Qemu-devel] [PATCH 06/10 v10] target-tilegx: Add special register information from Tilera Corporation, Chen Gang, 2015/05/10
- [Qemu-devel] [PATCH 07/10 v10] target-tilegx: Add cpu basic features for linux-user, Chen Gang, 2015/05/10
- [Qemu-devel] [PATCH 08/10 v10] target-tilegx: Add helper features for linux-user,
Chen Gang <=
- [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib, Chen Gang, 2015/05/10
- Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib, Richard Henderson, 2015/05/11
- Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib, Chen Gang, 2015/05/14
- Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib, Chen Gang, 2015/05/14
- Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib, Chen Gang, 2015/05/14
- Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib, Chen Gang, 2015/05/14
- Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib, Chen Gang, 2015/05/29
[Qemu-devel] [PATCH 10/10 v10] target-tilegx: Add TILE-Gx building files, Chen Gang, 2015/05/10