]> xenbits.xensource.com Git - people/dariof/qemu-xen.git/commitdiff
target/openrisc: Implement l.adrp
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 26 Aug 2019 00:31:30 +0000 (17:31 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 4 Sep 2019 19:59:00 +0000 (12:59 -0700)
This was added to the 1.3 spec.

Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
target/openrisc/disas.c
target/openrisc/insns.decode
target/openrisc/translate.c

index e51cbb24c63c41dc3071c3813c4807259c9dfcf3..ce112640b95c8f00872f2c88bcbbb9d8539f5095 100644 (file)
@@ -98,6 +98,7 @@ INSN(sw,     "%d(r%d), r%d", a->i, a->a, a->b)
 INSN(sb,     "%d(r%d), r%d", a->i, a->a, a->b)
 INSN(sh,     "%d(r%d), r%d", a->i, a->a, a->b)
 INSN(nop,    "")
+INSN(adrp,   "r%d, %d", a->d, a->i)
 INSN(addi,   "r%d, r%d, %d", a->d, a->a, a->i)
 INSN(addic,  "r%d, r%d, %d", a->d, a->a, a->i)
 INSN(muli,   "r%d, r%d, %d", a->d, a->a, a->i)
index 71e0d740db61b54fec0ba6ab1d6677ff0b750558..0d6f7c29f82d4344ef09cd8b03bba66fc59a9a40 100644 (file)
@@ -102,6 +102,8 @@ l_maci          010011 ----- a:5 i:s16
 l_movhi         000110 d:5 ----0 k:16
 l_macrc         000110 d:5 ----1 00000000 00000000
 
+l_adrp          000010 d:5 i:s21
+
 ####
 # Arithmetic Instructions
 ####
index 6e8bc235682deb8ca4ea07584d334e1a8b34bcb9..6addbac8d633751d8126deec7ca20e4cd82aa875 100644 (file)
@@ -799,6 +799,19 @@ static bool trans_l_nop(DisasContext *dc, arg_l_nop *a)
     return true;
 }
 
+static bool trans_l_adrp(DisasContext *dc, arg_l_adrp *a)
+{
+    if (!check_v1_3(dc)) {
+        return false;
+    }
+    check_r0_write(dc, a->d);
+
+    tcg_gen_movi_i32(cpu_R(dc, a->d),
+                     (dc->base.pc_next & TARGET_PAGE_MASK) +
+                     ((target_long)a->i << TARGET_PAGE_BITS));
+    return true;
+}
+
 static bool trans_l_addi(DisasContext *dc, arg_rri *a)
 {
     TCGv t0;