changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: libmach: support for MOVP instruction disassembly for arm64

changeset 7220: f49283fe4c5f
parent 7219: 029d634f0e18
child 7221: d98974bc6c16
author: cinap_lenrek@felloff.net
date: Thu, 09 May 2019 10:24:37 +0200
files: sys/src/libmach/7db.c
description: libmach: support for MOVP instruction disassembly for arm64
     1.1--- a/sys/src/libmach/7db.c
     1.2+++ b/sys/src/libmach/7db.c
     1.3@@ -91,6 +91,7 @@ static Opcode opcodes[] =
     1.4 	"11111000000ooooooooo1111111ddddd",	"MOV",		"R%d,%o(SP)!",
     1.5 	"WW111000000ooooooooo1111111ddddd",	"MOV%WU",	"R%d,%o(SP)!",
     1.6 	"WW111000000ooooooooo11nnnnnddddd",	"MOV%WU",	"R%d,%o(R%n)!",
     1.7+
     1.8 	"11111000010ooooooooo0111111ddddd",	"MOV",		"(SP)%o!,R%d",
     1.9 	"11111000010ooooooooo01nnnnnddddd",	"MOV",		"(R%n)%o!,R%d",
    1.10 	"WW111000010ooooooooo0111111ddddd",	"MOV%WU",	"(SP)%o!,R%d",
    1.11@@ -114,6 +115,24 @@ static Opcode opcodes[] =
    1.12 	"W11100101ssKKKKKKKKKKKKKKKKddddd",	"MOVK%W",	"$%K,R%d",
    1.13 	"W0010001--00000000000011111ddddd",	"MOV%W",	"SP,R%d",
    1.14 	"W0010001--000000000000nnnnn11111",	"MOV%W",	"R%n,SP",
    1.15+	"0110100011ooooooommmmm11111ddddd",	"MOVPSW",	"(SP)%o!,R%d,R%m",
    1.16+	"0110100011ooooooommmmmnnnnnddddd",	"MOVPSW",	"(R%n)%o!,R%d,R%m",
    1.17+	"0110100101ooooooommmmm11111ddddd",	"MOVPSW",	"%o(SP),R%d,R%m",
    1.18+	"0110100101ooooooommmmmnnnnnddddd",	"MOVPSW",	"%o(R%n),R%d,R%m",
    1.19+	"0110100111ooooooommmmm11111ddddd",	"MOVPSW",	"%o(SP)!,R%d,R%m",
    1.20+	"0110100111ooooooommmmmnnnnnddddd",	"MOVPSW",	"%o(R%n)!,R%d,R%m",
    1.21+	"W010100010ooooooommmmm11111ddddd",	"MOVP%W",	"R%d,R%m,(SP)%o!",
    1.22+	"W010100010ooooooommmmmnnnnnddddd",	"MOVP%W",	"R%d,R%m,(R%n)%o!",
    1.23+	"W010100100ooooooommmmm11111ddddd",	"MOVP%W",	"R%d,R%m,%o(SP)",
    1.24+	"W010100100ooooooommmmmnnnnnddddd",	"MOVP%W",	"R%d,R%m,%o(R%n)",
    1.25+	"W010100110ooooooommmmm11111ddddd",	"MOVP%W",	"R%d,R%m,%o(SP)!",
    1.26+	"W010100110ooooooommmmmnnnnnddddd",	"MOVP%W",	"R%d,R%m,%o(R%n)!",
    1.27+	"W010100011ooooooommmmm11111ddddd",	"MOVP%W",	"(SP)%o!,R%d,R%m",
    1.28+	"W010100011ooooooommmmmnnnnnddddd",	"MOVP%W",	"(R%n)%o!,R%d,R%m",
    1.29+	"W010100101ooooooommmmm11111ddddd",	"MOVP%W",	"%o(SP),R%d,R%m",
    1.30+	"W010100101ooooooommmmmnnnnnddddd",	"MOVP%W",	"%o(R%n),R%d,R%m",
    1.31+	"W010100111ooooooommmmm11111ddddd",	"MOVP%W",	"%o(SP)!,R%d,R%m",
    1.32+	"W010100111ooooooommmmmnnnnnddddd",	"MOVP%W",	"%o(R%n)!,R%d,R%m",
    1.33 	"W0010001ssIIIIIIIIIIII1111111111",	"ADD%W",	"$%I,SP,SP",
    1.34 	"W0010001ssIIIIIIIIIIII11111ddddd",	"ADD%W",	"$%I,SP,R%d",
    1.35 	"W0010001ssIIIIIIIIIIIInnnnn11111",	"ADD%W",	"$%I,R%n,SP",
    1.36@@ -491,7 +510,8 @@ format(char *mnemonic, Instr *i, char *f
    1.37 			break;
    1.38 
    1.39 		case 'o':	// Signed byte offset
    1.40-			bprint(i, "%ld", sext(u, nbits(m)));
    1.41+			w = nbits(m);
    1.42+			bprint(i, "%ld", sext(u, w) << (w == 7 ? 2 + (i->w>>31) : 0));
    1.43 			break;
    1.44 		case 'u':	// Unsigned offset
    1.45 			u <<= (i->w >> 30)&3;