Commit ed38d6fe by Eric Botcazou Committed by Eric Botcazou

sparc.h: Rework comments about the code model in 64-bit environment and the mode 'Pmode'.

	* config/sparc/sparc.h: Rework comments about the code model
	in 64-bit environment and the mode 'Pmode'.
	* doc/invoke.texi (SPARC options): Rework description of the
	different code models supported in 64-bit environment.

From-SVN: r79509
parent 68a1af87
2004-03-15 Eric Botcazou <ebotcazou@act-europe.fr>
* config/sparc/sparc.h: Rework comments about the code model
in 64-bit environment and the mode 'Pmode'.
* doc/invoke.texi (SPARC options): Rework description of the
different code models supported in 64-bit environment.
2004-03-15 Kazu Hirata <kazu@cs.umass.edu> 2004-03-15 Kazu Hirata <kazu@cs.umass.edu>
* defaults.h (REVERSIBLE_CC_MODE): Define. * defaults.h (REVERSIBLE_CC_MODE): Define.
......
...@@ -69,35 +69,41 @@ Boston, MA 02111-1307, USA. */ ...@@ -69,35 +69,41 @@ Boston, MA 02111-1307, USA. */
#endif /* IN_LIBGCC2 */ #endif /* IN_LIBGCC2 */
#define TARGET_ARCH64 (! TARGET_ARCH32) #define TARGET_ARCH64 (! TARGET_ARCH32)
/* Code model selection. /* Code model selection in 64-bit environment.
-mcmodel is used to select the v9 code model.
Different code models aren't supported for v7/8 code. The machine mode used for addresses is 32-bit wide:
TARGET_CM_32: 32 bit address space, top 32 bits = 0, TARGET_CM_32: 32-bit address space.
pointers are 32 bits. Note that this isn't intended It is the code model used when generating 32-bit code.
to imply a v7/8 abi.
The machine mode used for addresses is 64-bit wide:
TARGET_CM_MEDLOW: 32 bit address space, top 32 bits = 0,
avoid generating %uhi and %ulo terms, TARGET_CM_MEDLOW: 32-bit address space.
pointers are 64 bits. The executable must be in the low 32 bits of memory.
This avoids generating %uhi and %ulo terms. Programs
TARGET_CM_MEDMID: 64 bit address space. can be statically or dynamically linked.
The executable must be in the low 16 TB of memory.
This corresponds to the low 44 bits, and the %[hml]44 TARGET_CM_MEDMID: 44-bit address space.
relocs are used. The text segment has a maximum size The executable must be in the low 44 bits of memory,
of 31 bits. and the %[hml]44 terms are used. The text and data
segments have a maximum size of 2GB (31-bit span).
TARGET_CM_MEDANY: 64 bit address space. The maximum offset from any instruction to the label
The text and data segments have a maximum size of 31 _GLOBAL_OFFSET_TABLE_ is 2GB (31-bit span).
bits and may be located anywhere. The maximum offset
from any instruction to the label _GLOBAL_OFFSET_TABLE_ TARGET_CM_MEDANY: 64-bit address space.
is 31 bits. The text and data segments have a maximum size of 2GB
(31-bit span) and may be located anywhere in memory.
TARGET_CM_EMBMEDANY: 64 bit address space. The maximum offset from any instruction to the label
The text and data segments have a maximum size of 31 bits _GLOBAL_OFFSET_TABLE_ is 2GB (31-bit span).
and may be located anywhere. Register %g4 contains
the start address of the data segment. TARGET_CM_EMBMEDANY: 64-bit address space.
*/ The text and data segments have a maximum size of 2GB
(31-bit span) and may be located anywhere in memory.
The global register %g4 contains the start address of
the data segment. Programs are statically linked and
PIC is not supported.
Different code models are not supported in 32-bit environment. */
enum cmodel { enum cmodel {
CM_32, CM_32,
...@@ -2212,9 +2218,7 @@ do { \ ...@@ -2212,9 +2218,7 @@ do { \
is done just by pretending it is already truncated. */ is done just by pretending it is already truncated. */
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
/* Specify the machine mode that pointers have. /* Specify the machine mode used for addresses. */
After generation of rtl, the compiler makes no further distinction
between pointers and any other objects of this machine mode. */
#define Pmode (TARGET_ARCH64 ? DImode : SImode) #define Pmode (TARGET_ARCH64 ? DImode : SImode)
/* Generate calls to memcpy, memcmp and memset. */ /* Generate calls to memcpy, memcmp and memset. */
......
...@@ -6360,31 +6360,31 @@ to 64 bits. ...@@ -6360,31 +6360,31 @@ to 64 bits.
@item -mcmodel=medlow @item -mcmodel=medlow
@opindex mcmodel=medlow @opindex mcmodel=medlow
Generate code for the Medium/Low code model: the program must be linked Generate code for the Medium/Low code model: 64-bit addresses, programs
in the low 32 bits of the address space. Pointers are 64 bits. must be linked in the low 32 bits of memory. Programs can be statically
Programs can be statically or dynamically linked. or dynamically linked.
@item -mcmodel=medmid @item -mcmodel=medmid
@opindex mcmodel=medmid @opindex mcmodel=medmid
Generate code for the Medium/Middle code model: the program must be linked Generate code for the Medium/Middle code model: 64-bit addresses, programs
in the low 44 bits of the address space, the text segment must be less than must be linked in the low 44 bits of memory, the text and data segments must
2G bytes, and data segment must be within 2G of the text segment. be less than 2GB in size and the data segment must be located within 2GB of
Pointers are 64 bits. the text segment.
@item -mcmodel=medany @item -mcmodel=medany
@opindex mcmodel=medany @opindex mcmodel=medany
Generate code for the Medium/Anywhere code model: the program may be linked Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
anywhere in the address space, the text segment must be less than may be linked anywhere in memory, the text and data segments must be less
2G bytes, and data segment must be within 2G of the text segment. than 2GB in size and the data segment must be located within 2GB of the
Pointers are 64 bits. text segment.
@item -mcmodel=embmedany @item -mcmodel=embmedany
@opindex mcmodel=embmedany @opindex mcmodel=embmedany
Generate code for the Medium/Anywhere code model for embedded systems: Generate code for the Medium/Anywhere code model for embedded systems:
assume a 32-bit text and a 32-bit data segment, both starting anywhere 64-bit addresses, the text and data segments must be less than 2GB in
(determined at link time). Register %g4 points to the base of the size, both starting anywhere in memory (determined at link time). The
data segment. Pointers are still 64 bits. global register %g4 points to the base of the data segment. Programs
Programs are statically linked, PIC is not supported. are statically linked and PIC is not supported.
@item -mstack-bias @item -mstack-bias
@itemx -mno-stack-bias @itemx -mno-stack-bias
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment