summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beasm.h
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2018-05-09 20:08:14 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2018-05-09 20:08:14 +0200
commit720d6194c99202777977da756fac97c31b5ad887 (patch)
treec32f4a852bc469cf5d91f35a1c933fe6c21b4573 /ir/be/beasm.h
parent70a481eeb92b5af6a11bed0e74a849bad3d687fb (diff)
be: Factor out code to add an input to an asm node.
Diffstat (limited to 'ir/be/beasm.h')
-rw-r--r--ir/be/beasm.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ir/be/beasm.h b/ir/be/beasm.h
index 97d5ec4..3512d82 100644
--- a/ir/be/beasm.h
+++ b/ir/be/beasm.h
@@ -13,6 +13,7 @@
#include <assert.h>
#include <stdbool.h>
+#include "array.h"
#include "be_types.h"
#include "firm_types.h"
#include "obstack.h"
@@ -66,6 +67,14 @@ typedef struct be_asm_info_t {
be_asm_info_t be_asm_prepare_info(void);
+static inline void be_asm_add_in(be_asm_info_t *const info, be_asm_operand_t *const op, be_asm_operand_kind_t const kind, ir_node *const in, arch_register_req_t const *const req)
+{
+ assert(kind == BE_ASM_OPERAND_INPUT_VALUE || kind == BE_ASM_OPERAND_MEMORY);
+ be_set_asm_operand(op, kind, ARR_LEN(info->ins));
+ ARR_APP1(ir_node*, info->ins, in);
+ ARR_APP1(arch_register_req_t const*, info->in_reqs, req);
+}
+
ir_node *be_make_asm(ir_node const *node, be_asm_info_t const *info, void *operands);
typedef void be_emit_asm_operand_func(ir_node const *asmn, char modifier, unsigned pos);