blob: 408e581792430134f481a92f35a5b75dabb20cdc [file] [log] [blame]
PulkoMandy17fc7592022-07-28 18:27:54 +02001/* Backend for VideoCore IV
2 (c) in 2013 by Volker Barthelmann
3*/
4
5/* buil-time configurable options: */
6#define NUM_GPRS 48
7
8#include "dt.h"
9
10
11/* This struct can be used to implement machine-specific */
12/* addressing-modes. */
13/* Currently possible are (const,gpr) and (gpr,gpr) */
14struct AddressingMode{
15 int flags;
16 int base;
17 long offset;
18};
19
20/* The number of registers of the target machine. */
21#define MAXR 48
22
23/* Number of commandline-options the code-generator accepts. */
24#define MAXGF 20
25
26/* If this is set to zero vbcc will not generate ICs where the */
27/* target operand is the same as the 2nd source operand. */
28/* This can sometimes simplify the code-generator, but usually */
29/* the code is better if the code-generator allows it. */
30#define USEQ2ASZ 0
31
32/* This specifies the smallest integer type that can be added to a */
33/* pointer. */
34#define MINADDI2P INT
35
36/* This specifies the smallest integer type that can be added to a */
37/* pointer. */
38#define MAXADDI2P INT
39
40/* If the bytes of an integer are ordered most significant byte */
41/* byte first and then decreasing set BIGENDIAN to 1. */
42#define BIGENDIAN 0
43
44/* If the bytes of an integer are ordered lest significant byte */
45/* byte first and then increasing set LITTLEENDIAN to 1. */
46#define LITTLEENDIAN 1
47
48/* Note that BIGENDIAN and LITTLEENDIAN are mutually exclusive. */
49
50/* If switch-statements should be generated as a sequence of */
51/* SUB,TST,BEQ ICs rather than COMPARE,BEQ ICs set this to 1. */
52/* This can yield better code on some machines. */
53#define SWITCHSUBS 1
54
55/* In optimizing compilation certain library memcpy/strcpy-calls */
56/* with length known at compile-time will be inlined using an */
57/* ASSIGN-IC if the size is less or equal to INLINEMEMCPY. */
58/* The type used for the ASSIGN-IC will be UNSIGNED|CHAR. */
59#define INLINEMEMCPY 1024
60
61/* Parameters are sometimes passed in registers without __reg. */
62#define HAVE_REGPARMS 1
63
64/* Parameters on the stack should be pushed in order rather than */
65/* in reverse order. */
66#undef ORDERED_PUSH
67
68/* Structure for reg_parm(). */
69struct reg_handle{
70 unsigned long gregs;
71};
72
73/* We have some target-specific variable attributes. */
74#define HAVE_TARGET_ATTRIBUTES
75
76/* We have target-specific pragmas */
77#define HAVE_TARGET_PRAGMAS
78
79/* We keep track of all registers modified by a function. */
80#define HAVE_REGS_MODIFIED 1
81
82/* We have a implement our own cost-functions to adapt
83 register-allocation */
84#define HAVE_TARGET_RALLOC 1
85#define cost_move_reg(x,y) 1
86#define cost_load_reg(x,y) 2
87#define cost_save_reg(x,y) 2
88#define cost_pushpop_reg(x) 3
89
90/* size of buffer for asm-output, this can be used to do
91 peephole-optimizations of the generated assembly-output */
92#define EMIT_BUF_LEN 1024 /* should be enough */
93/* number of asm-output lines buffered */
94#define EMIT_BUF_DEPTH 4
95
96/* We have no asm_peephole to optimize assembly-output */
97#define HAVE_TARGET_PEEPHOLE 0
98
99/* we do not have a mark_eff_ics function, this is used to prevent
100 optimizations on code which can already be implemented by efficient
101 assembly */
102#undef HAVE_TARGET_EFF_IC
103
104/* we only need the standard data types (no bit-types, different pointers
105 etc.) */
106#undef HAVE_EXT_TYPES
107#undef HAVE_TGT_PRINTVAL
108
109/* we do not need extra elements in the IC */
110#undef HAVE_EXT_IC
111
112/* we do use unsigned int as size_t (but unsigned long, the default) */
113#define HAVE_INT_SIZET 1
114
115/* we need register-pairs */
116#define HAVE_REGPAIRS 1
117
118
119/* do not create CONVERT ICs from integers smaller than int to floats */
120#define MIN_INT_TO_FLOAT_TYPE INT
121
122/* do not create CONVERT ICs from floats to ints smaller than int */
123#define MIN_FLOAT_TO_INT_TYPE INT
124
125/* do not create CONVERT_ICs from floats to unsigned integers */
126#define AVOID_FLOAT_TO_UNSIGNED 1
127
128/* do not create CONVERT_ICs from unsigned integers to floats */
129#define AVOID_UNSIGNED_TO_FLOAT 0
130
131#define HAVE_LIBCALLS 1