ia32_common_transform.h 2.22 KB
Newer Older
1
2
/*
 * This file is part of libFirm.
3
 * Copyright (C) 2012 University of Karlsruhe.
4
5
6
7
8
9
 */

/**
 * @file
 * @brief       This file implements the common parts of IR transformation from
 *              firm into ia32-Firm.
Matthias Braun's avatar
Matthias Braun committed
10
 * @author      Matthias Braun, Sebastian Buchwald
11
12
13
14
 */
#ifndef FIRM_BE_IA32_IA32_COMMON_TRANSFORM_H
#define FIRM_BE_IA32_IA32_COMMON_TRANSFORM_H

15
#include "firm_types.h"
16
17
#include "bearch_ia32_t.h"

18
19
extern ir_heights_t *ia32_heights;
extern int           ia32_no_pic_adjust;
20

21
22
ir_type *ia32_get_prim_type(const ir_mode *mode);

23
24
25
26
/**
 * Get an atomic entity that is initialized with a tarval forming
 * a given constant.
 */
27
28
ir_entity *ia32_create_float_const_entity(ia32_isa_t *isa, ir_tarval *tv,
                                          ident *name);
29
30
31
32

/**
 * Creates an immediate.
 *
33
 * @param irg            The IR graph the node belongs to.
34
35
36
37
 * @param symconst       if set, create a SymConst immediate
 * @param symconst_sign  sign for the symconst
 * @param val            integer value for the immediate
 */
38
ir_node *ia32_create_Immediate(ir_graph *irg, ir_entity *symconst, int symconst_sign, long val);
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

/**
 * returns register by name (used for determining clobber specifications in
 * asm instructions)
 */
const arch_register_t *ia32_get_clobber_register(const char *clobber);

/**
 * Return true if a mode can be stored in the GP register set.
 */
int ia32_mode_needs_gp_reg(ir_mode *mode);

/**
 * generates code for a ASM node
 */
54
ir_node *ia32_gen_ASM(ir_node *node);
55

56
57
58
59
60
/**
 * Transforms a CopyB node.
 *
 * @return The transformed node.
 */
61
ir_node *ia32_gen_CopyB(ir_node *node);
62
63
64
65

/**
 * Transform the Thread Local Storage Proj.
 */
66
ir_node *ia32_gen_Proj_tls(ir_node *node);
67

68
69
70
71
72
/**
 * This function just sets the register for the Unknown node
 * as this is not done during register allocation because Unknown
 * is an "ignore" node.
 */
73
ir_node *ia32_gen_Unknown(ir_node *node);
74

75
const arch_register_req_t *ia32_parse_clobber(const char *clobber);
76

77
78
79
/**
 * Checks whether other node inputs depend on the am_candidate (via mem-proj).
 */
80
int ia32_prevents_AM(ir_node *const block, ir_node *const am_candidate,
81
82
                       ir_node *const other);

83
ir_node *ia32_try_create_Immediate(ir_node *node, char immediate_constraint_type);
84

85
#endif