Re: [Qemu-devel] [PATCH RFC v1 24/29] target-arc: NOP, UNIMP

2016-09-20 Thread Richard Henderson

On 09/08/2016 03:32 PM, Michael Rolnik wrote:

+int arc_gen_UNIMP(DisasCtxt *ctx)
+{
+/* PC = INT_VECTOR_BACE + 0x10 */
+tcg_gen_andi_tl(cpu_pc, cpu_intvec, 0xffc0);
+tcg_gen_addi_tl(cpu_pc, cpu_pc, 0x10);
+
+return  BS_EXCP;
+}


This should be done via an exception, with the pc change done in do_interrupt.


r~



[Qemu-devel] [PATCH RFC v1 24/29] target-arc: NOP, UNIMP

2016-09-08 Thread Michael Rolnik
Signed-off-by: Michael Rolnik 
---
 target-arc/translate-inst.c | 20 
 target-arc/translate-inst.h |  2 ++
 2 files changed, 22 insertions(+)

diff --git a/target-arc/translate-inst.c b/target-arc/translate-inst.c
index 9d0f195..4c4318f 100644
--- a/target-arc/translate-inst.c
+++ b/target-arc/translate-inst.c
@@ -2678,3 +2678,23 @@ int arc_gen_SLEEP(DisasCtxt *ctx, TCGv src1)
 return  BS_BREAK;
 }
 
+/*
+NOP
+*/
+int arc_gen_NOP(DisasCtxt *ctx)
+{
+/*  literally no operation  */
+return  BS_NONE;
+}
+
+/*
+UNIMP
+*/
+int arc_gen_UNIMP(DisasCtxt *ctx)
+{
+/* PC = INT_VECTOR_BACE + 0x10 */
+tcg_gen_andi_tl(cpu_pc, cpu_intvec, 0xffc0);
+tcg_gen_addi_tl(cpu_pc, cpu_pc, 0x10);
+
+return  BS_EXCP;
+}
diff --git a/target-arc/translate-inst.h b/target-arc/translate-inst.h
index 5794cad..9f88d03 100644
--- a/target-arc/translate-inst.h
+++ b/target-arc/translate-inst.h
@@ -163,3 +163,5 @@ int arc_gen_SLEEP(DisasCtxt *c, TCGv src1);
 int arc_gen_BRK(DisasCtxt *c);
 int arc_gen_FLAG(DisasCtxt *c, TCGv src1);
 
+int arc_gen_NOP(DisasCtxt *c);
+int arc_gen_UNIMP(DisasCtxt *c);
-- 
2.4.9 (Apple Git-60)