summaryrefslogtreecommitdiff
path: root/sys/src/libmach/7db.c
diff options
context:
space:
mode:
authorSigrid Solveig Haflínudóttir <sigrid@ftrv.se>2023-05-10 20:57:17 +0000
committerSigrid Solveig Haflínudóttir <sigrid@ftrv.se>2023-05-10 20:57:17 +0000
commiteaf799e8c4e25df6953046544ec5ef5e36fc921a (patch)
treefd28fa72da0cd390b10581fff65f14df6b46de8e /sys/src/libmach/7db.c
parent6723fdf7b7c7fc3231bb1868139c768301ff03b9 (diff)
libmach/acid: add basic FP support for arm64
Diffstat (limited to 'sys/src/libmach/7db.c')
-rw-r--r--sys/src/libmach/7db.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/src/libmach/7db.c b/sys/src/libmach/7db.c
index e367c8255..f12432262 100644
--- a/sys/src/libmach/7db.c
+++ b/sys/src/libmach/7db.c
@@ -49,8 +49,8 @@ Machdata arm64mach =
riscframe, /* Frame finder */
arm64excep, /* print exception */
0, /* breakpoint fixup */
- 0, /* single precision float printer */
- 0, /* double precision float printer */
+ leieeesftos, /* single precision float printer */
+ leieeedftos, /* double precision float printer */
arm64foll, /* following addresses */
arm64inst, /* print instruction */
arm64das, /* dissembler */
@@ -258,6 +258,12 @@ static Opcode opcodes[] =
"11010101000000110100xxxx11111111", "MSR", "$%x,DAIFClr",
"11010101000YYYYYYYYYYYYYYYYddddd", "MSR", "R%d,%Y",
"11010101001YYYYYYYYYYYYYYYYddddd", "MRS", "%Y,R%d",
+ "FF11110101uuuuuuuuuuuu11111ddddd", "FMOV%F", "%u(SP),F%d",
+ "FF11110101uuuuuuuuuuuunnnnnddddd", "FMOV%F", "%u(R%n),F%d",
+ "FF111100010ooooooooo0011111ddddd", "FMOV%F", "%o(SP),F%d",
+ "FF111100010ooooooooo00nnnnnddddd", "FMOV%F", "%o(R%n),F%d",
+ "W0011110ZZ111000000000nnnnnddddd", "FCVTZS%Z%W", "F%n,R%d",
+ "W0011110ZZ111001000000nnnnnddddd", "FCVTZU%Z%W", "F%n,R%d",
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "WORD", "$%x",
};
@@ -471,6 +477,11 @@ format(char *mnemonic, Instr *i, char *f)
*i->curr++ = "BHW"[u];
break;
+ case 'F': // FP width
+ u &= 3;
+ *i->curr++ = "BHSD"[u];
+ break;
+
case 'd': // Register Numbers
case 'n':
case 'a':
@@ -592,6 +603,10 @@ format(char *mnemonic, Instr *i, char *f)
}
break;
+ case 'Z': // FP type
+ *i->curr++ = "SD?H"[u];
+ break;
+
case '\0':
*i->curr++ = '%';
return;