bearch_arm_t.h 2 KB
Newer Older
Christian Würdig's avatar
Christian Würdig committed
1
2
/*
 * This file is part of libFirm.
3
 * Copyright (C) 2012 University of Karlsruhe.
Christian Würdig's avatar
Christian Würdig committed
4
5
 */

6
7
8
9
10
11
12
/**
 * @file
 * @brief   declarations for arm backend -- private header
 * @author  Oliver Richter, Tobias Gneist
 */
#ifndef FIRM_BE_ARM_BEARCH_ARM_T_H
#define FIRM_BE_ARM_BEARCH_ARM_T_H
13

Michael Beck's avatar
Michael Beck committed
14
15
#include <stdio.h>

16
#include "bearch.h"
17

18
typedef struct arm_isa_t arm_isa_t;
19

Michael Beck's avatar
Michael Beck committed
20
21
/** Floating point instruction set. */
enum arm_fp_architectures {
Matthias Braun's avatar
Matthias Braun committed
22
23
24
25
26
27
	ARM_FPU_FPA_EXT_V1     = 0x40000000, /**< Base FPA instruction set. */
	ARM_FPU_FPA_EXT_V2     = 0x20000000, /**< LFM/SFM. */
	ARM_FPU_VFP_EXT_NONE   = 0x10000000, /**< Use VFP word-ordering. */
	ARM_FPU_VFP_EXT_V1xD   = 0x08000000, /**< Base VFP instruction set. */
	ARM_FPU_VFP_EXT_V1     = 0x04000000, /**< Double-precision insns. */
	ARM_FPU_VFP_EXT_V2     = 0x02000000, /**< ARM10E VFPr1. */
Michael Beck's avatar
Michael Beck committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41

	ARM_FPU_SOFTFLOAT      = 0x01000000, /**< soft float library */
	ARM_FPU_NONE           = 0,

	ARM_FPU_ARCH_FPE       = ARM_FPU_FPA_EXT_V1,
	ARM_FPU_ARCH_FPA       = ARM_FPU_ARCH_FPE | ARM_FPU_FPA_EXT_V2,

	ARM_FPU_ARCH_VFP       = ARM_FPU_VFP_EXT_NONE,
	ARM_FPU_ARCH_VFP_V1xD  = ARM_FPU_VFP_EXT_V1xD | ARM_FPU_VFP_EXT_NONE,
	ARM_FPU_ARCH_VFP_V1    = ARM_FPU_ARCH_VFP_V1xD | ARM_FPU_VFP_EXT_V1,
	ARM_FPU_ARCH_VFP_V2    = ARM_FPU_ARCH_VFP_V1 | ARM_FPU_VFP_EXT_V2,

	ARM_FPU_ARCH_SOFTFLOAT = ARM_FPU_SOFTFLOAT,

Matthias Braun's avatar
Matthias Braun committed
42
	ARM_FPU_MASK           = 0x7f000000,
Michael Beck's avatar
Michael Beck committed
43
44
};

45
46
47
48
49
50
51
52
53
/**
 * ARM architecture variants (not complete yet, add variants as necessary)
 */
typedef enum {
	ARM_VARIANT_4,
	ARM_VARIANT_5T,
	ARM_VARIANT_6,
	ARM_VARIANT_7,
} arm_variant_t;
Michael Beck's avatar
Michael Beck committed
54

55
struct arm_isa_t {
56
	arch_env_t base; /**< must be derived from arch_env_t */
57
};
58

59
typedef struct arm_codegen_config_t {
60
61
62
63
64
	arm_variant_t variant;
	bool          use_softfloat;
	bool          use_fpa;
	bool          use_vfp;
	bool          big_endian;
65
66
67
68
} arm_codegen_config_t;

extern arm_codegen_config_t arm_cg_config;

69
70
71
extern ir_mode *arm_mode_gp;
extern ir_mode *arm_mode_flags;

Matthias Braun's avatar
Matthias Braun committed
72
73
extern const arch_irn_ops_t arm_irn_ops;

74
75
void arm_finish_graph(ir_graph *irg);

Matthias Braun's avatar
Matthias Braun committed
76
77
void arm_lower_64bit(void);

78
#endif