@@ -24,4 +24,5 @@ DEF_HELPER_2(normw, i32, env, i32)
DEF_HELPER_2(lr, tl, env, i32)
DEF_HELPER_2(sr, void, i32, i32)
DEF_HELPER_1(halt, void, env)
+DEF_HELPER_1(rtie, void, env)
@@ -416,4 +416,25 @@ void helper_halt(CPUARCState *env)
/* TODO: implement */
}
+void helper_rtie(CPUARCState *env)
+{
+ if (env->stat.AEf) {
+ CPU_PCL(env) = env->eret;
+ env->stat = env->stat_er;
+ env->bta = env->erbta;
+ } else if (env->stat.A2f) {
+ CPU_PCL(env) = CPU_ILINK2(env);
+ env->stat = env->stat_l2;
+ env->bta = env->bta_l2;
+ } else if (env->stat.A1f) {
+ CPU_PCL(env) = CPU_ILINK1(env);
+ env->stat = env->stat_l1;
+ env->bta = env->bta_l1;
+ } else {
+ CPU_PCL(env) = env->eret;
+ env->stat = env->stat_er;
+ env->bta = env->stat.AEf;
+ }
+}
+
@@ -2803,3 +2803,13 @@ int arc_gen_SWI(DisasCtxt *ctx)
return BS_EXCP;
}
+/*
+ RTIE
+*/
+int arc_gen_RTIE(DisasCtxt *ctx)
+{
+ gen_helper_rtie(cpu_env);
+
+ return BS_BRANCH;
+}
+
@@ -169,3 +169,5 @@ int arc_gen_UNIMP(DisasCtxt *c);
int arc_gen_SWI(DisasCtxt *c);
int arc_gen_TRAP(DisasCtxt *c, TCGv src1);
+int arc_gen_RTIE(DisasCtxt *c);
+
Signed-off-by: Michael Rolnik <mrolnik@gmail.com> --- target-arc/helper.h | 1 + target-arc/op_helper.c | 21 +++++++++++++++++++++ target-arc/translate-inst.c | 10 ++++++++++ target-arc/translate-inst.h | 2 ++ 4 files changed, 34 insertions(+)