Tricore C Compiler, Assembler, Linker Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
MB060-024-00-00 Doc. ver.: 1.3 TriCore v2.1 C Compiler, Assembler, Linker Reference Manual A publication of Altium BV Documentation Department Copyright 2002-2004 Altium BV All rights reserved. Reproduction in whole or part is prohibited without the written consent of the copyright owner. TASKING is a brand name of Altium Limited. The following trademarks are acknowledged: FLEXlm is a registered trademark of Macrovision Corporation. Intel is a trademark of Intel Corporation. Motorola is a registered trademark of Motorola, Inc. MS-DOS and Windows are registered trademarks of Microsoft Corporation. SUN is a trademark of Sun Microsystems, Inc. UNIX is a registered trademark of X/Open Company, Ltd. All other trademarks are property of their respective owners. Data subject to alteration without notice. http://www.tasking.com http://www.altium.com The information in this document has been carefully reviewed and is believed to be accurate and reliable. However, Altium assumes no liabilities for inaccuracies in this document. Furthermore, the delivery of this information does not convey to the recipient any license to use or copy the software or documentation, except as provided in an executed license agreement covering the software and documentation. Altium reserves the right to change specifications embodied in this document without prior notice. CONTENTS TABLE OF CONTENTS IV TriCore Reference Manual CONTENTS CONTENTS Table of Contents V TRICORE C LANGUAGE 1-1 1.1 Introduction . 1-3 1.2 Data Types . 1-4 1.3 Keywords . 1-6 1.4 Function Qualifiers . 1-9 1.5 Intrinsic Functions . 1-12 1.5.1 Minium and maximum of (Short) Integers . 1-13 1.5.2 Fractional Arithmetic Support . 1-14 1.5.3 Packed Data Type Support . 1-15 1.5.4 Interrupt Handling . 1-19 1.5.5 Insert Single Assembly Instruction . 1-21 1.5.6 Register Handling . 1-22 1.5.7 Insert / Extract Bit-fields and Bits . 1-23 1.5.8 Miscellaneous Intrinsic Functions . 1-25 1.6 Pragmas . 1-26 1.7 Predefined Macros . 1-31 LIBRARIES 2-1 2.1 Introduction . 2-3 2.2 Library Functions . 2-4 2.2.1 assert.h . 2-4 2.2.2 complex.h . 2-4 2.2.3 ctype.h and wctype.h . 2-6 2.2.4 errno.h . 2-7 2.2.5 fcntl.h . 2-9 2.2.6 fenv.h . 2-9 2.2.7 float.h . 2-10 2.2.8 fss.h . 2-10 2.2.9 inttypes.h and stdint.h . 2-11 2.2.10 iso646.h . 2-12 2.2.11 limits.h . 2-12 2.2.12 locale.h . 2-12 2.2.13 math.h and tgmath.h . 2-13 2.2.14 setjmp.h . 2-20 •••••••• VI TriCore Reference Manual 2.2.15 signal.h . 2-20 2.2.16 stdarg.h . 2-21 2.2.17 stdbool.h . 2-21 2.2.18 stddef.h . 2-22 2.2.19 stdint.h . 2-22 2.2.20 stdio.h and wchar.h . 2-22 2.2.21 stdlib.h and wchar.h . 2-33 2.2.22 string.h and wchar.h . 2-37 2.2.23 time.h and wchar.h . 2-41 2.2.24 Unistd.h . 2-44 2.2.25 wchar.h . 2-45 2.2.26 wctype.h . 2-46 2.3 C Library Reentrancy . 2-48 TRICORE ASSEMBLY LANGUAGE 3-1 3.1 Introduction . 3-3 3.2 Built-in Assembly Functions . 3-3 3.2.1 Overview of Built-in Assembly Functions . 3-3 3.2.2 Detailed Description of Built-in Assembly Functions . 3-6 3.3 Assembler Directives and Controls . 3-19 3.3.1 Overview of Assembler Directives . 3-19 3.3.2 Detailed Description of Assembler Directives . 3-21 3.3.3 Overview of Assembler Controls . 3-64 3.3.4 Detailed Description of Assembler Controls . 3-65 RUN-TIME ENVIRONMENT 4-1 4.1 Introduction . 4-3 4.2 Startup Code . 4-3 4.3 Stack Usage . 4-9 4.4 Heap Allocation . 4-10 4.5 Floating-Point Arithmetic . 4-10 4.5.1 Compliance with IEEE-754 . 4-11 4.5.2 Special Floating-Point Values . 4-13 CONTENTS Table of Contents VII 4.5.3 Trapping Floating-Point Exceptions . 4-13 4.5.4 Floating-Point Trap Handling API . 4-15 TOOL OPTIONS 5-1 5.1 Compiler Options . 5-3 5.2 Assembler Options . 5-67 5.3 Linker Options . 5-106 5.4 Control Program Options . 5-152 5.5 Make Utility Options . 5-214 5.6 Archiver Options . 5-243 LIST FILE FORMATS 6-1 6.1 Assembler List File Format . 6-3 6.2 Linker Map File Format . 6-5 OBJECT FILE FORMATS 7-1 7.1 ELF/DWARF Object Format . 7-3 7.2 Motorola S-Record Format . 7-4 7.3 Intel Hex Record Format . 7-8 LINKER SCRIPT LANGUAGE 8-1 8.1 Introduction . 8-3 8.2 Structure of a Linker Script File . 8-3 8.3 Syntax of the Linker Script Language . 8-6 8.3.1 Preprocessing . 8-6 8.3.2 Lexical Syntax . 8-7 8.3.3 Identifiers . 8-7 8.3.4 Expressions . 8-8 8.3.5 Built-in Functions . 8-9 8.3.6 LSL Definitions in the Linker Script File . 8-11 8.3.7 Memory and Bus Definitions . 8-11 8.3.8 Architecture Definition . 8-13 •••••••• VIII TriCore Reference Manual 8.3.9 Derivative Definition . 8-15 8.3.10 Processor Definition and Board Specification . 8-16 8.3.11 Section Placement Definition . 8-16 8.4 Expression Evaluation . 8-20 8.5 Semantics of the Architecture Definition . 8-21 8.5.1 Defining an Architecture . 8-22 8.5.2 Defining Internal Buses . 8-23 8.5.3 Defining Address Spaces . 8-23 8.5.4 Mappings . 8-26 8.6 Semantics of the Derivative Definition . 8-29 8.6.1 Defining a Derivative . 8-29 8.6.2 Instantiating Core Architectures . 8-30 8.6.3 Defining Internal Memory and Buses . 8-31 8.7 Semantics of the Board Specification . 8-33 8.7.1 Defining a Processor . 8-33 8.7.2 Instantiating Derivatives . 8-34 8.7.3 Defining External Memory and Buses . 8-35 8.8 Semantics of the Section Layout Definition . 8-37 8.8.1 Defining a Section Layout . ..