Signed-off-by: Richard Henderson <[email protected]>
---
include/tcg/tcg-op-common.h | 2 --
include/tcg/tcg-op-def2.h.inc | 1 +
tcg/tcg-op.c | 37 ++++++++++++-----------------------
3 files changed, 14 insertions(+), 26 deletions(-)
diff --git a/include/tcg/tcg-op-common.h b/include/tcg/tcg-op-common.h
index b48e85f0b9c..831502dd994 100644
--- a/include/tcg/tcg-op-common.h
+++ b/include/tcg/tcg-op-common.h
@@ -121,7 +121,6 @@ void tcg_gen_plugin_mem_cb(TCGv_i64 addr, unsigned meminfo);
/* 32 bit ops */
-void tcg_gen_orc_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2);
void tcg_gen_clz_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2);
void tcg_gen_ctz_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2);
void tcg_gen_clzi_i32(TCGv_i32 ret, TCGv_i32 arg1, uint32_t arg2);
@@ -195,7 +194,6 @@ void tcg_gen_st_i32(TCGv_i32 arg1, TCGv_ptr arg2,
tcg_target_long offset);
/* 64 bit ops */
-void tcg_gen_orc_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2);
void tcg_gen_clz_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2);
void tcg_gen_ctz_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2);
void tcg_gen_clzi_i64(TCGv_i64 ret, TCGv_i64 arg1, uint64_t arg2);
diff --git a/include/tcg/tcg-op-def2.h.inc b/include/tcg/tcg-op-def2.h.inc
index 055e98672d6..bad7f4753c1 100644
--- a/include/tcg/tcg-op-def2.h.inc
+++ b/include/tcg/tcg-op-def2.h.inc
@@ -25,6 +25,7 @@ DEF_RRR(mul)
DEF_RRR(nand)
DEF_RRR(nor)
DEF_RRR(or)
+DEF_RRR(orc)
DEF_RRR(rem)
DEF_RRR(remu)
DEF_RRR(sar)
diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index 87fb5fb5f51..233ecdc5b98 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -534,6 +534,19 @@ static void gen_ori(TCGType type, TCGTemp *dst, TCGTemp
*src1, int64_t src2)
}
}
+static void gen_orc(TCGType type, TCGTemp *dst, TCGTemp *src1, TCGTemp *src2)
+{
+ if (tcg_op_supported(INDEX_op_orc, type, 0)) {
+ gen_op_ttt(INDEX_op_orc, type, dst, src1, src2);
+ } else {
+ TCGTemp *tmp = tcg_temp_new_internal(type, TEMP_EBB);
+
+ gen_not(type, tmp, src2);
+ gen_or(type, dst, src1, tmp);
+ tcg_temp_free_internal(tmp);
+ }
+}
+
static void gen_rem(TCGType type, TCGTemp *dst, TCGTemp *src1, TCGTemp *src2)
{
if (tcg_op_supported(INDEX_op_rems, type, 0)) {
@@ -753,18 +766,6 @@ void tcg_gen_negsetcondi_i32(TCGCond cond, TCGv_i32 ret,
tcg_gen_negsetcond_i32(cond, ret, arg1, tcg_constant_i32(arg2));
}
-void tcg_gen_orc_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2)
-{
- if (tcg_op_supported(INDEX_op_orc, TCG_TYPE_I32, 0)) {
- tcg_gen_op3_i32(INDEX_op_orc, ret, arg1, arg2);
- } else {
- TCGv_i32 t0 = tcg_temp_ebb_new_i32();
- tcg_gen_not_i32(t0, arg2);
- tcg_gen_or_i32(ret, arg1, t0);
- tcg_temp_free_i32(t0);
- }
-}
-
void tcg_gen_clz_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2)
{
if (tcg_op_supported(INDEX_op_clz, TCG_TYPE_I32, 0)) {
@@ -1770,18 +1771,6 @@ void tcg_gen_revbit64_i64(TCGv_i64 ret, TCGv_i64 arg)
}
}
-void tcg_gen_orc_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2)
-{
- if (tcg_op_supported(INDEX_op_orc, TCG_TYPE_I64, 0)) {
- tcg_gen_op3_i64(INDEX_op_orc, ret, arg1, arg2);
- } else {
- TCGv_i64 t0 = tcg_temp_ebb_new_i64();
- tcg_gen_not_i64(t0, arg2);
- tcg_gen_or_i64(ret, arg1, t0);
- tcg_temp_free_i64(t0);
- }
-}
-
void tcg_gen_clz_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2)
{
if (tcg_op_supported(INDEX_op_clz, TCG_TYPE_I64, 0)) {
--
2.53.0