summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beasm.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2018-05-04 22:51:43 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2018-05-05 07:17:17 +0200
commit7c549923dd25a12cde4316beb69f2c8783ae279d (patch)
tree6f3caa9c2169c2eeb207dd917a6efea06e9c096c /ir/be/beasm.c
parentaadee603435ee0abad189a915f8d22f4c895cc52 (diff)
be: Add mechanism for a architecture-specific name prefix for registers.
Diffstat (limited to 'ir/be/beasm.c')
-rw-r--r--ir/be/beasm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ir/be/beasm.c b/ir/be/beasm.c
index 2efe56a..0b210ce 100644
--- a/ir/be/beasm.c
+++ b/ir/be/beasm.c
@@ -429,20 +429,23 @@ bool be_is_valid_asm_operand_kind(ir_node const *const node, char const modifier
arch_register_t const *be_parse_register_name(char const *clobber)
{
+ arch_isa_if_t const *const isa = ir_target.isa;
+
/* GCC always accepts '#' and '%' as register name prefix.
* See strip_reg_name() in varasm.c. */
- if (clobber[0] == '#' || clobber[0] == '%')
+ char const c = clobber[0];
+ if (c == '#' || c == '%' || (isa->register_prefix != '\0' && c == isa->register_prefix))
clobber += 1;
arch_register_t const *const reg = arch_find_register(clobber);
if (reg)
return reg;
- be_register_name_t const *const add = ir_target.isa->additional_reg_names;
+ be_register_name_t const *const add = isa->additional_reg_names;
if (add) {
for (be_register_name_t const *i = add; i->name; ++i) {
if (streq(i->name, clobber))
- return &ir_target.isa->registers[i->index];
+ return &isa->registers[i->index];
}
}