eliminate the unnecessary and especially confusing concept of a 'code_generator'...
[libfirm] / ir / be / arm / bearch_arm.c
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief   The main arm backend driver file.
23  * @author  Matthias Braun, Oliver Richter, Tobias Gneist
24  * @version $Id$
25  */
26 #include "config.h"
27
28 #include "lc_opts.h"
29 #include "lc_opts_enum.h"
30
31 #include "irgwalk.h"
32 #include "irprog.h"
33 #include "irprintf.h"
34 #include "ircons.h"
35 #include "irgmod.h"
36 #include "irgopt.h"
37 #include "iroptimize.h"
38 #include "irdump.h"
39 #include "lowering.h"
40 #include "error.h"
41
42 #include "bitset.h"
43 #include "debug.h"
44 #include "array_t.h"
45 #include "irtools.h"
46
47 #include "../bearch.h"
48 #include "../benode.h"
49 #include "../belower.h"
50 #include "../besched.h"
51 #include "be.h"
52 #include "../bemachine.h"
53 #include "../beilpsched.h"
54 #include "../bemodule.h"
55 #include "../beirg.h"
56 #include "../bespillslots.h"
57 #include "../begnuas.h"
58 #include "../belistsched.h"
59 #include "../beflags.h"
60
61 #include "bearch_arm_t.h"
62
63 #include "arm_new_nodes.h"
64 #include "gen_arm_regalloc_if.h"
65 #include "arm_transform.h"
66 #include "arm_optimize.h"
67 #include "arm_emitter.h"
68 #include "arm_map_regs.h"
69
70 static arch_irn_class_t arm_classify(const ir_node *irn)
71 {
72         (void) irn;
73         /* TODO: we should mark reload/spill instructions and classify them here */
74         return 0;
75 }
76
77 static ir_entity *arm_get_frame_entity(const ir_node *irn)
78 {
79         const arm_attr_t *attr = get_arm_attr_const(irn);
80
81         if (is_arm_FrameAddr(irn)) {
82                 const arm_SymConst_attr_t *attr = get_irn_generic_attr_const(irn);
83                 return attr->entity;
84         }
85         if (attr->is_load_store) {
86                 const arm_load_store_attr_t *load_store_attr
87                         = get_arm_load_store_attr_const(irn);
88                 if (load_store_attr->is_frame_entity) {
89                         return load_store_attr->entity;
90                 }
91         }
92         return NULL;
93 }
94
95 /**
96  * This function is called by the generic backend to correct offsets for
97  * nodes accessing the stack.
98  */
99 static void arm_set_stack_bias(ir_node *irn, int bias)
100 {
101         if (is_arm_FrameAddr(irn)) {
102                 arm_SymConst_attr_t *attr = get_irn_generic_attr(irn);
103                 attr->fp_offset += bias;
104         } else {
105                 arm_load_store_attr_t *attr = get_arm_load_store_attr(irn);
106                 assert(attr->base.is_load_store);
107                 attr->offset += bias;
108         }
109 }
110
111 static int arm_get_sp_bias(const ir_node *irn)
112 {
113         /* We don't have any nodes changing the stack pointer.
114            We probably want to support post-/pre increment/decrement later */
115         (void) irn;
116         return 0;
117 }
118
119 /* fill register allocator interface */
120
121 static const arch_irn_ops_t arm_irn_ops = {
122         arm_classify,
123         arm_get_frame_entity,
124         arm_set_stack_bias,
125         arm_get_sp_bias,
126         NULL,    /* get_inverse             */
127         NULL,    /* get_op_estimated_cost   */
128         NULL,    /* possible_memory_operand */
129         NULL,    /* perform_memory_operand  */
130 };
131
132 /**
133  * Transforms the standard Firm graph into
134  * a ARM firm graph.
135  */
136 static void arm_prepare_graph(ir_graph *irg)
137 {
138         /* transform nodes into assembler instructions */
139         arm_transform_graph(irg);
140
141         /* do local optimizations (mainly CSE) */
142         local_optimize_graph(irg);
143
144         /* do code placement, to optimize the position of constants */
145         place_code(irg);
146 }
147
148 /**
149  * Called immediately before emit phase.
150  */
151 static void arm_finish_irg(ir_graph *irg)
152 {
153         /* do peephole optimizations and fix stack offsets */
154         arm_peephole_optimization(irg);
155 }
156
157 static void arm_before_ra(ir_graph *irg)
158 {
159         be_sched_fix_flags(irg, &arm_reg_classes[CLASS_arm_flags], NULL, NULL);
160 }
161
162 static void transform_Reload(ir_node *node)
163 {
164         ir_node   *block  = get_nodes_block(node);
165         dbg_info  *dbgi   = get_irn_dbg_info(node);
166         ir_node   *ptr    = get_irn_n(node, be_pos_Reload_frame);
167         ir_node   *mem    = get_irn_n(node, be_pos_Reload_mem);
168         ir_mode   *mode   = get_irn_mode(node);
169         ir_entity *entity = be_get_frame_entity(node);
170         const arch_register_t *reg;
171         ir_node   *proj;
172         ir_node   *load;
173
174         ir_node  *sched_point = sched_prev(node);
175
176         load = new_bd_arm_Ldr(dbgi, block, ptr, mem, mode, entity, false, 0, true);
177         sched_add_after(sched_point, load);
178         sched_remove(node);
179
180         proj = new_rd_Proj(dbgi, load, mode, pn_arm_Ldr_res);
181
182         reg = arch_get_irn_register(node);
183         arch_set_irn_register(proj, reg);
184
185         exchange(node, proj);
186 }
187
188 static void transform_Spill(ir_node *node)
189 {
190         ir_node   *block  = get_nodes_block(node);
191         dbg_info  *dbgi   = get_irn_dbg_info(node);
192         ir_node   *ptr    = get_irn_n(node, be_pos_Spill_frame);
193         ir_node   *mem    = new_NoMem();
194         ir_node   *val    = get_irn_n(node, be_pos_Spill_val);
195         ir_mode   *mode   = get_irn_mode(val);
196         ir_entity *entity = be_get_frame_entity(node);
197         ir_node   *sched_point;
198         ir_node   *store;
199
200         sched_point = sched_prev(node);
201         store = new_bd_arm_Str(dbgi, block, ptr, val, mem, mode, entity, false, 0,
202                                true);
203
204         sched_remove(node);
205         sched_add_after(sched_point, store);
206
207         exchange(node, store);
208 }
209
210 static void arm_after_ra_walker(ir_node *block, void *data)
211 {
212         ir_node *node, *prev;
213         (void) data;
214
215         for (node = sched_last(block); !sched_is_begin(node); node = prev) {
216                 prev = sched_prev(node);
217
218                 if (be_is_Reload(node)) {
219                         transform_Reload(node);
220                 } else if (be_is_Spill(node)) {
221                         transform_Spill(node);
222                 }
223         }
224 }
225
226 static void arm_collect_frame_entity_nodes(ir_node *node, void *data)
227 {
228         be_fec_env_t  *env = data;
229         const ir_mode *mode;
230         int            align;
231         ir_entity     *entity;
232         const arm_load_store_attr_t *attr;
233
234         if (be_is_Reload(node) && be_get_frame_entity(node) == NULL) {
235                 mode  = get_irn_mode(node);
236                 align = get_mode_size_bytes(mode);
237                 be_node_needs_frame_entity(env, node, mode, align);
238                 return;
239         }
240
241         switch (get_arm_irn_opcode(node)) {
242         case iro_arm_Ldf:
243         case iro_arm_Ldr:
244                 break;
245         default:
246                 return;
247         }
248
249         attr   = get_arm_load_store_attr_const(node);
250         entity = attr->entity;
251         mode   = attr->load_store_mode;
252         align  = get_mode_size_bytes(mode);
253         if (entity != NULL)
254                 return;
255         if (!attr->is_frame_entity)
256                 return;
257         be_node_needs_frame_entity(env, node, mode, align);
258 }
259
260 static void arm_set_frame_entity(ir_node *node, ir_entity *entity)
261 {
262         if (is_be_node(node)) {
263                 be_node_set_frame_entity(node, entity);
264         } else {
265                 arm_load_store_attr_t *attr = get_arm_load_store_attr(node);
266                 attr->entity = entity;
267         }
268 }
269
270 static void arm_after_ra(ir_graph *irg)
271 {
272         be_fec_env_t *fec_env = be_new_frame_entity_coalescer(irg);
273
274         irg_walk_graph(irg, NULL, arm_collect_frame_entity_nodes, fec_env);
275         be_assign_entities(fec_env, arm_set_frame_entity);
276         be_free_frame_entity_coalescer(fec_env);
277
278         irg_block_walk_graph(irg, NULL, arm_after_ra_walker, NULL);
279 }
280
281 /**
282  * Initializes the code generator.
283  */
284 static void arm_init_graph(ir_graph *irg)
285 {
286         (void) irg;
287 }
288
289
290 /**
291  * Maps all intrinsic calls that the backend support
292  * and map all instructions the backend did not support
293  * to runtime calls.
294  */
295 static void arm_handle_intrinsics(void)
296 {
297         ir_type *tp, *int_tp, *uint_tp;
298         i_record records[8];
299         int n_records = 0;
300
301         runtime_rt rt_iDiv, rt_uDiv, rt_iMod, rt_uMod;
302
303 #define ID(x) new_id_from_chars(x, sizeof(x)-1)
304
305         int_tp  = get_type_for_mode(mode_Is);
306         uint_tp = get_type_for_mode(mode_Iu);
307
308         /* ARM has neither a signed div instruction ... */
309         {
310                 i_instr_record *map_Div = &records[n_records++].i_instr;
311
312                 tp = new_type_method(2, 1);
313                 set_method_param_type(tp, 0, int_tp);
314                 set_method_param_type(tp, 1, int_tp);
315                 set_method_res_type(tp, 0, int_tp);
316
317                 rt_iDiv.ent             = new_entity(get_glob_type(), ID("__divsi3"), tp);
318                 set_entity_ld_ident(rt_iDiv.ent, ID("__divsi3"));
319                 rt_iDiv.mode            = mode_T;
320                 rt_iDiv.res_mode        = mode_Is;
321                 rt_iDiv.mem_proj_nr     = pn_Div_M;
322                 rt_iDiv.regular_proj_nr = pn_Div_X_regular;
323                 rt_iDiv.exc_proj_nr     = pn_Div_X_except;
324                 rt_iDiv.exc_mem_proj_nr = pn_Div_M;
325                 rt_iDiv.res_proj_nr     = pn_Div_res;
326
327                 add_entity_linkage(rt_iDiv.ent, IR_LINKAGE_CONSTANT);
328                 set_entity_visibility(rt_iDiv.ent, ir_visibility_external);
329
330                 map_Div->kind     = INTRINSIC_INSTR;
331                 map_Div->op       = op_Div;
332                 map_Div->i_mapper = (i_mapper_func)i_mapper_RuntimeCall;
333                 map_Div->ctx      = &rt_iDiv;
334         }
335         /* ... nor an unsigned div instruction ... */
336         {
337                 i_instr_record *map_Div = &records[n_records++].i_instr;
338
339                 tp = new_type_method(2, 1);
340                 set_method_param_type(tp, 0, uint_tp);
341                 set_method_param_type(tp, 1, uint_tp);
342                 set_method_res_type(tp, 0, uint_tp);
343
344                 rt_uDiv.ent             = new_entity(get_glob_type(), ID("__udivsi3"), tp);
345                 set_entity_ld_ident(rt_uDiv.ent, ID("__udivsi3"));
346                 rt_uDiv.mode            = mode_T;
347                 rt_uDiv.res_mode        = mode_Iu;
348                 rt_uDiv.mem_proj_nr     = pn_Div_M;
349                 rt_uDiv.regular_proj_nr = pn_Div_X_regular;
350                 rt_uDiv.exc_proj_nr     = pn_Div_X_except;
351                 rt_uDiv.exc_mem_proj_nr = pn_Div_M;
352                 rt_uDiv.res_proj_nr     = pn_Div_res;
353
354                 set_entity_visibility(rt_uDiv.ent, ir_visibility_external);
355
356                 map_Div->kind     = INTRINSIC_INSTR;
357                 map_Div->op       = op_Div;
358                 map_Div->i_mapper = (i_mapper_func)i_mapper_RuntimeCall;
359                 map_Div->ctx      = &rt_uDiv;
360         }
361         /* ... nor a signed mod instruction ... */
362         {
363                 i_instr_record *map_Mod = &records[n_records++].i_instr;
364
365                 tp = new_type_method(2, 1);
366                 set_method_param_type(tp, 0, int_tp);
367                 set_method_param_type(tp, 1, int_tp);
368                 set_method_res_type(tp, 0, int_tp);
369
370                 rt_iMod.ent             = new_entity(get_glob_type(), ID("__modsi3"), tp);
371                 set_entity_ld_ident(rt_iMod.ent, ID("__modsi3"));
372                 rt_iMod.mode            = mode_T;
373                 rt_iMod.res_mode        = mode_Is;
374                 rt_iMod.mem_proj_nr     = pn_Mod_M;
375                 rt_iMod.regular_proj_nr = pn_Mod_X_regular;
376                 rt_iMod.exc_proj_nr     = pn_Mod_X_except;
377                 rt_iMod.exc_mem_proj_nr = pn_Mod_M;
378                 rt_iMod.res_proj_nr     = pn_Mod_res;
379
380                 set_entity_visibility(rt_iMod.ent, ir_visibility_external);
381
382                 map_Mod->kind     = INTRINSIC_INSTR;
383                 map_Mod->op       = op_Mod;
384                 map_Mod->i_mapper = (i_mapper_func)i_mapper_RuntimeCall;
385                 map_Mod->ctx      = &rt_iMod;
386         }
387         /* ... nor an unsigned mod. */
388         {
389                 i_instr_record *map_Mod = &records[n_records++].i_instr;
390
391                 tp = new_type_method(2, 1);
392                 set_method_param_type(tp, 0, uint_tp);
393                 set_method_param_type(tp, 1, uint_tp);
394                 set_method_res_type(tp, 0, uint_tp);
395
396                 rt_uMod.ent             = new_entity(get_glob_type(), ID("__umodsi3"), tp);
397                 set_entity_ld_ident(rt_uMod.ent, ID("__umodsi3"));
398                 rt_uMod.mode            = mode_T;
399                 rt_uMod.res_mode        = mode_Iu;
400                 rt_uMod.mem_proj_nr     = pn_Mod_M;
401                 rt_uMod.regular_proj_nr = pn_Mod_X_regular;
402                 rt_uMod.exc_proj_nr     = pn_Mod_X_except;
403                 rt_uMod.exc_mem_proj_nr = pn_Mod_M;
404                 rt_uMod.res_proj_nr     = pn_Mod_res;
405
406                 set_entity_visibility(rt_uMod.ent, ir_visibility_external);
407
408                 map_Mod->kind     = INTRINSIC_INSTR;
409                 map_Mod->op       = op_Mod;
410                 map_Mod->i_mapper = (i_mapper_func)i_mapper_RuntimeCall;
411                 map_Mod->ctx      = &rt_uMod;
412         }
413
414         if (n_records > 0)
415                 lower_intrinsics(records, n_records, /*part_block_used=*/0);
416 }
417
418 const arch_isa_if_t arm_isa_if;
419 static arm_isa_t arm_isa_template = {
420         {
421                 &arm_isa_if,           /* isa interface */
422                 &arm_gp_regs[REG_SP],  /* stack pointer */
423                 &arm_gp_regs[REG_R11], /* base pointer */
424                 &arm_reg_classes[CLASS_arm_gp],  /* static link pointer class */
425                 -1,                    /* stack direction */
426                 2,                     /* power of two stack alignment for calls, 2^2 == 4 */
427                 NULL,                  /* main environment */
428                 7,                     /* spill costs */
429                 5,                     /* reload costs */
430                 true,                  /* we do have custom abi handling */
431         },
432         ARM_FPU_ARCH_FPE,      /* FPU architecture */
433 };
434
435 /**
436  * Initializes the backend ISA and opens the output file.
437  */
438 static arch_env_t *arm_init(FILE *file_handle)
439 {
440         static int inited = 0;
441         arm_isa_t *isa;
442
443         if (inited)
444                 return NULL;
445
446         isa = XMALLOC(arm_isa_t);
447         memcpy(isa, &arm_isa_template, sizeof(*isa));
448
449         arm_register_init();
450
451         be_emit_init(file_handle);
452
453         arm_create_opcodes(&arm_irn_ops);
454         arm_handle_intrinsics();
455
456         be_gas_emit_types = false;
457
458         /* needed for the debug support */
459         be_gas_emit_switch_section(GAS_SECTION_TEXT);
460         be_emit_irprintf("%stext0:\n", be_gas_get_private_prefix());
461         be_emit_write_line();
462
463         inited = 1;
464         return &isa->base;
465 }
466
467
468
469 /**
470  * Closes the output file and frees the ISA structure.
471  */
472 static void arm_done(void *self)
473 {
474         arm_isa_t *isa = self;
475
476         be_gas_emit_decls(isa->base.main_env);
477
478         be_emit_exit();
479         free(self);
480 }
481
482
483 /**
484  * Report the number of register classes.
485  * If we don't have fp instructions, report only GP
486  * here to speed up register allocation (and makes dumps
487  * smaller and more readable).
488  */
489 static unsigned arm_get_n_reg_class(void)
490 {
491         return N_CLASSES;
492 }
493
494 /**
495  * Return the register class with requested index.
496  */
497 static const arch_register_class_t *arm_get_reg_class(unsigned i)
498 {
499         assert(i < N_CLASSES);
500         return &arm_reg_classes[i];
501 }
502
503 /**
504  * Get the register class which shall be used to store a value of a given mode.
505  * @param self The this pointer.
506  * @param mode The mode in question.
507  * @return A register class which can hold values of the given mode.
508  */
509 static const arch_register_class_t *arm_get_reg_class_for_mode(const ir_mode *mode)
510 {
511         if (mode_is_float(mode))
512                 return &arm_reg_classes[CLASS_arm_fpa];
513         else
514                 return &arm_reg_classes[CLASS_arm_gp];
515 }
516
517 static int arm_to_appear_in_schedule(void *block_env, const ir_node *irn)
518 {
519         (void) block_env;
520         if (!is_arm_irn(irn))
521                 return -1;
522
523         return 1;
524 }
525
526 list_sched_selector_t arm_sched_selector;
527
528 /**
529  * Returns the reg_pressure scheduler with to_appear_in_schedule() over\loaded
530  */
531 static const list_sched_selector_t *arm_get_list_sched_selector(const void *self, list_sched_selector_t *selector)
532 {
533         (void) self;
534         memcpy(&arm_sched_selector, selector, sizeof(arm_sched_selector));
535         /* arm_sched_selector.exectime              = arm_sched_exectime; */
536         arm_sched_selector.to_appear_in_schedule = arm_to_appear_in_schedule;
537         return &arm_sched_selector;
538
539 }
540
541 static const ilp_sched_selector_t *arm_get_ilp_sched_selector(const void *self)
542 {
543         (void) self;
544         return NULL;
545 }
546
547 /**
548  * Returns the necessary byte alignment for storing a register of given class.
549  */
550 static int arm_get_reg_class_alignment(const arch_register_class_t *cls)
551 {
552         (void) cls;
553         /* ARM is a 32 bit CPU, no need for other alignment */
554         return 4;
555 }
556
557 static const be_execution_unit_t ***arm_get_allowed_execution_units(const ir_node *irn)
558 {
559         (void) irn;
560         /* TODO */
561         panic("Unimplemented arm_get_allowed_execution_units()");
562 }
563
564 static const be_machine_t *arm_get_machine(const void *self)
565 {
566         (void) self;
567         /* TODO */
568         panic("Unimplemented arm_get_machine()");
569 }
570
571 /**
572  * Return irp irgs in the desired order.
573  */
574 static ir_graph **arm_get_irg_list(const void *self, ir_graph ***irg_list)
575 {
576         (void) self;
577         (void) irg_list;
578         return NULL;
579 }
580
581 /**
582  * Allows or disallows the creation of Psi nodes for the given Phi nodes.
583  * @return 1 if allowed, 0 otherwise
584  */
585 static int arm_is_mux_allowed(ir_node *sel, ir_node *mux_false,
586                               ir_node *mux_true)
587 {
588         (void) sel;
589         (void) mux_false;
590         (void) mux_true;
591
592         return 0;
593 }
594
595 static asm_constraint_flags_t arm_parse_asm_constraint(const char **c)
596 {
597         /* asm not supported */
598         (void) c;
599         return ASM_CONSTRAINT_FLAG_INVALID;
600 }
601
602 static int arm_is_valid_clobber(const char *clobber)
603 {
604         (void) clobber;
605         return 0;
606 }
607
608 static void arm_lower_for_target(void)
609 {
610         int i;
611         int n_irgs = get_irp_n_irgs();
612
613         for (i = 0; i < n_irgs; ++i) {
614                 ir_graph *irg = get_irp_irg(i);
615                 lower_switch(irg, 256, true);
616         }
617 }
618
619 /**
620  * Returns the libFirm configuration parameter for this backend.
621  */
622 static const backend_params *arm_get_libfirm_params(void)
623 {
624         static ir_settings_arch_dep_t ad = {
625                 1,    /* allow subs */
626                 1,        /* Muls are fast enough on ARM but ... */
627                 31,   /* ... one shift would be possible better */
628                 NULL, /* no evaluator function */
629                 0,    /* SMUL is needed, only in Arch M */
630                 0,    /* UMUL is needed, only in Arch M */
631                 32,   /* SMUL & UMUL available for 32 bit */
632         };
633         static backend_params p = {
634                 0,     /* don't support inline assembler yet */
635                 1,     /* support Rotl nodes */
636                 1,     /* big endian */
637                 arm_lower_for_target, /* lowering function */
638                 &ad,   /* will be set later */
639                 arm_is_mux_allowed, /* allow_ifconv function */
640                 NULL,  /* float arithmetic mode (TODO) */
641                 0,     /* no trampoline support: size 0 */
642                 0,     /* no trampoline support: align 0 */
643                 NULL,  /* no trampoline support: no trampoline builder */
644                 4      /* alignment of stack parameter */
645         };
646
647         return &p;
648 }
649
650 /* fpu set architectures. */
651 static const lc_opt_enum_int_items_t arm_fpu_items[] = {
652         { "softfloat", ARM_FPU_ARCH_SOFTFLOAT },
653         { "fpe",       ARM_FPU_ARCH_FPE },
654         { "fpa",       ARM_FPU_ARCH_FPA },
655         { "vfp1xd",    ARM_FPU_ARCH_VFP_V1xD },
656         { "vfp1",      ARM_FPU_ARCH_VFP_V1 },
657         { "vfp2",      ARM_FPU_ARCH_VFP_V2 },
658         { NULL,        0 }
659 };
660
661 static lc_opt_enum_int_var_t arch_fpu_var = {
662         &arm_isa_template.fpu_arch, arm_fpu_items
663 };
664
665 static const lc_opt_table_entry_t arm_options[] = {
666         LC_OPT_ENT_ENUM_INT("fpunit",    "select the floating point unit", &arch_fpu_var),
667         LC_OPT_LAST
668 };
669
670 const arch_isa_if_t arm_isa_if = {
671         arm_init,
672         arm_done,
673         NULL,  /* handle_intrinsics */
674         arm_get_n_reg_class,
675         arm_get_reg_class,
676         arm_get_reg_class_for_mode,
677         NULL,
678         arm_get_list_sched_selector,
679         arm_get_ilp_sched_selector,
680         arm_get_reg_class_alignment,
681         arm_get_libfirm_params,
682         arm_get_allowed_execution_units,
683         arm_get_machine,
684         arm_get_irg_list,
685         NULL,               /* mark remat */
686         arm_parse_asm_constraint,
687         arm_is_valid_clobber,
688
689         arm_init_graph,
690         NULL,  /* get_pic_base */
691         NULL,  /* before_abi */
692         arm_prepare_graph,
693         arm_before_ra,
694         arm_after_ra,
695         arm_finish_irg,
696         arm_gen_routine,
697 };
698
699 BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch_arm);
700 void be_init_arch_arm(void)
701 {
702         lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
703         lc_opt_entry_t *arm_grp = lc_opt_get_grp(be_grp, "arm");
704
705         lc_opt_add_table(arm_grp, arm_options);
706
707         be_register_isa_if("arm", &arm_isa_if);
708
709         arm_init_transform();
710         arm_init_emitter();
711 }