From 3d75969bd0e2608dc2c23aeee3f2f597b44fa7cc Mon Sep 17 00:00:00 2001
From: Lulu Cai <cailulu@loongson.cn>
Date: Mon, 9 Dec 2024 11:21:40 +0800
Subject: LoongArch: Assign DWARF register numbers to register aliases

.cfi directives only support the use of register numbers and not
register names or aliases.

This commit adds support for 4 formats, for example:
  .cfi_offset r1, 8
  .cfi_offset ra, 8
  .cfi_offset $r1,8
  .cfi_offset $ra,8

The above .cfi directives are equivalent and all represent dwarf
register number 1.

Display register aliases as specified in the psABI during disassembly.
---
 include/opcode/loongarch.h | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'include/opcode')

diff --git a/include/opcode/loongarch.h b/include/opcode/loongarch.h
index 5425eaf..493fe9b 100644
--- a/include/opcode/loongarch.h
+++ b/include/opcode/loongarch.h
@@ -267,6 +267,10 @@ dec2 : [1-9][0-9]?
   extern const char *const loongarch_cr_normal_name[4];
   extern const char *const loongarch_v_normal_name[32];
   extern const char *const loongarch_x_normal_name[32];
+  extern const char *const loongarch_r_cfi_name[32];
+  extern const char *const loongarch_r_cfi_name_alias[32];
+  extern const char *const loongarch_f_cfi_name[32];
+  extern const char *const loongarch_f_cfi_name_alias[32];
 
   extern struct loongarch_ase loongarch_ASEs[];
 
-- 
cgit v1.1