On 1/20/19 2:24 AM, Richard Henderson wrote:
On 1/19/19 12:14 AM, Bastian Koppelmann wrote:
  static bool trans_slli(DisasContext *ctx, arg_slli *a)
  {
-    gen_arith_imm(ctx, OPC_RISC_SLLI, a->rd, a->rs1, a->shamt);
+    if (a->rd != 0) {
+        TCGv t = tcg_temp_new();
+        gen_get_gpr(t, a->rs1);
+
+        if (a->shamt >= TARGET_LONG_BITS) {
+            return false;
+        }
I think the shmat test should be first, so that

        slli    r0, r1, 99

produces SIGILL instead of translating to a nop.


Oh, that is a very good catch. Thanks.


Cheers,

Bastian


Reply via email to