This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] FT32: add macros for interpreting binary instructions
- From: James Bowman <james dot bowman at ftdichip dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Sat, 26 Sep 2015 00:20:26 +0000
- Subject: [PATCH] FT32: add macros for interpreting binary instructions
- Authentication-results: sourceware.org; auth=none
This patch defines macros for instruction recognition. Other places
(e.g. the gdb stack unwinder) can use these instead of hard-coded
patterns.
OK to apply?
[include/Changelog]
2015-09-26 James Bowman <james.bowman@ftdichip.com>
* opcode/ft32.h: Add instruction macros FT32_*()
diff --git a/include/opcode/ft32.h b/include/opcode/ft32.h
index 9617890..6db46d9 100644
--- a/include/opcode/ft32.h
+++ b/include/opcode/ft32.h
@@ -96,5 +96,11 @@ typedef struct ft32_opc_info_t
#define FT32_FLD_AL_BIT 0
#define FT32_FLD_AL_SIZ 4
+#define FT32_IS_CALL(inst) (((inst) & 0xfffc0000) == 0x00340000)
+#define FT32_IS_PUSH(inst) (((inst) & 0xfff00000) == 0x84000000)
+#define FT32_PUSH_REG(inst) (((inst) >> 15) & 0x1f)
+#define FT32_IS_LINK(inst) (((inst) & 0xffff0000) == 0x95d00000)
+#define FT32_LINK_SIZE(inst) ((inst) & 0xffff)
+
#define FT32_FLD_R_D_POST (1 << 17)
#define FT32_FLD_R_1_POST (1 << 18)