diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2014-12-04 22:59:30 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2014-12-04 22:59:30 (GMT) |
commit | 12154652c576144405011b5bd267c15c9667f223 (patch) | |
tree | be552b2b7bc563a58892e8950afd920a45132a6e /src/arch/arm | |
parent | 6803c5d5b86416d1748d4d37a5cc5cb44fe007b1 (diff) |
Provided a new way to build the full name of each instruction and cached it.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@435 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/arm')
-rw-r--r-- | src/arch/arm/instruction.c | 23 | ||||
-rw-r--r-- | src/arch/arm/v7/opdefs/mov_A88102.d | 2 |
2 files changed, 18 insertions, 7 deletions
diff --git a/src/arch/arm/instruction.c b/src/arch/arm/instruction.c index b46cab0..6ce115c 100644 --- a/src/arch/arm/instruction.c +++ b/src/arch/arm/instruction.c @@ -24,7 +24,11 @@ #include "instruction.h" +#include <string.h> + + #include "instruction-int.h" +#include "../../common/extstr.h" @@ -40,8 +44,8 @@ static void g_arm_instruction_dispose(GArmInstruction *); /* Procède à la libération totale de la mémoire. */ static void g_arm_instruction_finalize(GArmInstruction *); -/* Fournit le nom humain de l'instruction manipulée. */ -static const char *g_arm_instruction_get_keyword(const GArmInstruction *, AsmSyntax); +/* Reconstruit le cache complet d'une désignation d'instruction. */ +static void g_arm_instruction_build_keyword(const GArmInstruction *, AsmSyntax); @@ -72,7 +76,7 @@ static void g_arm_instruction_class_init(GArmInstructionClass *klass) object_class->dispose = (GObjectFinalizeFunc/* ! */)g_arm_instruction_dispose; object_class->finalize = (GObjectFinalizeFunc)g_arm_instruction_finalize; - instr->get_key = (get_instruction_keyword_fc)g_arm_instruction_get_keyword; + instr->build_key = (build_instruction_keyword_fc)g_arm_instruction_build_keyword; } @@ -138,7 +142,7 @@ static void g_arm_instruction_finalize(GArmInstruction *instr) * Paramètres : instr = instruction à traiter. * * syntax = type de représentation demandée. * * * -* Description : Fournit le nom humain de l'instruction manipulée. * +* Description : Reconstruit le cache complet d'une désignation d'instruction.* * * * Retour : Mot clef de bas niveau. * * * @@ -146,9 +150,16 @@ static void g_arm_instruction_finalize(GArmInstruction *instr) * * ******************************************************************************/ -static const char *g_arm_instruction_get_keyword(const GArmInstruction *instr, AsmSyntax syntax) +static void g_arm_instruction_build_keyword(const GArmInstruction *instr, AsmSyntax syntax) { - return instr->keyword; + GArchInstruction *base; /* Instruction, vue générique */ + + base = G_ARCH_INSTRUCTION(instr); + + base->cached_keyword = strdup(instr->keyword); + + if (base->suffix != NULL) + base->cached_keyword = stradd(base->cached_keyword, base->suffix); } diff --git a/src/arch/arm/v7/opdefs/mov_A88102.d b/src/arch/arm/v7/opdefs/mov_A88102.d index dcafc73..a71969f 100644 --- a/src/arch/arm/v7/opdefs/mov_A88102.d +++ b/src/arch/arm/v7/opdefs/mov_A88102.d @@ -42,7 +42,7 @@ @word 1 1 1 1 0 i(1) 0 0 0 1 0 S(1) 1 1 1 1 0 imm3(3) Rd(4) imm8(8) - @syntax {S} <Rd> <const> + @syntax {S} ".W" <Rd> <const> @conv { |