summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2019-03-06 23:17:50 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2019-03-06 23:19:28 +0100
commit2382a039ec6f3077a875985c51c707a03488126e (patch)
treef50be7cea6e36d6dd3aef08944aeb07f1a75cc62
parent0ab734a7b23c6a6d2cb4be944d385681024fdcab (diff)
beasm: Support modifier 'c' (plain immediate) in all remaining backends.
These backends do not have a prefix for immediates anyway, so besides accepting the modifier there is nothing to do.
-rw-r--r--NEWS.md2
-rw-r--r--ir/be/mips/mips_emitter.c3
-rw-r--r--ir/be/riscv/riscv_emitter.c3
-rw-r--r--ir/be/sparc/sparc_emitter.c3
4 files changed, 7 insertions, 4 deletions
diff --git a/NEWS.md b/NEWS.md
index 65f9776..f0a8970 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -8,7 +8,7 @@ libFirm 1.22.1 (2016-01-07)
* ia32: Generate `mov $~0x80000000, %r; ror x, %r` for `~(0x80000000 >> x)`
* be: Stub support for the asm constraint modifier `%`
* amd64, ia32: Support the asm constraint `e`
-* amd64, ia32: Support the asm modifier `c`
+* be: Support the asm modifier `c` in all backends
* ia32: Support JIT compilation
* be: Improve permutation moving for copy coalescing
* ir: Improve handling of negative overflow in float to int tarval conversion
diff --git a/ir/be/mips/mips_emitter.c b/ir/be/mips/mips_emitter.c
index ae0ba57..ac56fe9 100644
--- a/ir/be/mips/mips_emitter.c
+++ b/ir/be/mips/mips_emitter.c
@@ -102,8 +102,9 @@ static void emit_mips_asm_operand(ir_node const *const node, char const modifier
be_asm_attr_t const *const attr = get_be_asm_attr_const(node);
mips_asm_operand_t const *const op = &((mips_asm_operand_t const*)attr->operands)[pos];
/* modifiers:
+ * c: plain immediate
* z: print normally, except immediate 0 as '$zero' */
- if (!be_is_valid_asm_operand_kind(node, modifier, pos, op->op.kind, "z", "", ""))
+ if (!be_is_valid_asm_operand_kind(node, modifier, pos, op->op.kind, "z", "c", ""))
return;
switch (op->op.kind) {
diff --git a/ir/be/riscv/riscv_emitter.c b/ir/be/riscv/riscv_emitter.c
index b3ac409..d8d5614 100644
--- a/ir/be/riscv/riscv_emitter.c
+++ b/ir/be/riscv/riscv_emitter.c
@@ -105,9 +105,10 @@ static void emit_riscv_asm_operand(ir_node const *const node, char const modifie
riscv_asm_operand_t const *const op = &((riscv_asm_operand_t const*)attr->operands)[pos];
/* modifiers:
* R: %lo of immediate
+ * c: plain immediate
* h: %hi of immediate
* z: print normally, except immediate 0 as 'zero' */
- if (!be_is_valid_asm_operand_kind(node, modifier, pos, op->op.kind, "z", "Rh", ""))
+ if (!be_is_valid_asm_operand_kind(node, modifier, pos, op->op.kind, "z", "Rch", ""))
return;
switch (op->op.kind) {
diff --git a/ir/be/sparc/sparc_emitter.c b/ir/be/sparc/sparc_emitter.c
index 0845469..e51ccad 100644
--- a/ir/be/sparc/sparc_emitter.c
+++ b/ir/be/sparc/sparc_emitter.c
@@ -624,10 +624,11 @@ static void emit_sparc_asm_operand(ir_node const *const node, char const modifie
be_asm_attr_t const *const attr = get_be_asm_attr_const(node);
sparc_asm_operand_t const *const op = &((sparc_asm_operand_t const*)attr->operands)[pos];
/* modifiers:
+ * c: plain immediate
* f: memory reference without surrounding '[]'
* m: see 'f'
* r: immediate, but show '%g0' instead of '0' */
- if (!be_is_valid_asm_operand_kind(node, modifier, pos, op->op.kind, "r", "", "fm"))
+ if (!be_is_valid_asm_operand_kind(node, modifier, pos, op->op.kind, "r", "c", "fm"))
return;
switch (op->op.kind) {