aboutsummaryrefslogtreecommitdiff
path: root/arch/all/core-sh/COMPILER.md
blob: 9da9b0ede3bf10ffe71a4e2450866b7ce7512549 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Compiler support of the SuperH architecture
## Introduction
Your compiler supports the SuperH architecture? That's great, not every one
does! Once you have done everything that's described in the `COMPILER.md`
file of the `all/core` module, these are the few things you should define.

Our required macros are based on the ones the Renesas/Hitachi C/C++ Compiler
uses, mainly because it's what people have been using the most for this
architecture.

## CPU type
You shall define the `_SH` macro, and exactly one of these macros,
representing your platform:

	_SH1, _SH2, _SH2A, _SH2E, _SH2AFPU, _SH3, _SH3DSP,
	_SH4, _SH4A, _SHALDSP, _SH5

## DSP-C interface
The DSP-C interface from the original Hitachi compiler is optional and has to
be enabled using an option, `-dspc`. If your compiler currently supports
fixed-point types, the `_DSPC` macro should be defined, otherwise, not.

Then, if they are not already defined, it should define the following macros:

- `__fixed`: the unsigned fract fixed-point type;
- `__accum`: the unsigned accum fixed-point type;
- `__sat`:   saturated arithmetic qualifier;
- `__circ`:  modulo adressing qualifier;
- `__X`:     X memory data qualifier;
- `__Y`:     Y memory data qualifier.