Intel i960 User Manual

Intel i960 User Manual

Processor compiler
Hide thumbs Also See for i960:
Table of Contents

Advertisement

Quick Links

®
i960
Processor Compiler
User's Guide
Order Number: 651230-002
Revision
Revision History
-001
Original Issue.
-002
Revised for release 5.1
Date
02/96
01/97

Advertisement

Table of Contents
loading

Summary of Contents for Intel i960

  • Page 1 ® i960 Processor Compiler User's Guide Order Number: 651230-002 Revision Revision History Date -001 Original Issue. 02/96 -002 Revised for release 5.1 01/97...
  • Page 2 In locations outside the United States, contact your local Intel sales office. Intel Corporation makes no warranty of any kind with regard to this material, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Intel Corporation assumes no responsibility for any errors that may appear in this document.
  • Page 3: Table Of Contents

    Contents Chapter 1 The CTOOLS Compilation System Features ................1-1 Compatibility and Conformance to Standards....1-2 About this Manual ..............1-4 Audience Description.............1-6 Licensing and Copyrights ..........1-6 UNIX and Windows Conventions........1-6 Customer Service...............1-7 Where Do You Go From Here?..........1-7 Chapter 2 gcc960 Compiler Driver Controlling the Compilation System with gcc960 ....2-1 Invoking the Compiler with gcc960 ........2-2 gcc960 Sample Command Lines........2-3...
  • Page 4 Processor Compiler User's Guide Chapter 3 ic960 Compiler Driver Controlling the Compilation System with ic960....3-1 Invoking the Compiler with ic960 ........3-2 ic960 Sample Command Lines........3-3 ic960 Linker Options............3-4 ic960 and Predefined Macros ........3-6 ic960 and Environment Variables ........3-8 ic960 and File Use .............3-11 Input Files ..............3-11...
  • Page 5 Contents Profiling Your Program............4-5 Compiling for Profile Instrumentation with -fprof ....4-5 Collecting a Profile............4-5 Building Self-contained Profiles with gmpf960....4-6 Using Profiles During Global Decision Making and Optimization with -gcdm,iprof ........4-7 Obtaining Program Coverage Analysis with gcov960..4-7 Using make To Perform Program-wide Optimizations..4-7 Adapting Makefiles for Program-wide Optimization ..4-8 Using Makefiles with Program-wide Optimizations for Common Development Tasks ........4-10...
  • Page 6 Processor Compiler User's Guide Inline Level Control............6-7 Input Profile Control............6-8 Fast Memory Controls ...........6-8 Dryrun Control ...............6-9 Report Controls .............6-9 Module-set Specification ............6-13 Chapter 7 Language Implementation Data Representation ............7-1 Scalars................7-1 Aggregates ..............7-4 Other Type Keywords ............7-14 Calling Conventions ............7-14 Definitions..............7-15...
  • Page 7 Contents #pragma optimize ............7-34 #pragma pack..............7-35 #pragma pure ..............7-37 #pragma section............7-38 #pragma system ............7-38 Language Extensions ............7-39 Statements and Declarations Inside of Expressions ..7-40 Naming an Expression’s Type ........7-40 Referring to a Type with typeof........7-41 Generalized Lvalues............7-42 Conditional Expressions with Omitted Middle Operands...............7-44 Arrays of Length Zero............7-44 Non-lvalue Arrays Can Have Subscripts......7-45...
  • Page 8 Processor Compiler User's Guide Chapter 8 gcc960/ic960 Compatibility char and short Parameters ..........8-1 enum Variable Byte Count..........8-1 char Types..............8-2 Identifying Architectures ..........8-2 #pragma align..............8-3 mic3.0-compat Option............8-3 mic2.0-compat Option............8-3 Chapter 9 Position Independence and Reentrancy Position-independent Code and Data ........9-1 Position-independent Data ..........9-1...
  • Page 9 Contents Calls, Jumps, and Branches ..........11-9 Branch Optimizations ............11-9 Branch Prediction ............11-10 Identification of Leaf Functions........11-11 Inline Function Expansion ..........11-11 Tail-call Elimination............11-12 Loop Optimizations ............11-14 Movement of Loop-invariant Code ........11-14 Induction Variable Elimination ........11-14 Loop Unrolling ...............11-15 Memory Optimizations............11-15 Global Alias Analysis .............11-15 Variable Shadowing ............11-16 Register Use ..............11-16 Local Variable Promotion ..........11-17...
  • Page 10 Processor Compiler User's Guide longjmp and Volatile Data..........12-7 Incorrect debug information generated for arrays with unspecified bounds............12-7 C Version Incompatibilities ..........12-8 String Constants Read-only...........12-8 No Macro Argument Substitution in Strings ....12-8 External Variables and Functions in Blocks....12-8 Combining long with typedef Names ......12-9 Using typedef Names in Function Parameters ....12-9...
  • Page 11 Contents Tables 1-1 Compiler Limits............1-3 1-2 Chapter Descriptions..........1-4 2-1 Linker Options Accepted by gcc960......2-6 2-2 Intermediate Inputs and Outputs.......2-10 2-3 gcc960 Option Summary...........2-15 2-4 Mcore Supported Architectures.........2-41 3-1 Linker Options Accepted by ic960......3-5 3-2 Intermediate Inputs and Outputs.......3-13 3-3 ic960 Option Summary..........3-17 3-4 Gcore Supported Architecures ........3-37 3-5 Stop-after Option Phases and Output .......3-59 6-1 gcdm Option Arguments..........6-1...
  • Page 12: Chapter 1 The Ctools Compilation System

    Chapter 4. For descriptions of other optimizations, refer to Chapter 11. • Calling functions written in i960 processor assembly language source text, or including in-line assembly language in your C program. • Stopping the compilation process to examine intermediate results after syntax checking, preprocessing, compilation, assembly, or incremental linking.
  • Page 13: Compatibility And Conformance To Standards

    The compiler runs on a UNIX* or a Windows* 95/NT* host system and generates object code for any i960 commercial processor. The translation and code generation phases use the instruction set for the i960 processor that you specify. The compiler's implementation of C conforms to the ANSI standard for the C language (X3.159-1989).
  • Page 14: Compiler Limits

    The CTOOLS Compilation System Table 1-1 Compiler Limits ANSI Tested Limit Minimum Minimum Control structure nesting levels Conditional compilation nesting levels Declarator modifiers Declaration parenthesis nesting levels Parenthesis nesting levels Significant characters for internal identifier Name length for external identifier Identifiers in a single block 1024 Macros simultaneously defined...
  • Page 15: About This Manual

    Processor Compiler User's Guide About this Manual This manual contains the following chapters: Table 1-2 Chapter Descriptions Chapter Number Title Description The CTOOLS Introduces the compiler and provides Compilation information on using this manual. System gcc960 Compiler Teaches you how to use the gcc960...
  • Page 16 / ic960 Describes the incompatibilities between ic960 Compatibility and gcc960. Position Provides information on writing i960 Independence processor applications that require position- and Reentrancy independent or reentrant programs. Initializing the Describes the initialization process for the...
  • Page 17: Audience Description

    C and assembly language programming, and your host computer's operating system. Licensing and Copyrights Refer to the i960 Software Tools License Guide for licensing and copyright statements. UNIX and Windows Conventions This manual tells you how to use the compiler in both UNIX and Windows 95/NT systems.
  • Page 18: Customer Service

    The CTOOLS Compilation System Customer Service If you need service or assistance with CTOOLS, see your Getting Started with the i960 Processor Development Tools manual. Where Do You Go From Here? If you installed the CTOOLS GNU interface, go to Chapter 2 for information on using the gcc960 compiler driver.
  • Page 19: Chapter 2 Gcc960 Compiler Driver

    gcc960 Compiler Driver This chapter describes how to use the gcc960 driver program to control the compilation system. Topics include: • running the compilation system • sample command lines • predefined macros • command line options and their modifiers Controlling the Compilation System with gcc960 gcc960-style translation and linking requires use of the gcc960 driver, preprocessor, compiler, assembler, and linker.
  • Page 20: Invoking The Compiler With Gcc960

    Processor Compiler User's Guide • The resulting object files, plus any other input files, are passed to the linker to produce an executable. • Program-wide and profile-directed optimizations can be performed during the link step. For an overview of this capability, see Chapter 4.
  • Page 21: Gcc960 Sample Command Lines

    Sample Command Lines This section provides examples of how the compiler is commonly invoked. All these examples assume that you have C source files named t1.c and that you are generating code for the i960 CA architecture. t2.c...
  • Page 22 Generating Assembly Code To generate assembly code for the i960 CA architecture, use the following command. gcc960 -S -ACA t1.c instructs the compiler to generate assembly code.
  • Page 23: Gcc960 Linker Options

    gcc960 Compiler Driver causes the compiler to perform some basic optimizations on the generated code. instructs the compiler to name the generated executable test. gcc960 Linker Options When you do not specify a target with the option, gcc960 does T target not attempt to link programs for a specific target board.
  • Page 24: Gcc960 And Predefined Macros

    Predefined Macros Predefined macros within a program can act as constants during execution or as values in conditional-compilation statements. Predefined macros include ANSI-standard macros and macros specific to the i960 processor architecture. The (Undefine) option removes i960 processor-specific...
  • Page 25 This __i960 macro can be used to identify the parts of a program specific to the i960 processor. indicates the i960 processor instruction set in __i960 xx use. The compiler automatically defines the macro. The __i960 xx , or .
  • Page 26: Gcc960 And File Use

    Processor Compiler User's Guide indicates that the generated code is arranged for __i960_BIG_ENDIAN__ big-endian address space. The (Big-endian) option causes this macro to be defined. indicates that C constructs not conforming to the __STRICT_ANSI__ ANSI standard should be flagged. The...
  • Page 27: Include Files

    gcc960 Compiler Driver The driver passes any other filename to the linker. The linker then determines whether the file is an object file, library, or configuration file. Input files not needed for processing are not processed. For example, if you specify an assembly-language ( ) file and also specify the filename .s (Assembly) compile into assembly code option, gcc960 takes no action...
  • Page 28: Intermediate Inputs And Outputs

    Processor Compiler User's Guide Table 2-2 Intermediate Inputs and Outputs Last Phase Completed Option Inputs Outputs preprocessing M, C source files display on standard output compilation C source files assembly-language file preprocessed files listing files assembly C source files...
  • Page 29: Gld Files

    By default, the installation program places several files in the .GLD directory [ These files have been tailored to the $G960BASE /lib. Cyclone evaluation boards. To illustrate, the sample file given .GLD below is tailored for the Cyclone i960 Cx processor-based evaluation board. 2-11...
  • Page 30 Processor Compiler User's Guide Example 2-1 Sample .gld File gcc:-ACA crt:%{!crt:%[~]/lib/%{mpid:%{G:crt960_e.o}%{!G:crt960_p.o}} %{!mpid:%{G:crt960_b.o}%{!G:crt960.o}}} ld:%{!Ttext:-Ttext 0xA0008000}%{*: -defsym _heap_size=0x20000;_heap_base=(_end+0xf)&~0xf;_heap_end=_heap_base+_heap_size- 1;_stackbase=(_heap_end+0x40)&~0x3f -defsym fpem_CA_AC=0x100} lib:%{!nostdlib:-lmn -lll} In the file, you can place any options that the tools accept on the .GLD command line. For example, in the file shown in Example 2-1, you .GLD...
  • Page 31: Gcc960 Options

    0xA0008000, stack locations For more information on the linker directives used in this sample file, see the i960 Processor Software Utilities User’s Guide. section in the above example is used to specify that the lib: compiler driver should pass on the options...
  • Page 32 Table 2-1 lists the options that are relayed to the linker without the Pass option. For more detailed information on linker options, see the i960 Processor Software Utilities User's Guide. Whole-program (Program Database),...
  • Page 33: Option Arguments And Syntax

    gcc960 Compiler Driver Option Arguments and Syntax Some compiler driver options take arguments. Case is significant in options and arguments. A few options allow whitespace between the option and its argument; this whitespace is shown in Table 2-3. The options and arguments have default settings. In most cases, the option is "off,"...
  • Page 34 Processor Compiler User's Guide Table 2-3 gcc960 Option Summary (continued) Option Name Purpose Default Fbout | Fcoff | Format Generate b.out, COFF or ELF object Fbout Felf format. Database Build program database directory (PDB). No database fprof Instrument Compile with instrumentation; build PDB.
  • Page 35 gcc960 Compiler Driver Table 2-3 gcc960 Option Summary (continued) Option Name Purpose Default nostdlib No Standard Excludes standard libraries. Libraries O [ level ] Optimize Specify optimization level. o filename Output Name output file. Varies with object format Preprocess Preprocessor output control. Output pedantic Pedantic...
  • Page 36 Note that with release 5.1 using the option generates code that is -ARP compatible with current and proposed future variations on the i960 RP architecture. You can use predefined macros in your source text to conditionally compile code for the selected architecture. The compiler defines a preprocessor macro indicating the selected architecture.
  • Page 37 _ _i960 xx_ _ _ _i960_ xx_ _ When you link object modules compiled with incompatible architectures, the linker displays the following warning message: file : architecture i960: XX incompatible with output i960: YY is the first file containing incompatible file instructions the linker encounters.
  • Page 38 Processor Compiler User's Guide The macro is predefined when the option is _ _STRICT_ANSI_ _ ansi used. Some header files may notice this macro and refrain from declaring certain functions or defining certain macros that the ANSI standard doesn't call for;...
  • Page 39 Do not use the standard C startup file when linking. A replacement file should come first in the list of object files. For all i960 processor types except the RP, the standard startup file is . For i960 RP crt960.o...
  • Page 40 Processor Compiler User's Guide With no , defines as 1. (This is exactly the same as =value macro macro =1 D macro = value Defines macro value. d (Definitions) Control macro processing. • Tells the preprocessor to pass all macro definitions into the output, in their proper sequence in the rest of the output.
  • Page 41 gcc960 Compiler Driver Fbout | Fcoff | Felf (Format) Specifies the object file format. specifies the b.out object format. This is the Fbout default. You can add the option to specify the style of symbolic-debug symbols created. Note that you cannot use this option with the -ARP architecture setting.
  • Page 42 ) is linked automatically. If your target libqf environment does not support file I/O, you must explicitly link an alternate profiling library ( ). The profiling libraries provided are described in libq Chapter 2 of the i960 Processor Library Supplement. 2-24...
  • Page 43 gcc960 Compiler Driver Note that compiling with the option creates object modules useful fprof only for collecting a profile. If you compile with and later do not fprof want a profile, you must then use substitutions to replace every instrumented module in , or you must recompile the modules without prog option.
  • Page 44 The value of such an expression is void. Performs a special conditional f[no-]condxform transformation that allows the use of the i960 Jx, Hx and RP processors' sel<cc>, addo<cc>, and subo<cc> instructions. You cannot use this optimization unless , or option is specified.
  • Page 45 gcc960 Compiler Driver Performs copy propagation. This f[no-]copyprop optimization replaces uses of registers that are destinations of register to register copies with the source register (when possible). This allows unnecessary copies to be deleted later in the compilation. During common subexpression f[no-]cse-follow-jumps elimination (CSE), scan through jump instructions in only certain cases.
  • Page 46 Processor Compiler User's Guide this way. When all calls to a given function are inlined, and the function is declared static, then the function is normally not output as assembler code in its own right. indicates to the compiler that pointer...
  • Page 47 gcc960 Compiler Driver Even when all calls to a given function f[no-]keep-inline- are inlined, a separate run-time callable functions version of the function is still output. Rejoin multi-word moves split apart by f[no-]marry_mem (where possible). fsplit_mem Intermix C code as comments within the fmix-asm assembly code.
  • Page 48 Processor Compiler User's Guide This option makes debugging more difficult, since the code for multiple C statements may become intermixed, causing execution to make numerous jumps while single-stepping. Similar to , but it f[no-]schedule-insns2 fschedule-insns requests an additional pass of instruction scheduling after register allocation has been done.
  • Page 49 gcc960 Compiler Driver Split all multi-word moves into f[no-]split_mem sequences of single word moves to improve copy propagation. Make the type be unsigned, like funsigned-char | char , or make the type unsigned char (funsigned-char) be signed, like char signed char (fno-unsigned-char) funsigned- is equivalent to...
  • Page 50 Processor Compiler User's Guide condition is not checked for each iteration. In a few cases, however, the increased code size may decrease performance. This option uses several decision criteria determine how far to unroll a loop. For example, when the loop body is small...
  • Page 51 gcc960 Compiler Driver G (Big-endian) Generate big-endian code. Compile for a target that uses big-endian memory. This option requires that be in effect. This option is also passed to Fcoff Felf gas960c/gas960e and gld960. When is specified, the preprocessor symbol is defined.
  • Page 52 Processor Compiler User's Guide For ELF/DWARF, a debug level setting of specifies all DWARF debug information, including preprocessor macros in the debug information. If your debugger (like gdb960) does not make use of preprocessor macro information, you can save space in your object files by dropping to ELF/DWARF debug level 2.
  • Page 53 gcc960 Compiler Driver The gcdm option is flexible and powerful, and therefore requires a certain level of understanding in order to use it effectively. For these reasons, it is documented in a separate chapter (Chapter 6) in this manual. Before using the gcdm option, you should read Chapter 4, Program-wide Analysis and Optimization, and become familiar with the information in Chapter 5, Profile Data Merging and Data Format (gmpf960).
  • Page 54 Processor Compiler User's Guide option inhibits the use of the current directory as the first search directory for . The current directory is searched for #include " file " only when it is requested explicitly with "dot"). It #include " file "...
  • Page 55 gcc960 Compiler Driver include (Preinclude File) Specifies file for preinclusion. include file Process as input before processing the regular input file. In effect, file the contents of are compiled first. Any options on the file command line are always processed before , regardless of include file the order in that they are written.
  • Page 56 Processor Compiler User's Guide Adds to the list of directories to be searched for libraries. See directory your utilities user's guide for a complete explanation of the directory search order. l (Library) Specifies library for linking. l library Search a standard list of directories for a library file named .
  • Page 57 gcc960 Compiler Driver M | MD | MM | MMD (Make) Generate make tool output. Tells the preprocessor to output a rule suitable for a make tool describing the dependencies of each source file. For each source file, the preprocessor outputs one make rule whose target is the object filename for that source file and whose dependencies are all the files #include...
  • Page 58 Processor Compiler User's Guide Generate 80960 ABI-conformant code. This mabi causes the type to be signed, enums to be char four bytes in size and signed, and changes default alignment rules for structs and unions. See Chapter 7 for more information.
  • Page 59: Mcore Supported Architectures

    Cx or Hx mcode-align architecture is specified. generate code that is compatible with multiple mcore0 mcore1 i960 processor types. Additionally, when you mcore2 mcore3 use an option, you can include another -mcore switch to generate code that is optimized for a particular architecture, but still compatible with a group of architectures.
  • Page 60 Processor Compiler User's Guide Generate code so that the size and alignment of mdouble4 is the same as double float Generate code so that the size and alignment of mlong-double4 is the same as long double float NOTE. The...
  • Page 61 gcc960 Compiler Driver appropriate. This option makes debugging more difficult. is the default at mleaf-procedures or higher. Generate all call instructions as instead mlong-calls calljx . This is used where the distance callj between the call site and the called function may exceed 's range.
  • Page 62 Processor Compiler User's Guide generates potentially unaligned references when it seems advantageous to do so. When is enabled, sequences of mstrict-align smaller memory references are used instead of larger ones that might not be correctly aligned. The default is on for C-series and J-series processors.
  • Page 63 This is the default setting when you use the (Program Database) or...
  • Page 64 (scheduling) to make use of the particular i960 processor's pipeline and superscalar capabilities. This level includes the optimizations described above, and the following additional...
  • Page 65 gcc960 Compiler Driver o (Output) Specifies output filename. o filename Specifies output filename. P (Preprocessor Output) Preprocessor output control. Inhibits generation of -lines with line-number information in the output from the preprocessor. This is useful when running the preprocessor on non-C code that is intended for a program that might be confused by the -lines.
  • Page 66 Processor Compiler User's Guide does not cause warning messages for use of the alternate pedantic keywords whose names begin and end with (double underscore). is the same as , except that it causes the pedantic-errors pedantic compilation system to issue errors instead of warnings.
  • Page 67 gcc960 Compiler Driver T (Target) Specifies .gld file. where identifies a target-specific T string string configuration file, string. gld Causes gcc960 to configure itself for a specific target board. traditional (Traditional) Allow traditional C. Attempt to support some aspects of traditional C compilers, specifically: •...
  • Page 68 Processor Compiler User's Guide • The predefined macro is not defined when you use _ _STDC_ _ , but is (since the GNU extensions that traditional _ _GNUC_ _ indicates are not affected by ). When you _ _GNUC_ _...
  • Page 69 gcc960 Compiler Driver U (Undefine) Undefines a preprocessor macro. U macro Undefines the named preprocessor macro. V (Version) Display tool version numbers. v (Verbose) Display tool version numbers and subprocess commands. v960 (Version, exit) Display tool version numbers and exit. 2-51...
  • Page 70 Processor Compiler User's Guide W (Warnings) Enables / disables specific warnings. W[ string ] With no arguments, this option prints extra warning messages for certain events, including: longjmp() warnings Warn when a nonvolatile automatic variable might be changed by a call to...
  • Page 71 gcc960 Compiler Driver between-ness comparison Warn when a comparison like s used; x<=y<=z i this is equivalent to {(x<=y ? 1 : 0) <=z} which is a different interpretation from that of ordinary mathematical notation. obsolete storage class specification Warn when storage-class specifiers like static are not first in a declaration.
  • Page 72 Processor Compiler User's Guide Warn when an array subscript has type Wchar-subscripts char This is a common cause of error, as programmers often forget that this type is signed on some machines. Warn whenever a comment-start sequence Wcomment appears in a comment.
  • Page 73 gcc960 Compiler Driver Warn when a global function is defined without a Wmissing-prototypes previous prototype declaration. This warning is issued even when the definition itself provides a prototype. The aim is to detect global functions that are not declared in header files. Warn when an declaration is Wnested-externs...
  • Page 74 Processor Compiler User's Guide Warn when a function is declared or defined Wstrict-prototypes without specifying the argument types. An old- style function definition is permitted without a warning when it is preceded by a declaration specifying the argument types.
  • Page 75 gcc960 Compiler Driver There may be no warning about a variable that is used only to compute a value that itself is never used, because such computations can be deleted by data flow analysis before the warnings are printed. These warnings are optional because gcc960 cannot foresee all the reasons why the code might be correct despite appearing to have an error.
  • Page 76 Processor Compiler User's Guide This has no bug because is used only save_y when it is set. Some spurious warnings can be avoided if you declare as volatile all the functions you use that never return. Warn whenever a local variable is unused aside...
  • Page 77: Chapter 3 Ic960 Compiler Driver

    ic960 Compiler Driver This chapter describes how to use the ic960 driver program to control the compilation system. This chapter also explains how to: • invoke the compiler with the ic960 command-line options • modify compiler operation using environment variables •...
  • Page 78: Invoking The Compiler With Ic960

    Processor Compiler User's Guide Invoking the Compiler with ic960 The ic960 command-line syntax is: ic960 [- option ]... [ path ] filename ... is the compiler driver executable filename. ic960 is a compiler option. Case is significant in option options and their arguments.
  • Page 79: Ic960 Sample Command Lines

    Generating Assembly To generate assembly code for the i960 CA architecture, use the following command. ic960 -S -ACA t1.c instructs the compiler to generate assembly code.
  • Page 80: Ic960 Linker Options

    Processor Compiler User's Guide Generating an Object Module with Debug Information To generate a object module with debug information, use the following command. ic960 -c -g -ACA t1.c instructs the compiler to generate debug information. instructs the compiler to generate an object file.
  • Page 81: Linker Options Accepted By Ic960

    Undefine introduces an unresolved symbol, causing the linker to search symbol tables for resolution of the reference. Decision Maker invokes gcdm960 decision maker. gcdm For more information on the linker, see the i960 Processor Software Utilities User’s Guide.
  • Page 82: Ic960 And Predefined Macros

    Predefined Macros Predefined macros within a program can act as constants during execution or as values in conditional-compilation statements. Predefined macros include ANSI-standard macros and macros specific to the i960 processor architecture. The (Undefine) option can remove i960 processor-specific macros but not ANSI-standard macros.
  • Page 83 Compiler Driver indicates the i960 processor instruction set in __i960 xx use. The compiler automatically defines the macro. The __i960 xx , or . Definition of depends on the specific i960 processor instruction set specified by the (Architecture) option or the environment variable.
  • Page 84: Ic960 And Environment Variables

    In addition, the environment variable specifies the default architecture. The I960ARCH compilation system uses the following environment variables to set defaults: specifies an architecture other than the i960 KB I960ARCH processor for code generation. The possible definitions for I960ARCH , or .
  • Page 85 ic960 Compiler Driver The linker looks for libraries, startup modules, and configuration files in the directory under the directory specified by I960BASE specifies a non-default pathname for the I960AS assembler. The pathname must include the name of the executable. In the absence of I960AS ic960 looks for the assembler in under the...
  • Page 86 . For a I960BASE complete description of the search algorithm used by the linker, see the i960 Processor Software Utilities User's Guide. contains an alternate pathname of the linker. The I960LD path must include the name of the executable. In...
  • Page 87: Ic960 And File Use

    ic960 Compiler Driver ic960 and File Use The compiler, assembler, and linker all use filenames specified on the ic960 command line to find and create input and output files. In addition, translation and linking require temporary work files. Environment variables allow specification of default directories for work files. Input Files The ic960 command line allows filename inputs that support specification of assembly-language files, preprocessed source files, C source files,...
  • Page 88: Temporary Files

    Processor Compiler User's Guide preprocessor directive causes a search of the directory or #include directories indicated by the (Searchinclude) option. In the absence of option, ic960 searches the current directory, the directory defined by environment variable, or the directory.
  • Page 89: Intermediate Inputs And Outputs

    ic960 Compiler Driver Each filename has the form , where is the same name as the file .L file C source file. Table 3-2 Intermediate Inputs and Outputs Last Phase Stop-after Completed Option Inputs Outputs preprocessing P, E, or C source files preprocessed files or display on standard output...
  • Page 90 Creating a linker configuration file containing information for preparing an absolutely relocated module, a module for incremental linking, or code ready for programming into read-only memory (ROM) allows for additional file types. For more information on linker configuration, see the i960 Processor Software Utilities User's Guide. 3-14...
  • Page 91: Ic960 Options

    ic960 Compiler Driver The following examples illustrate the creation and use of output filename extensions: • The command produces the ic960 -c -zs proto.c proto1.i object files and the listing files proto.o proto1.o proto.L proto1.L • The command ic960 -c -o proto_v1.o -zs proto.c produces the object file and the listing file...
  • Page 92 Table 3-1 lists the options that are relayed to the linker without the Pass option. For more detailed information on linker options, see the i960 Processor Software Utilities User's Guide. Whole-program (Program Database),...
  • Page 93: Option Arguments And Syntax

    ic960 Compiler Driver Option Arguments and Syntax Some compiler driver options take arguments. Whitespace is optional between an option and its argument. Case is significant in options and arguments. The options and arguments have default settings. In most cases, the option is "off,"...
  • Page 94 Processor Compiler User's Guide Table 3-3 ic960 Option Summary (continued) Option Name Purpose Default Create-object Stop after creation of object file. Do not stop D symbol Define Define symbol . symbol =1 [= value ] Preprocess - Write preprocessed source to stdout;...
  • Page 95 ic960 Compiler Driver Table 3-3 ic960 Option Summary (continued) Option Name Purpose Default Dependencies Print include-file dependencies; No print terminate. Save-assembly Save assembly-language output. Do not save U symbol Undefine Undefine symbol. Version Display version information. No display v960 Version-exit Display version information and exit.
  • Page 96 NOTES. Also, with release 5.1 using the option generates code -ARP that is compatible with current and proposed future variations on the i960 RP architecture. You can use predefined macros in your source text to conditionally compile code for the selected architecture. The compiler defines a preprocessor macro indicating the selected architecture.
  • Page 97 Example The following example selects the i960 KA instruction set: ic960 -AKA proto.c a (ANSI) Flags non-standard constructs. Default The compiler accepts constructs that are legal under Kernighan and Ritchie's definition of the C language but that do not comply with the ANSI standard.
  • Page 98 Processor Compiler User's Guide NOTE. When this option is in effect, if your program contains in-line assembly-language ( ) statements, the compiler treats the statement as a regular function call and produces code for the call. For example, if your program contains the following line: asm("flushreg");...
  • Page 99 ic960 Compiler Driver Related Topic (Warnings) (Diagnostic-level) b (Limit-optimizations) Limits optimizations. b size is a positive decimal integer. size Default Having more than 2500 intermediate language statements in a function causes the compiler to disable some global optimizations. Discussion As function size increases, the compiler slows. The (Limit- optimizations) option allows you to alter the threshold at which optimizations are scaled back when functions are too large to compile...
  • Page 100 Processor Compiler User's Guide C (Keep-comments) Keeps comments in preprocessor output. -E -C -P -C Default All comments are stripped away. Discussion Use the (Keep-comments) option to preserve comments normally stripped by the preprocessor. This option modifies the Stop-after options.
  • Page 101 ic960 Compiler Driver c (Create-object) Create object file; terminate. Default Create an executable file after the link phase of the compilation process. Discussion If you specify (Create-object) the compilation process terminates after the assembler generates an object file. If you do not specify the (Output) option, the compiler writes the object file to , where...
  • Page 102 Processor Compiler User's Guide D (Define) Define a symbol. D symbol [= value ] is a symbolic name. symbol is a value. The value can be any string. value Default If you define without specifying , the preprocessor assigns...
  • Page 103 ic960 Compiler Driver The source text is: #ifdef LONGPATH #define PATHLENGTH 128 #else #define PATHLENGTH 45 #endif Related Topics (Undefine) #define #undef E (Preprocess - stdout) Preprocess; write output to screen; terminate. Default After the link phase of the compilation process is complete, an executable file is produced.
  • Page 104 Processor Compiler User's Guide Example The following example runs only the preprocessor phase, sending the preprocessed source text to the screen: ic960 -E proto.c Related Topic Stop-after options Fcoff | Felf (Format) Specifies object format. specifies the COFF object format, and causes the Fcoff assembler to be invoked as asm960.
  • Page 105 ic960 Compiler Driver F (Fine-tune) Adjust optimizations. F arg [, arg ]... is any of: enables/disables procedure in-lining using ai | noai heuristics at optimization level 2. enables/disables code alignment; generate (do ca | noca not generate) alignment directives prior to labels that are not entered from above.
  • Page 106 Processor Compiler User's Guide enables/disables superblock formation. sb | nosb Suppressing this optimization may reduce your application's code size. enables/disables conversion of tail calls into tce | notce branch instructions at optimization level 1 or 2. is the default at optimization level 1, and notce is the default at optimization level 2.
  • Page 107 ic960 Compiler Driver fdb (Database) Builds optimization database. All modules subject to program-wide optimization must be initially compiled with the option. This option causes the insertion of program database information in the object modules, and it implies a minimum module-local optimization level of O1 (although higher module-local optimization levels are allowed).
  • Page 108 I/O, you must explicitly link an alternate profiling library ( ). The profiling libraries provided are libq identified in Chapter 2 of the i960 Processor Library Supplement. Note that when the option is used in this manner, the generated fprof object module contains code is unsuitable for linking into programs that are not supposed to collect profile information.
  • Page 109 ic960 Compiler Driver Note that most of these options are controlled automatically by the various optimization levels. Therefore, some of them may be ignored for certain compilations. For example, at optimization level , you cannot enable instruction scheduling with . To check whether one of fschedule-insns these options has the desired effect, compare the generated assembly code with and without the option.
  • Page 110 Processor Compiler User's Guide Place address constants in registers force-addr before use. Indicates to the compiler that pointer fint-alias-ptr objects may be referenced as 32-bit integers and vice versa. Indicates to the compiler that fint-alias-real float , and objects (or...
  • Page 111 ic960 Compiler Driver Note that ANSI 3.3 requires the compiler to assume that references char alias all types, so code using char pointers for this sort of thing is already correct and using these options is not necessary. Using all three aliasing options effectively disallows all use of type information in memory disambiguation.
  • Page 112 Processor Compiler User's Guide Split multi-word moves for copy split_mem propagation. Enable loop strength reduction. strength-reduce Enable an advanced branch thread-jumps optimization. Unroll all loops. unroll-all-loops Unroll loops where deemed beneficial. unroll-loops Treat indirect memory references as volatile volatile.
  • Page 113: Gcore Supported Architecures

    Generate all functions as CAVE secondary cave functions. generate code that is compatible with multiple core0 core1 i960 processor types. Additionally, when you core3 | core2 use a option, you can include another -Gcore switch to generate code that is optimized for a particular architecture, but still compatible with a group of architectures.
  • Page 114 Processor Compiler User's Guide Specifies the relaxed ref-def external linkage model. This is the default. Specifies the strict ref-def external linkage model. Generates position-independent code. Generates position-independent data. Reserves register containing the position- independent data (PID) bias value. Specifies wait-state for memory accesses.
  • Page 115 Before this release of the compiler, narrow integral values were always sign- or zero-extended by the originator. • The Release 2.0 compiler, when used to compile for an i960 KB or SB processor, returns (80-bit) floating-point numbers in the long double floating-point register.
  • Page 116 , you inform the compiler that the memory system of the entire program is in big-endian format. Only the i960 Cx, Hx, and Jx processors support big- and little-endian format. Do not use this argument with other i960 architectures. The compiler automatically passes the (Generate big-endian) option to the assembler or linker if they are to be run.
  • Page 117 Using the strict ref-def model, you can relocate uninitialized variables to named sections at specific memory locations using the linker configuration language. For more detailed information about using the linker, see the i960 Processor Software Utilities User's Guide. 3-41...
  • Page 118 Processor Compiler User's Guide Position Independence Arguments (pc, pd, and pr): If you select , the compiler generates position-independent code and predefines the macro. __PIC NOTE. Applications built using the option cannot be linked with assembly sources that contain...
  • Page 119 ic960 Compiler Driver Examples 1. The following example aligns structures on 8-byte boundaries: ic960 -Gac=8 proto.c 2. The following example generates a module that can be linked with code resulting from an ic960 Release 2.0 translation: ic960 -Gbc proto.c 3. The following example generates code in which variables declared as are treated as char unsigned char...
  • Page 120 Processor Compiler User's Guide For COFF, debug level settings of , and all have the same effect: they specify “normal” debug information. For ELF/DWARF, debug level settings of , and all have the same effect: they specify all DWARF debug information except preprocessor macros.
  • Page 121 ic960 Compiler Driver option provides a high level of automation for the whole- gcdm program or profile-driven optimization process. The compiler driver and the linker both use the option and its arguments. gcdm option is flexible and powerful, and therefore requires a certain gcdm level of understanding in order to use it effectively.
  • Page 122 Processor Compiler User's Guide Default If you use to specify a filename that is not an #include " filename " absolute pathname, the compiler searches directories in the following order: 1. the directory containing the primary C source file (the primary directory).
  • Page 123  #include "proto.h" 2. In the following example, the preprocessor searches:  (the Searchinclude directory) /usr/home/include  (the directory specified by /usr/local/i960 I960BASE environment variable is set to I960BASE /usr/local/i960 The command-line is:  ic960 -I /usr/home/include /usr/home/src/proto.c The source text contains: ...
  • Page 124 Processor Compiler User's Guide Discussion Use the (Preinclude) option to prepend the text of a C source file or include file to each C source file specified on the command line. This option has the same effect as placing an...
  • Page 125 ic960 Compiler Driver Discussion Use the (Miscellaneous) option to specify miscellaneous controls. Two such controls are (issue gcc960-style diagnostics) and (issue nogd ic960-style diagnostics). gcc960-style diagnostics are more compact, and do not include column position indicators. Default (issue ic960-style diagnostics). nogd j (Errata) Specifies processor...
  • Page 126 Processor Compiler User's Guide M (Mix) Mixes C source text with assembly language output. -S -M Default Assembly language output does not contain interleaved C source as comments. Discussion Use the (Mix) option to modify the (Save-assembly) option to put C source text as comments into the assembly language output file.
  • Page 127 ic960 Compiler Driver n (Check-syntax) Check syntax; terminate. Default After the link phase of the compilation process is complete, an executable file is produced. Discussion If you specify (Check Syntax Only) the compilation process terminates after performing syntax and semantic checking. The compiler generates diagnostic messages but produces no output.
  • Page 128 Processor Compiler User's Guide Disables optimizations, including those that may interfere with debugging. This is the optimization level if you use the (Debug) option. Enables basic optimizations, including: advanced register allocation, common subexpression elimination, loop invariant code motion, expression simplification and instruction...
  • Page 129 ic960 Compiler Driver Note that the level is not accepted directly by the ic960 driver. It is accepted only in the subst argument of the option. gcdm o (Output) Name output file. o filename is the name of the file to receive the final output filename of the compilation.
  • Page 130 Processor Compiler User's Guide • If you specify the (Create-object) option, the final output is the object module generated by the assembler. • Otherwise, the final output is the result of linking. The compiler issues an error message if you use the (Output) option and do not invoke the linker when processing more than one input file.
  • Page 131 ic960 Compiler Driver Example The following example puts the preprocessed source for in the proto.c file and the preprocessed source for in the file proto.i proto1.c proto1.i ic960 -P proto.c proto1.c Related Topics (Output) Stop-after options Q (Dependencies) Print include-file dependencies;...
  • Page 132 Processor Compiler User's Guide Example The following example generates a file dependency list for . File dtest.c includes files , and , as follows: dtest.c dinc.h d2.h d3.h #include "dinc.h" #include "d2.h" #include "d3.h" File includes file , as follows: dinc.h...
  • Page 133 ic960 Compiler Driver Default After the link phase of the compilation process is complete, the compiler produces an executable COFF file. (Assembly language output is not saved.) Discussion If you specify (Save-assembly), the compilation process terminates after the compiler generates assembly code and writes the output to a file. If you do not specify a filename with the (Output) option, the compiler writes the assembly language output to...
  • Page 134 Processor Compiler User's Guide Stop-after Options (n | Q | P | E | S | c) Stop after the specified compilation phase. n | Q | P | E | S | c Default After the link phase of the compilation process is complete, the compilation system produces an executable file.
  • Page 135: Stop-After Option Phases And Output

    ic960 Compiler Driver object file depends, including the primary C source file. Preprocessor directives for conditional compilation affect the output of the dependency lines. Table 3-5 Stop-after Option Phases and Output Name Option Processing Phases Output Syntax-check preprocessing, syntax- a list of diagnostic messages, checking written to standard error Dependencies Q...
  • Page 136 Processor Compiler User's Guide If you specify (Save-assembly), the compilation process terminates after the compiler generates assembly code and writes the output to a file. If you do not specify a filename with the (Output) option, the compiler writes the assembly language output to , where filename .s...
  • Page 137 ic960 Compiler Driver 6. The following example produces the object file but no proto.o executable file: ic960 -c proto.c 7. The following example produces the object files , and proto.o t1.o in the current directory but creates no executable file: proto1.o ic960 -c proto.c t1.s proto1.i 8.
  • Page 138 Processor Compiler User's Guide U (Undefine) Undefine symbol. U symbol is a symbolic name. symbol Default No symbols are undefined. Discussion Use the (Undefine) option to remove preprocessor macro symbols. Examples of symbols you can undefine include: • macros, where...
  • Page 139 ic960 Compiler Driver Example The following examples both undefine the symbol __i960KA ic960 -AKA -U__i960KA proto.c ic960 -AKA -U__i960KA -D__i960KA=2 proto.c Related Topics A (Architecture) __i960 xx __PIC D (Define) __i960 __PID #define #undef V (Version) Display version information. Default The compiler does not display version information.
  • Page 140 Processor Compiler User's Guide Related Topic (Verbose) v (Verbose) Display invocation information. Default The compilation system does not display individual phase invocation information. Discussion Use the (Verbose) option to display the standard errors from invocations of the driver program, preprocessor, compiler, assembler, and linker.
  • Page 141 ic960 Compiler Driver Example The following command-line requests verbose invocation information: ic960 -v -T cycx -ACA -o hello.out hello.c Related Topics (Pass) I960AS I960LD Stop-after options (Version) I960BASE v960 (Version, terminate) Display version information and terminate. v960 Default The compilation system does not display version information. Discussion Use the (Version, terminate) option to display version information.
  • Page 142 Processor Compiler User's Guide W (Pass) Pass arguments to phases. W phase , arg [, arg ]. . . is a letter identifying the phase to receive the phase arguments, as follows: indicates the assembler. indicates the compiler. indicates the linker.
  • Page 143 ic960 Compiler Driver W (Warnings) Enable or disable a warning. W [no-] arg option allows more fine-grained control over diagnostics W [no-] arg than w level is any of: warn if any functions return structures or unions. aggregate-return enable several useful warnings. Has no Wno-all form.
  • Page 144 Processor Compiler User's Guide warn if a function is defined before it is missing-prototypes prototyped. warn if an declaration is detected inside nested-externs extern a function. warn if parentheses are suggested around an parentheses expression. warn if the size a function type or type...
  • Page 145 ic960 Compiler Driver w (Diagnostic-level) Controls listing or display of diagnostic messages. w level is the level of diagnostic messages to be listed or level displayed; can be , or Default The compiler displays error and major warning messages; that is, level Discussion Use the...
  • Page 146 Processor Compiler User's Guide (Warnings) option can be used to enable/disable specific warnings that would otherwise fall under the control of the (Diagnostic-level) option. Example The following example displays warning and error diagnostic messages: ic960 -c -w1 proto.c Related Topics...
  • Page 147 ic960 Compiler Driver Discussion When linking an instrumented program to generate profile information, during the Decision-making step, and during Profile-driven Recompilation, the location of the program database (PDB) must be specified. You can use the (Program database) option to override or to indicate where the PDB is located if is not I960PDB...
  • Page 148 Processor Compiler User's Guide Example The following example produces the listing file containing a list.t source text listing for the file proto.c ic960 -c -Z list.t proto.c Related Topics Stop-after options (List) z (List) Produce listing file. z arg ...
  • Page 149 ic960 Compiler Driver Default The compiler does not produce any listing files. Discussion Use the (List) option to generate a listing file for each primary source file and to specify the listing file contents. The applies to all listing files produced. A listing file contains, at a minimum, the source text from the primary source file and diagnostic messages according to the diagnostic level.
  • Page 150 Processor Compiler User's Guide Include Line Level Number Source Lines ======= ====== ============ # Command line (ic960): ic960 -c -z cosmi complex.c # Command line (cc1): /ffs/p1/dev/src/gcc960/timc.sun4/cc1 .960 -ic960 -ffancy-errors -sinfo /usr/tmp/ica29412.sin -fno-builtin -quiet -Fcoff -mkb -mic3.0-compat -fsigned-char -w1 -O1 -fno-inline-functions -clist siomc -dcmd "ic960 -c -z cosmi complex.c"...
  • Page 151 ic960 Compiler Driver .text .align .def _main; .val _main; .scl 2; .type 0x40; .endef .globl _main Function 'main' Registers used: g0 g1 g2 g3 g4 g5 g6 g7 fp r4* r5* r6* r7* _main: 48(sp),sp #Prologue stats: Total Frame Size: 48 bytes Local Variable Size: 48 bytes Register Save Size: 0 regs, 0 bytes #End Prologue#...
  • Page 152 Processor Compiler User's Guide 11 ADD_COMPLEX (z, x, y); +++++ z .x = x .x+ y .x; z .i = x .i+ y .i; ; # lda 1.74499999999999992895e1,r4 0x33333333,r4 0x40317333,r5 mov l r4,r6 r6,96(fp) # lda 9.48000000000000042633e0,r4 0x8f5c28f6,r4 0x4022f5c2,r5...
  • Page 153 ic960 Compiler Driver is the location of a line relative to the line-number beginning of the file containing that line. is a line of source text. source-line A line with an expanded macro appears after the corresponding source line in the following format: source-line +++++ macro-expanded-line...
  • Page 154: Introduction

    Program-wide Analysis and Optimization Introduction This chapter teaches you how to use some of CTOOLS most powerful optimization features: • individual module optimizations • program-wide optimizations • run-time profiling To use the first two features you are going to: 1. Create a program database. 2.
  • Page 155: About Profiling

    Processor Compiler User's Guide optimization decisions. Throughout this chapter, standard (i.e., non- program-wide) optimizations are referred to as module-local optimizations. About Profiling The compiler can also collect information about the runtime behavior of a program by instrumenting the program. The instrumented program can be...
  • Page 156: Chapter 4 Program-Wide Analysis And Optimization

    Program-wide Analysis and Optimization The PDB can be specified by setting the environment variable G960PDB (gcc960 driver) or (ic960 driver) to the correct location. You I960PDB can also specify the PDB at compiler invocation time with the Z dir (gcc960) or (ic960) option, as shown in the examples below.
  • Page 157: Selecting Modules For Optimization With Substitution Specifications

    Processor Compiler User's Guide You can use multiple options in a linker or compiler invocation gcdm command, and each option can have multiple comma-separated gcdm arguments. (The option and its arguments are fully described in gcdm Chapter 6, gcdm Decision Maker Option, in this manual.)
  • Page 158: Profiling Your Program

    Program-wide Analysis and Optimization NOTE. The optimized replacements for are present in fee.o foo.o the linked program but never appear in the current working directory. Profiling Your Program Compiling for Profile Instrumentation with -fprof As mentioned above, information on the runtime behavior of the program can be used by the compilation system during the global decision making and optimization step.
  • Page 159: Building Self-Contained Profiles With Gmpf960

    Processor Compiler User's Guide Building Self-contained Profiles with gmpf960 A “raw” profile contains program counters, which count how many times various statements in the source program have been executed. Information in the PDB is needed to correlate these program counters with the source program.
  • Page 160: Using Profiles During Global Decision Making And Optimization With -Gcdm,Iprof

    Program-wide Analysis and Optimization database directory. The filename extensions for the profile .spf files in this example are arbitrary; the different types of profiles are recognized by their contents, not by their filename extensions. After a self-contained profile is created, you can specify it for the global decision making and optimization step using the gcdm,iprof=file syntax as described in the next section.
  • Page 161: Adapting Makefiles For Program-Wide Optimization

    Processor Compiler User's Guide Below is an example of a makefile (where is set appropriately): targ SUBST= PROF= MODULES=*:* OPT=-fdb "-gcdm,subst=$(MODULES)+$(SUBST),iprof=$(PROF)" FLAGS=-T targ $(OPT) OBJECTS=fee.o foo.o main.o prog: $(OBJECTS) force ic960 -o prog $(FLAGS) $(OBJECTS) .c.o: ic960 -c $(FLAGS) $<...
  • Page 162 Program-wide Analysis and Optimization The appropriate location for the PDB directory is probably in the directory where the makefile compiles and links the object modules. For example, the UNIX and Windows statements below are suitable for many users. (UNIX) setenv I960PDB ./pdb (Windows) set I960PDB ./pdb Replacing Optimization Options with fdb and gcdm...
  • Page 163: Using Makefiles With Program-Wide Optimizations For Common Development Tasks

    Processor Compiler User's Guide • The global decision-making and optimization step manages the results of previous work in the PDB so that all previously generated modules are reused whenever possible. The system keeps multiple sets (currently, two) of the most recently used substitution modules in the PDB, indexed by the substitutions that generated them.
  • Page 164 Program-wide Analysis and Optimization This causes the object modules in the program to be compiled and then linked with the options in the macro. The make tool then issues the FLAGS following commands: ic960 -c -Ttarg -fdb -gcdm,subst=*:*+O5,iprof= fee.c ic960 -c -Ttarg -fdb -gcdm,subst=*:*+O5,iprof= foo.c ic960 -o prog -Ttarg -fdb -gcdm,subst=*:*+O5,iprof= fee.o foo.o The link command causes substitution modules at optimization level...
  • Page 165 Processor Compiler User's Guide Building an Instrumented Program You can create a profile-instrumented program either of two ways: compile source modules with the option, or link object modules -fprof using a substitution. -gcdm,subst=+fprof • When compiling with , the object files generated in your -fprof working directory contain profile-instrumented code.
  • Page 166 Program-wide Analysis and Optimization Compiling Using the fprof Option To use the compiler option to create an instrumented load module: fprof 1. Edit the makefile to add -fprof FLAGS 2. Invoke the make tool without any substitutions, as follows: make SUBST= Since the object files depend on the makefile, and the makefile is edited, the make tool recompiles the modules before linking them: ic960 -c -Ttarg -fdb -fprof -gcdm,subst=*:*+,iprof= fee.c...
  • Page 167 Processor Compiler User's Guide Profiling a Program in Pieces Suppose that the target execution environment is memory limited so that cannot both be instrumented for profiling at the same fee.o foo.o time. You can use substitutions to make partially instrumented versions of...
  • Page 168: Runtime Support For Profile Collection

    Program-wide Analysis and Optimization make SUBST=O5 PROF=prog.spf Again, the make tool performs no compilations. The following link command is issued: ic960 -o prog -Ttarg -fdb -gcdm,subst=*:*,+O5, iprof=prog.spf fee.o foo.o This causes substitution modules at optimization level to be built (guided by the profile in ) to replace the original modules prog.spf fee.o...
  • Page 169: Merging Profile Data

    Profile Data Merging and Data Format (gmpf960) This chapter explains how to use gmpf960 to merge the execution profile data you learned how to collect in Chapter 4. You also learn how to use gmpf960 to create a report that shows how many times each basic block was “hit”...
  • Page 170: Gmpf960 Invocation

    Processor Compiler User's Guide gmpf960 Invocation The profile-merge utility recognizes a letter preceded by a hyphen (or on Windows hosts only, a slash ) as an option. For example, specifies the Outfile option on all hosts; is also accepted on Windows hosts.
  • Page 171 Profile Data Merging and Data Format (gmpf960) specifies an input file. You can specify multiple infile input filenames; gmpf960 processes them sequentially. Input files can be the results of a program execution or a previous merging of profiles. Discussion The gmpf960 utility merges the execution profiles in all files and infile stores the resulting profile in...
  • Page 172: Profile Format Specification

    Processor Compiler User's Guide Profile Format Specification Normally, the raw profile file is created automatically when default.pf your application calls . Alternatively, the gdb960 debugger supports exit command that you can use to extract the profile data from profile put target memory and write it to in the appropriate format.
  • Page 173 Profile Data Merging and Data Format (gmpf960) For example, assume that has the value 12 (12 __profile_data_length bytes is three 4-byte words), and that contains __profile_data_start the values 0x000090A4, 0x000000C7, and 0x00008FDD. Then the binary format of file (printed as hexadecimal words) would be: default.pf 0000000C 000090A4...
  • Page 174: Creating A Runtime Report With Gmpf960

    Processor Compiler User's Guide Example Assume that you have a text-format profile in file and a default.txt binary-format profile in file . The following invocations of default.pf gmpf960 merge these two profiles, writing the results in the binary-format file default.sum...
  • Page 175 Profile Data Merging and Data Format (gmpf960) The generated executable file can be downloaded to a Cyclone a.out i960 Cx processor-based evaluation board and executed using the following command mondb -ser a.out This execution generates the file which contains the default.pf...
  • Page 176 Number of Blocks: Number of Blocks Executed: Number of Blocks Never Executed: Percentage of Blocks in Source File that were executed: 100.00% Program database: Program profile: default.pf See the i960 Processor Software Utilities User’s Guide for more information on gcov960.
  • Page 177: Chapter 6 Gcdm Decision Maker Option

    gcdm Decision Maker Option This chapter describes the option, which invokes the gcdm960 global gcdm optimization decision maker during the link process. The decision maker then invokes the compiler and linker as necessary to perform program- wide optimizations. For an overview of how to use this option, see Chapter 4, Program-wide Analysis and Optimization.
  • Page 178: Gcdm Option Arguments

    Processor Compiler User's Guide Table 6-1 gcdm Option Arguments (continued) Section Titles gcdm Option Arguments Description • inline= n Sets the level of inlining Inlining Level used by the compiler. Control • iprof= file Causes profile Input Profile information to be used...
  • Page 179: Whole-Program Optimization Option (Category 1)

    gcdm Decision Maker Option describe substitution and substitution suppression. Detailed information on controlling optimizations is presented in the discussion of option- in the next subsection. list Substitution Specifications subst={ module-set }{ option-list } In the linked program, gcdm,subst={ module-set }{ option-list } causes substitution of modules optimized according to the option-list for all of the modules in...
  • Page 180 Processor Compiler User's Guide arguments correctly, based on which compiler driver you are using.) The module-local substitution options are not allowed in an with option-list whole-program optimization (Category 1) options. causes generation of profile instrumentation, as +fprof described for the...
  • Page 181: Miscellaneous Substitution Options (Category 3)

    gcdm Decision Maker Option correctly, based on which compiler driver you are using.) These are typically used for the following purposes: • to substitute a few non-optimized modules into a program built with program-wide optimizations in order to help debug it. •...
  • Page 182 Processor Compiler User's Guide assembly code in the listing. In order for preprocessed source code to be displayed in listings generated by substitutions, the clist modules must either have been originally compiled with the ic960 driver or compiled with the gcc960 driver using the...
  • Page 183: External Reference Controls

    gcdm Decision Maker Option Substitution Suppression • nosubst= module-set argument suppresses substitution for the nosubst= module-set named modules. This is equivalent to (the subst= module-set + option- consists only of a character). is typically used to exclude list nosubst a subset of modules from a previous subst For example, the option and argument:...
  • Page 184: Input Profile Control

    Processor Compiler User's Guide Input Profile Control • iprof= file This control causes the profile information in to be incorporated into file program-wide optimization decisions. is a raw profile or a self- file contained profile. See Chapter 4 for a discussion of profiles.
  • Page 185: Dryrun Control

    gcdm Decision Maker Option Dryrun Control dryrun argument echoes the commands that would be executed to dryrun implement all specified options into the report file, without actually subst doing the optimization work. Report Controls option arguments listed here allow for creation of various gcdm optimization reports and creating and naming a report file.
  • Page 186 Processor Compiler User's Guide The third line shows that no variables were allocated into high-speed memory. The fourth line shows that two call sites were inlined. rdecisions Creates a report that includes the initial and goal text sizes as described...
  • Page 187 gcdm Decision Maker Option • field is the call site number of the call to this function. Site Each call site in a function is assigned a number starting with 1. • field has two meanings. When applied to a calling Count function the count is the number of times this function was called during all profiled executions.
  • Page 188 Processor Compiler User's Guide rprofile Prints the profile counts for the basic blocks that were hit to the report file. • field is the line number within the file. Line# • field is the basic block that corresponds to this line Block# number.
  • Page 189: Module-Set Specification

    gcdm Decision Maker Option Module-set Specification A module-set specification (used in substitution controls and external reference controls, described earlier in this chapter) selects a subset of zero or more modules from the set consisting of all eligible modules in the program.
  • Page 190: Data Representation

    4-byte (32-bit) variable is the address of the high-order byte of the variable. Scalars A scalar data type holds a single value, such as the integer value 42 or the bit string 10011. Table 7-1 lists scalar data types for the i960 processor.
  • Page 191: Scalar Data Types

    Processor Compiler User's Guide Table 7-1 Scalar Data Types Size Data Type (bytes) Format Range unsigned char ordinal 0 to 255 [signed] char 2's-complement -128 to 127 integer unsigned short ordinal 0 to 65535 [signed] short 2's-complement -32768 to 32767...
  • Page 192 Table 7-1. NOTE. The compiler does not support the 64-bit long-ordinal and long- integer data types available for the assembler and the i960 architecture. On architectures with an internal floating-point unit (80960KB/SB), the compiler uses 32-bit and 64-bit general registers for intermediate results when performing calculations with data types.
  • Page 193: Aggregates

    Processor Compiler User's Guide The alignment of a scalar data type is equal to its size. Although the extended-precision floating-point representation of requires long double only 10 bytes (80 bits), the natural architectural alignment of long double is 16 bytes. Therefore, to accommodate the semantic requirements of the operator, the size of a is 16 bytes.
  • Page 194 Language Implementation Structure Alignment The alignment of a structure affects how much space the structure occupies and how efficiently the processor can address the structure members. A compiler option (for gcc960, ; for ic960, mi960_align allows selection of any of the following alignment options for structures: Optimal natural is the default alignment.
  • Page 195 Processor Compiler User's Guide Structure alignment can result in unused space, called padding, between members of the structure and between the last member and the end of the space occupied by the structure. The padding at the end of the structure is called tail padding.
  • Page 196 Language Implementation Union types align according to the greatest alignment requirement of any member of the union. In the example below, aligns on a 4-byte boundary since the alignment of , the largest element, is 4: union un1 { short a; /* 2 bytes */ char b;...
  • Page 197: Natural Alignment

    Processor Compiler User's Guide Figure 7-1 Natural Alignment Byte 0 XXXX XXXXXXXX OSD829 Specifying a user-constrained alignment changes both the tail padding and the padding between structure members, which can also affect the structure size. A user-constrained alignment smaller than the natural alignment of a structure can result in a more tightly packed structure, saving space but slowing execution.
  • Page 198: User-Constrained Alignment

    Language Implementation Figure 7-2 User-constrained Alignment Alignment is 2; Size is 10 Byte 0 XXXX XXXX Alignment is 1; Size is 8 Byte 0 OSD830 A user-constrained alignment larger than the natural alignment aligns the structure on the natural-alignment boundaries. User-constrained alignment can increase the amount of tail padding relative to natural alignment but does not increase the padding between members of a structure.
  • Page 199 Processor Compiler User's Guide has natural alignment, one byte of padding appears struct NATURAL between the members . Under optimal natural alignment, the size is 8 and the alignment is 8. Under backward compatible natural alignment, the size is 6 and the alignment is 2. If...
  • Page 200 Language Implementation • If the value of the container bit position plus the size in bits of the new bit field is greater than 32 or if the size of the new bit field is zero, the compiler inserts padding to align the bit field on the next container alignment boundary.
  • Page 201: Optimal Natural Alignment Of Std_Struct

    Processor Compiler User's Guide Figure 7-3 shows the optimal natural alignment of the structure, without any alignment pragma. Figure 7-3 Optimal Natural Alignment of std_struct Byte 0 XXXXXXXX XXXXXXXX mbit7 mbit5 XXXX mbit6 XXXXXXXX XXXXXXXX XXXXXXXX m8a (continued) XXXXXXXX...
  • Page 202: Backward-Compatible Natural Alignment Of Std_Struct

    Language Implementation Figure 7-4 Backward-compatible Natural Alignment of std_struct Byte 0 XXXXXXXX XXXXXXXX XXXX mbit7 mbit5 XXXXXXXX XXXXXXXX XXXXXXXX mbit6 m8a (continued) OSD831 Figure 7-5 shows aligned on 1-byte boundaries, with the std_struct following alignment pragma: #pragma noalign (std_struct) Figure 7-5 #pragma noalign Alignment of std_struct Byte 0 m4a (continued)
  • Page 203: Other Type Keywords

    I/O registers or data accessed by interrupt functions. Calling Conventions This section describes the standard i960 processor function calling convention and describes how the compiler generates code to conform to this calling convention.
  • Page 204: Definitions

    The standard i960 processor calling convention places an absolute minimum overhead on simple, commonly called functions with few parameters. This is done by passing information between the calling function and the called function in the i960 architecture's global registers as much as possible. Definitions...
  • Page 205 BAL instruction. is defined by the i960 architecture as the frame pointer (FP). If the function returns a long double and generates code for the KB or SB processor and compatibility with ic960 R2.0 is requested, then...
  • Page 206: Parameter Assignment To Registers

    Language Implementation The 16 local registers ( through ) are 32-bit registers that provide a separate set of registers for each active function. Each time a function is called, the processor automatically sets up a new set of local registers for that function and saves the local registers for the calling function.
  • Page 207: Return Values

    Processor Compiler User's Guide argument block. The calling function is responsible for the creation of an argument block if one is needed. When an argument block is created it must contain enough space at the beginning to store all the possible parameter registers .
  • Page 208: Object Module Section Use

    Language Implementation Object Module Section Use The compiler generates assembly language that uses the following object file format sections to allocate storage for code and data: The compiler places all assembly language .text instructions and constant data in the .text section.
  • Page 209: Pragmas

    Processor Compiler User's Guide For more discussion of object module formats, refer to the i960 Processor Software Utilities User's Guide. NOTE. The compiler does not allocate storage in any section for variables declared as . Storage is allocated in the module extern defining the variable.
  • Page 210 Language Implementation To get the alignment for a struct or union , given #pragma align n • be the largest alignment of all members of • 's unpadded size rounded up to the next power of 2. • then align(u) = max (m, min (n, s)) Thus, a structure can never be given an alignment requirement that is less than the largest alignment required for any of its members;...
  • Page 211: Pragma Align [For Ic960, Or For Gcc960 With Ic960 Option]

    Processor Compiler User's Guide #pragma align [for ic960, or for gcc960 with ic960 option] #pragma align [ [(] size [)]] #pragma align [(] identifier [= size ][,...][)] #pragma noalign [ [(] identifier [,...][)] ] specifies the alignment value in bytes. Any of...
  • Page 212 Language Implementation The compiler aligns a type at the opening brace that brackets the struct declaration list, according to the following rules: struct Rule 1 If the type has a tag and the tag identifier has appeared struct in an alignment pragma, the alignment is specified by the most recent alignment pragma for the tag identifier.
  • Page 213 Processor Compiler User's Guide /* 2-byte boundaries and is the largest*/ /* member of inner2; thus the default /* alignment of inner2 is 2. int i2; #pragma noalign (outer3) /* outer3 is packed. */ struct outer3 { struct { /* Since the inner structure has no tag, it*/ short s;...
  • Page 214 Language Implementation The following example shows alignment of a structure using the structure identifier #pragma align my_structure struct my_structure /* natural alignment */ char f1; #pragma noalign my_structure2 struct my_structure2 /* no alignment; i.e. */ /* 1-byte alignment char f1; #pragma align my_structure3 = 16 struct my_structure3 /* 16-byte alignment */...
  • Page 215: Pragma Cave

    Processor Compiler User's Guide #pragma cave #pragma cave [ [(] function [...] [)] ] specifies function(s) for the compiler to prepare function for compression. If no function is specified, the pragma applies to all functions defined following the pragma.
  • Page 216 Language Implementation Selecting Functions for Compression The gcc960 option, the ic960 option, or mcave Gcave #pragma cave used to designate the specified functions as secondary. You can use runtime profile information generated by gcov960 to aid in selecting the set of secondary functions. Linking The compiler places secondary function bodies within special CAVE sections (named...
  • Page 217 Processor Compiler User's Guide Runtime Decompression During program execution secondary functions reside in memory in compressed form. Every call to a secondary function is intercepted at runtime by a special dispatcher routine. The dispatch routine is contained in the library supplied with the tools.
  • Page 218 Language Implementation used by the dispatcher to search the stack for the existing recursive activation. If found, the function is called immediately. The dispatcher decompresses and executes secondary functions on the current runtime stack. Allocation and freeing of decompression memory is performed automatically through the call and return mechanism.
  • Page 219: Pragma Compress

    Processor Compiler User's Guide 4. The last two instructions in the dispatcher are: callx 80(r10) is a call to a decompressed secondary function. Set a callx breakpoint on and step into the function. callx 6. Continue debugging the function on the machine level.
  • Page 220: Pragma I960_Align [For Gcc960 And Ic960]

    Language Implementation addressing modes. Single-line instructions for compare-and-branch instructions are not generated. In addition, disables some optimizations that increase #pragma compress code size greatly: automatic function inlining and loop unrolling. If you do not specify , the code compression pragma applies to function all functions following the pragma.
  • Page 221: Pragma Interrupt

    Processor Compiler User's Guide Default The compiler does not replace the function call with the function's body. has effect at optimization level 1 and higher. #pragma inline Chapter 11 describes optimization levels in more detail. Discussion to replace a function call with the function body #pragma inline expanded at the place of the function call.
  • Page 222 Language Implementation The compiler stores saved registers in contiguous locations, starting at offset from the frame pointer, as follows: 0x40 • 0x40(fp) • 0x50(fp) • 0x60(fp) • 0x7c(fp) In processors with on-chip floating-point support, the compiler saves floating-point registers through starting at 0x80(fp) An interrupt handler must not have parameters or return a value.
  • Page 223: Pragma Isr

    Processor Compiler User's Guide #pragma isr Specifies routines to be compiled as interrupt service routines ( 's). The syntax is: #pragma isr [(] function_name [ [,] function_name ]...[)] When a routine specified as an interrupt service routine is compiled, the...
  • Page 224: Pragma Pack

    Language Implementation #pragma pack #pragma pack n When used without an alignment pragma or option, this pragma has the same effect for both the gcc960 driver and the ic960 driver: it restricts the maximum alignment value that is honored for structure members to bytes.
  • Page 225: Example Offset Values

    Processor Compiler User's Guide would be placed at offset 2 from the base of sizeof(struct s) would be 6 under gcc960’s ) and 8 under mic-compat #pragma align 1 default alignment ( ). The formal alignment #pragma align 16...
  • Page 226: Pragma Pure

    Language Implementation #pragma pure Specifies that a function has no effects other than returning a computed value and that it does so based solely on its input parameters. #pragma [no]pure [ ( function [,... ] ) ] identifies the specific function to which the function pragma applies.
  • Page 227: Pragma Section

    Processor Compiler User's Guide #pragma section Allows COFF or ELF section naming. #pragma section [ string ] is alphanumeric characters a-z, A-Z, 0-9. string Discussion This pragma causes all text, data and bss sections the compiler emits to be suffixed with .
  • Page 228: Language Extensions

    Since register is used for the system function index, a system function cannot return a value larger than four words. Refer to the i960 Processor Software Utilities User's Guide for more information. Language Extensions GNU C provides several language features not found in ANSI standard C.
  • Page 229: Statements And Declarations Inside Of Expressions

    Processor Compiler User's Guide Statements and Declarations Inside of Expressions A compound statement in parentheses can appear inside an expression. This allows you to declare variables within an expression. For example: ({ int y = foo (); int z;...
  • Page 230: Referring To A Type With Typeof

    Language Implementation This is useful in conjunction with the statements-within-expressions feature. Here is how the two together can be used to define a safe "maximum" macro that operates on any arithmetic type: #define max(a,b) \ ({typedef _ta = (a), _tb = (b); _ta _a = (a);...
  • Page 231: Generalized Lvalues

    Processor Compiler User's Guide construct can be used anywhere a typedef name could be used. typeof For example, you can use it in a declaration, in a cast, or inside of sizeof typeof • This declares with the type of what points to: typeof (*x) y;...
  • Page 232 Language Implementation Similarly, the address of the compound expression can be taken. These two expressions are equivalent: &(a, b) a, &b A conditional expression is a valid lvalue if its type is not void and the true and false branches are both valid lvalues. For example, these two expressions are equivalent: (a ? b : c) = 5 (a ? b = 5 : (c = 5))
  • Page 233: Conditional Expressions With Omitted Middle Operands

    Processor Compiler User's Guide Conditional Expressions with Omitted Middle Operands The middle operand in a conditional expression may be omitted. Then if the first operand is nonzero, its value is the value of the conditional expression. Therefore, the expression:...
  • Page 234: Non-Lvalue Arrays Can Have Subscripts

    Language Implementation In standard C, you would have to give a length of 1, which contents means either you waste space or complicate the argument to malloc Non-lvalue Arrays Can Have Subscripts Subscripting is allowed on arrays that are not lvalues, even though the unary operator is not.
  • Page 235: Non-Constant Initializers

    Processor Compiler User's Guide Non-constant Initializers The elements of an aggregate initializer for an automatic variable are not required to be constant expressions. Here is an example of an initializer with run-time varying elements: foo (float f, float g) float beat_freqs[2] = { f-g, f+g };...
  • Page 236: Declaring Attributes Of Functions

    Language Implementation Array constructors whose elements are not simple constants are not very useful because the constructor is not an lvalue. There are only two valid ways to use it: to subscript it, or initialize an array variable with it. The former is probably slower than a statement, while the latter does switch...
  • Page 237: Inquiring About Alignment

    Processor Compiler User's Guide Inquiring about Alignment The keyword allows you to inquire about how an object is __alignof__ aligned, or the minimum alignment usually required by a type. Its syntax is just like sizeof For example, the target machine requires a...
  • Page 238 Language Implementation (If you are writing a header file to be included in ANSI C programs, write instead of . See the Alternate Keywords section.) __inline__ inline You can also make all "simple enough" functions inline with the option . Note that certain usages in a function definition finline-functions can make it unsuitable for inline substitution.
  • Page 239: Controlling Names Used In Assembly Code

    Processor Compiler User's Guide ) in a library file. The definition in the header file causes most extern calls to the function to be inlined. If any uses of the function remain, they refer to the single copy in the library.
  • Page 240: Specifying Registers For Local Variables

    Language Implementation It is up to you to make sure that the assembler names you choose do not conflict with any other assembler symbols. Also, you must not use a register name; that would produce completely invalid assembler code. Specifying Registers for Local Variables You can define a local register variable with a specified register like this: register int *foo asm ("r5");...
  • Page 241: Inline Assembly Language

    Processor Compiler User's Guide Inline Assembly Language Introduction Two distinct styles of inline assembly language are supported by the compilation system: asm statements and asm functions. The recommended way to use inline assembly language is asm statements; asm functions are supported for compatibility with previous CTOOLS960 releases.
  • Page 242: Asm Statements

    Language Implementation the compiler treats the body of an function as text. The compiler parses the text for symbolic names (parameters, local temporaries, and labels). However, the compiler does not recognize function calls, memory references, or explicit register usage within the function text.
  • Page 243 Processor Compiler User's Guide Example 1: sf1 (Simple) asm volatile ("mov 0,sf1"); Example 2: sf1 (Complex) asm volatile ("mov sf1,%0; mov %1,sf1": "=&d" (old_mask) : "dI" (new_mask)); Example 3: emul asm("emul %1,%2,%0" : "=t" (temp) : "dI" (in1), "dI" (in2));...
  • Page 244 Language Implementation clobber-list clobber-spec [,clobber-list]... output-spec "=constraint" (C language object) input-spec "constraint" (C language expression) clobber-spec "regname" NOTE. The keywords can be used in place of __asm __volatile volatile asm Syntax Explanations asm Keyword asm statements begin with the keyword .
  • Page 245 Processor Compiler User's Guide Generally, this fixed string is the body of the desired assembler instruction. This can be any instruction valid for the current i960 architecture. NOTE. The validity of the assembly code is not checked by the compiler.
  • Page 246 Language Implementation is numbered. The first operand in the output-spec out-list numbered 0, the second is 1, and so on. Numbering is continuous through , and into the . The total number of operands is out-list in-list limited to 10 (i.e., 0-9). See above.
  • Page 247 Processor Compiler User's Guide clobber-spec clobber-spec " regname " Each specifies the name of a single machine register that clobber-spec is "clobbered." Resources that cannot be clobbered are: (the frame pointer) (the stack pointer) (reserved) C language object This can be any assignable C language lvalue. Typically this is just a variable name.
  • Page 248 Language Implementation consists of one or more of the characters listed below. constraint The compiler generates code if necessary to make the C language match one of the characters. The object expression constraint associated operand is an integer literal or a machine register or an assembly label that is put in place of a substitution directive.
  • Page 249 Processor Compiler User's Guide Allows any floating-point register fp0 through fp3. This is only valid for the i960 constraint KB and i960 SB processors and only then if the gcc960 option is not used. msoft-float Allows any memory operand.
  • Page 250 The following example refers to the short C program shown in Example 7-1 below. The asm instruction is shown in bold. Example 7-1 sf1.c (Simple) /* Clears interrupt mask in sf1 for i960 CA processor */ void clear_interrupt_mask() asm volatile ("mov 0,sf1");...
  • Page 251 Processor Compiler User's Guide Example 2: sf1.c (Complex) The following example refers to the short C program shown in Example 7-2. The asm containing the instruction is shown in bold. Example 7-2 sf1.c (Complex) * Changes interrupt mask, and returns old interrupt mask * for i960 CA microprocessor.
  • Page 252 Language Implementation • is the only . It is operand 1. The " " "dI" (new_mask) input-spec indicates that operand 1 must be in a word register, or be constraint a constant from 0 to 31. The compiler generates extra code as necessary to make sure matches one of the new_mask...
  • Page 253 Processor Compiler User's Guide Example 7-3 emul.c (continued) return t.lo32; else if (t.hi32 == 0) /*upper32 matches lower32 sign bit */ return t.lo32; overflow_error("32 bit multiply overflowed"); return t.lo32; Consider the line containing the asm: asm("emul %1,%2,%0" : "=t" (temp) : "dI" (in1), "dI" (in2));...
  • Page 254 Language Implementation into a two-word register. Similarly, must match at least one of their because their size and alignment is the constraints same as that required for a value in a word register. Compile this example using: gcc960 -S -O2 emul.c NOTE.
  • Page 255 "synmovq %2,%3" asm-template synmovq words into reserved memory on the i960 KB processor, and then sends a message to the i960 processor telling it to do a software interrupt. takes two arguments, , where is the location synmovq to copy from, and is the location to copy to.
  • Page 256 Language Implementation Example 5: atadd.c The following example refers to the short C program shown in Example 7-5 below. The asm containing the instruction is shown atadd in bold. Example 7-5 atadd.c static inline int atadd(p, val) volatile int *p; int val;...
  • Page 257 Processor Compiler User's Guide • is the second . It is the second operand, "=d" (wtmp) output-spec i.e., operand 1. The indicates that any global or "d" constraint word register can be used. • is the first . It is the third operand, input-spec "dI"...
  • Page 258 " is the . The instruction modpc %1,%1,%0" asm-template modpc reads and modifies the i960 architecture's process control register. The instruction takes three arguments. • is the only . It is the first operand, i.e., "=d"(new_pc) output-spec operand 0. The indicates that this is an output "=d"...
  • Page 259: Asm Functions

    Processor Compiler User's Guide • is the second . It is operand 2. The "0" (new_pc) input-spec "0" constraint indicates that this operand and operand 0 must be allocated to the same register. This is required because in the asm-template this register is both a source and a destination.
  • Page 260 Language Implementation function definition can contain one or more templates. The compiler selects a template for expansion based on the values and data types of arguments you specify and based on use of any return value in the function call. Use of any C expression as an argument to an function is legal.
  • Page 261 Processor Compiler User's Guide The following restrictions apply to parameter lists: • function cannot be a function; that is, an stdarg parameter list cannot contain an ellipsis ( . . . • Each declaration in an parameter list must include an identifier.
  • Page 262 Language Implementation Selection Criteria and Coercion If a control line contains an control and no parameter error call declarations, the control line unconditionally matches any call. If a control line contains any parameter declarations or does not contain an control, the control line matches a call only when the error call argument categories match the parameter declarations in the control line.
  • Page 263 Processor Compiler User's Guide • Ensuring that the last control line unconditionally matches any call context. Unless the final control line in the function definition contains nothing but an control, the compiler adds a error call final control line containing a...
  • Page 264: Argument Category To Parameter Class Matching And Coercion

    Language Implementation Table 7-3 Return Value Class Matching Return Value Use Return Class void ftmpreg tmpreg • • • not used • • used • A bullet ( ) indicates a match. A hyphen ( ) indicates no match. Table 7-4 Argument Category to Parameter Class Matching and Coercion Argument Parameter...
  • Page 265 Processor Compiler User's Guide Parameter Classes parameter or return class can be any of the following: places the parameter in a general-purpose tmpreg register, of the compiler's choice, that the function can modify. For a parameter tmpreg longer than one word, specify the number of...
  • Page 266 Language Implementation For a parameter longer than one word, reglit specify the number of registers needed in parentheses after . For example, reglit allocates three consecutive registers. reglit(3) is specified without a number of reglit registers, the default is reglit(1) return value also occupies the reglit specified number of registers.
  • Page 267: C Data Types And Asm Classes

    Processor Compiler User's Guide Declarations must be consistent between the function prototype and the control line. If the class of a parameter or return register does not match the declared C parameter or return type, the compiler issues a warning message.
  • Page 268 Language Implementation Argument Categories An argument category can be any of the following: General-register is a register-resident value (e.g., a register variable variable). Depending on the level of optimization, this category can include a more complex expression. During compilation, the expression must evaluate to a register-resident variable that is one of the operands in the expression.
  • Page 269 Processor Compiler User's Guide constant. For example, the expressions x+5-x , and can evaluate to constants during compilation if the value of is a known value at compile time. Floating-point is a constant floating-point value. The rules for constant...
  • Page 270 Language Implementation • If you do not specify a name in the control, the compiler uses the call name of the function. For example, calling the following as results in a call to an external function named select(3) select asm int select (int i) % const(-2:2) i;...
  • Page 271 Processor Compiler User's Guide parentheses after the identifier. For example, selects the first itmp(0) register of . If is declared on the control line as itmp itmp itmp(4) specify to select the fourth register allocated for itmp(3) itmp NOTE. If a template uses a label, multiple expansions of that template can result in more than one label with the same name, causing ambiguous branch or jump destinations.
  • Page 272 Language Implementation declares that the named function has no pure effect other than returning a computed value. Specifically, no I/O is performed, no global variables or memory locations are read or modified, and no modifications of registers occur, except those explicitly defined by the calling sequence.
  • Page 273 Processor Compiler User's Guide The following is a C language program Sequential Template Expansion. that uses an function with two expansion templates: #define status_reg 0xFE00FF00 asm int poll(void) % void return; tmpreg t; spillall; status_reg, t; #first template % reglit return; spillall;/* return the current status */ status_reg, return;...
  • Page 274 _service_device The following example shows an block that sends an IAC Breakpoint. inter-agent communication (IAC) breakpoint to the processor. For information on the IAC structure, see the i960 KB processor manual. struct message { unsigned short field2; unsigned char field1;...
  • Page 275 Processor Compiler User's Guide * Send a breakpoint IAC to the processor. * address is supplied by the routine that calls * set_bp. Do not forget to enable breakpoints in the * trace control. Fields 1, 2, and 5 are not used.
  • Page 276: Char And Short Parameters

    gcc960 / ic960 Compatibility This chapter describes the incompatibilities between ic960 and gcc960, and between the current release of gcc960 and other releases of ic960. char and short Parameters The ic960 R3.0 compiler expects parameters and return char short values to be clean upon entry to and exit from procedures. Since these types are passed and returned in registers, this means that, in the case of types, the sign bit must be extended, and in the case of signed...
  • Page 277: Architecture Macros And Compatibility

    __i960 __i960 xx _i960 (e.g., CA for the i960 CA processor, as selected by the option). These are the recommended macros for testing for the i960 processor architecture. For compatibility reasons, the compilation system also defines additional variations on these macros, as shown in Table 8-1.
  • Page 278: Pragma Align

    gcc960 / ic960 Compatibility #pragma align ic960 and gcc960 both implement a directive. They #pragma align interpret the pragma differently, and the results (changes in the alignment of members of structures) are not compatible. In the absence of this pragma, ic960 and gcc960 structures should be compatibly aligned. is provided for compatibility with ic960's pragma i960_align pragma...
  • Page 279: Position-Independent Code And Data

    Position Independence and Reentrancy This chapter describes reentrancy and position-independence. Use it for writing i960 processor applications that require position-independent or reentrant programs. Position independence enables relocation of both the sections. The following sections describe position .text .data independence, position-independent addressing modes, and reentrancy.
  • Page 280: Position-Independent Code

    Processor Compiler User's Guide For example, suppose object is in the or the section. .data .bss Normally, the compiler generates an address of the object with an absolute addressing mode: lda _x, g0 When you compile your program with position-independent data, the...
  • Page 281: Example: Position-Independent Rom Code

    Position Independence and Reentrancy The first three instructions compute the difference between the link time address and load time address of the section. .text For example, if the code section links to begin at address zero, the subtraction result is the address at which the code section was actually loaded.
  • Page 282: Memory For Hypothetical Position-Independent Application

    Processor Compiler User's Guide Figure 9-1 shows memory allocation for board 1. When the code executes, the ROM code for either board loads at the correct address. Figure 9-1 Memory for Hypothetical Position-independent Application Top of Memory Slot for Card 2...
  • Page 283: Guidelines For Writing Relocatable Programs

    • Position-independent programs cannot be relocated during execution. For all i960 processors, the address space is flat (unsegmented) and byte-addressable. Addresses run contiguously from 0 to 2 -1. Programs can allocate space for data, instructions, and stack anywhere within the flat address space.
  • Page 284: Reentrant Functions

    Processor Compiler User's Guide In the compiler's output, contains the unbiased address of , and contains the unbiased address of . To use the initialized program must perform the correct biasing of values before the point where the program uses the pointers.
  • Page 285: Startup Code

    For a ROM-based application, the startup routine must: • Put the initialization boot record for the i960 processor in place. • Configure system data structures correctly. •...
  • Page 286  integer overflow  floating-point overflow  floating-point underflow  floating-point inexact • Since the i960 C-series and J-series processors' AC register does not allow setting of floating-point bits, use in the setup. The _setac routines are independent of architecture and...
  • Page 287 __HL_init libc.a library. For more information about high-level libraries, refer to the i960 Processor Library Supplement. • If performing profile-driven optimizations, the startup routine must call a profile initialization routine before calling any instrumented functions.
  • Page 288: Ram-Based Initialization

    Processor Compiler User's Guide RAM-based Initialization configuration file links the startup file to run lib/cycx.ld crt960.o a program under the MON960 monitor. ROM-based Initialization ROM-based startup routines must ensure that all the variable data is in RAM. The routines must do the following: •...
  • Page 289: Linker Configuration Files

    Use the (Target) linker option to specify the configuration file. For more detail on the (Target) option, see the i960 Processor Software Utilities User's Guide. 10-5...
  • Page 290: Ram-Based Configuration File

    The optional ROM-builder section of a configuration file contains commands to be passed to the rom960 utility. rom960 commands must begin with the characters in columns 1 and 2. The i960 Processor Software Utilities User's Guide provides explanations and examples of rom960 commands in a configuration file.
  • Page 291: Optimization Categories And Mechanisms

    • instruction selection and sequencing Some optimizations are independent of the i960 architecture and others take specific advantage of the i960 processor instruction set and registers. Program-level optimizations are also available when profile data exists for the program. 11-1...
  • Page 292: Optimizations And O Level Settings

    Processor Compiler User's Guide Table 11-1 Optimizations and O level Settings Optimization ic960 gcc960 Register management any level any level Branch prediction Code compression Constant-expression evaluation Identity collapsing Branch optimization Char/short cleaning reduction Dead-code elimination Leaf-function identification Local CSE elimination...
  • Page 293: Constants And Expression Evaluation

    Optimization Constants and Expression Evaluation The compiler can simplify some arithmetic and boolean calculations involving repeating expressions, constants, or operational identities. Optimizations involving such simplifications are: • common sub-expression elimination • constant expression evaluation • constant propagation • identity collapsing Each is explained in one of the following sections.
  • Page 294: Constant Expression Evaluation (Constant Folding)

    Processor Compiler User's Guide Constant Expression Evaluation (Constant Folding) A constant expression contains only constant operands and simple arithmetic operators. Instead of storing the numbers and operators for computation when the program executes, the compiler evaluates the constant expression and uses the result. Constant folding is another name for this optimization.
  • Page 295: Dead-Code Elimination

    Optimization Dead-code Elimination The compiler eliminates two kinds of dead code: unused when code generates a value that is not used subsequently in the program or in its output. unreachable when the control flow of the program can never execute the instructions. Unused code operations can arise from several sources, including: •...
  • Page 296: Constant Propagation

    Processor Compiler User's Guide Table 11-3 Examples of Identity Collapsing Original Replacement a + 0 a * 1 a * 0 x << 0 0 >> y Constant Propagation Programs often contain computations that produce the same value each time the program is executed.
  • Page 297 Optimization • A conditional branch instruction for which the condition is known is deleted. For example, this program fragment sets equal to are equal, which is never true: a=2; b=4; if (a==b) x=y+z; else x=y-z; • After constant propagation, the code contains these optimized instructions: a=2;...
  • Page 298 Processor Compiler User's Guide • A load operation from a memory location found to contain a constant value is replaced by a copy of the constant value into the destination register of the original instruction. For example, the following...
  • Page 299: Calls, Jumps, And Branches

    Optimizations that perform such restructuring include: • branch optimization • branch prediction for i960 Cx and Hx processors • leaf-function identification • inline function expansion •...
  • Page 300: Branch Prediction

    .L1: .L1: Branch Prediction The i960 Cx and Hx processors provide a branch-prediction bit in conditional branch instructions. If the prediction is correct, the branch takes no cycles to execute; otherwise, the branch takes one or more cycles. For further information on execution speed during branch prediction, refer to the i960 Cx Microprocessor User's Manual.
  • Page 301: Identification Of Leaf Functions

    For an explanation of the two entry points generated for leaf procedures, see the i960 Processor Assembler User's Guide and the i960 Processor Software Utilities User's Guide. Inline Function Expansion...
  • Page 302: Tail-Call Elimination

    Processor Compiler User's Guide In the following example, the function switches two numbers. The swap source text contains a function call: void swap(x,y) /* function body */ int *x, *y; int temp; temp = *x; *x = *y; *y = temp;...
  • Page 303 Optimization For example, the following algorithm for Ackermann's function uses tail calls: /* Ackermann's function with tail recursion */ int ack(int m,int n) if (m == 0) return n+1; else if (n == 0) return ack(m-1,1); else return ack(m-1,ack(m,n-1)); Tail-call recursion elimination produces the following: /* Ackermann's function with tail recursion eliminated */ int ack(int m,int n) label:...
  • Page 304: Loop Optimizations

    Processor Compiler User's Guide Here is C code to illustrate a simple tail recursion. print_bool (int v) if (v== 0) printf ("FALSE"); else printf ("TRUE"); return; Here is the generated assembly code. cmpibne 0,g0,L4 LC0,g0 _printf LC1,g0 _printf Loop Optimizations...
  • Page 305: Loop Unrolling

    Optimization Multiplication is a time-consuming operation. To generate faster code, the compiler can sometimes replace the multiply operation with an add operation. These methods improve the performance of the code whenever a value computed in a loop is a linear function of a loop iteration variable. Indexing arrays is the most common case.
  • Page 306: Variable Shadowing

    Processor Compiler User's Guide Variable Shadowing The compiler may place a memory object in a register throughout a single-entry, single-exit region (such as a loop) when it can determine that the following are all true: • There are no references to memory within the region that could overlap the candidate memory object.
  • Page 307: Local Variable Promotion

    The register allocator phase of the compiler assigns all register operands to the physical registers. For the KB/SB processors, the physical registers available for assignment include the four floating-point registers. For all i960 processors, the physical general-purpose registers available for assignment include through...
  • Page 308: Instruction Selection And Sequencing

    Although the effect of the code does not change, code scheduling can often improve code performance. Since different members of the i960 family of processors provide varying levels of hardware parallelism, the compiler orders the instructions differently according to the specific processor for which code is being generated.
  • Page 309 Optimization For example, on the i960 KA, KB, SA, and SB processors, the execution of a memory operation can overlap the execution of an arithmetic instruction, provided the memory operation occurs in the instruction stream first. The following code computes the expression...
  • Page 310: Specialized-Instruction Selection

    Processor Compiler User's Guide Specialized-instruction Selection A number of i960 processor instructions can help optimize code in special situations. The special code sequences recognized by the compiler, and the replacements used are as follows: • A bitwise instruction for which one of the operands is a constant...
  • Page 311: Superblock Formation

    Optimization function is called from multiple sites, it is better to inline the function at frequently executed call sites. The inlining decisions are made by the gcdm960 program during the profiling decision-making step. After the decisions have been made, the compiler performs the inlining during profile-driven recompilation.
  • Page 312: Profile-Based Branch-Prediction Bit Setting

    Processor Compiler User's Guide The left diagram shows that path A B D is heavily traveled and would thus be detected as a superblock candidate. To form a superblock from this candidate, it is necessary to remove the arc C D. This is done as shown in the middle diagram.
  • Page 313: Aliasing Assumptions

    Caveats This chapter provides useful programming tips on: • Aliasing assumptions • Alignment assumptions • Volatile object • Known problems • C version incompatibilities • Troubleshooting Aliasing Assumptions Some compiler optimizations (for example, ) use type fshadow-mem information as the basis for several assumptions. These assumptions exclude some pairs of memory references as possible alias candidates.
  • Page 314 Processor Compiler User's Guide pointer lvalues can access only objects of pointer type (regardless of the types pointed to) or character objects. structure lvalues can access only the objects that can be accessed by the members of the structure, or...
  • Page 315: Alignment Assumptions

    Caveats The compiler might conclude that the value of is unaffected by the assignment to , because double objects cannot legally be referenced by lvalues. It might then use this conclusion to rewrite the above code as follows: register double t = *pr; *pq = t;...
  • Page 316: Volatile Objects

    Processor Compiler User's Guide Here is an example of how these assumptions are used: #include <string.h> struct { int s1; int s2; int s3; } *s; /* (1) *s is assumed to be 16 byte aligned extern char mybuf[23];...
  • Page 317 Caveats Volatile objects are also presumed to have been changed in unknowable ways between such points. Here is an example of a program that fails because of a memory reference that needs to be made volatile: fiddle.c: #define MY_PORT *((int *) 0x10000) int read_my_port () { return MY_PORT;...
  • Page 318: Known Problems Using The Compiler

    Processor Compiler User's Guide All that is needed here is to make volatile, as follows: MY_PORT #define MY_PORT *((volatile int *) 0x10000) This suppresses (2), as must be considered to have changed MY_PORT between iterations of the loop. Known Problems Using the Compiler Here are some of the things that have caused trouble for people using the compiler.
  • Page 319: Longjmp And Volatile Data

    Caveats This code really is erroneous, because the scope of the struct mumble prototype is limited to the argument list containing it. It does not refer to defined with file scope immediately below — they are struct mumble two unrelated types with similar names in different scopes. But in the definition of , the file-scope type is used because that is available to be inherited.
  • Page 320: C Version Incompatibilities

    Processor Compiler User's Guide C Version Incompatibilities There are several noteworthy incompatibilities between Intel C for the 80960 architecture and some (non-ANSI) versions of C. String Constants Read-only The compiler normally makes string constants read-only. If several identical-looking string constants are used, the compiler stores only one copy of the string.
  • Page 321: Combining Long With Typedef Names

    Caveats In some other C compilers, an declaration affects all the rest of extern the file even if it happens within a block. option directs the compiler to treat all ftraditional extern declarations as global, like traditional compilers. Combining long with typedef Names In traditional C, you can combine , etc., with a typedef name, as long...
  • Page 322: Flagging Unterminated Character Constants

    Processor Compiler User's Guide Flagging Unterminated Character Constants The compiler flags unterminated character constants inside of preprocessor conditionals that fail. Some programs have English comments enclosed in conditionals that are guaranteed to fail; if these comments contain apostrophes, the compiler will probably report an error.
  • Page 323: C Interrupt Service Routine Failures

    Problem: The C function calling convention requires that the i960 processor register contain the value zero for all functions that take fewer than 14 words of parameters and are non-leaf procedures. Because of this, for most...
  • Page 324: Preventing Structure Padding

    C function, and restore those registers prior to returning from the interrupted state. Preventing Structure Padding You may be using an i960 processor to communicate with another processor. The communication involves passing structures between the two processors. The Intel compiler pads the structures, but the compiler for your other processor does not, causing passed structure members to contain incorrect values.
  • Page 325 Caveats However, has limitations. Although it can be used to #pragma align restrict the padding of aggregate data types (and arrays of those types) it does not change the alignment rules for individual structure members. For information on alignment rules for structure members, see the discussion in this manual.
  • Page 326 Processor Compiler User's Guide /* Read binary data from a file and copy into a * structure that has different alignment rules. */ main() fdesc; unsigned char *ptr; /* Assume file opened and ready for reading... * Then read one struct’s worth of bytes. */ if (read(fdesc, packed, 7) != 7) { /* Handle read error.
  • Page 327: Breakpoints Inside Interrupt Handlers

    Problem: When the i960 processor invokes an interrupt handler, it first disables tracing by saving, then clearing, the state of the trace-enable bit and the trace-fault-pending flag. On return from the interrupt handler, the processor restores the process-controls register to its state prior to the interrupt.
  • Page 328 Messages This chapter describes the diagnostic messages that the compiler produces when invoked with the ic960 driver, or with the gcc960 driver and the option. (Invoking the compiler with ffancy-errors ic960 -Jgd produces the corresponding gcc960-style message format and output.) On UNIX systems, the compiler displays error messages, along with the erroneous source line, on the standard error device.
  • Page 329: Messages On The Standard Error Device

    Processor Compiler User's Guide the diagnostic level to . Warnings do not stop translation and linking, nor do they interfere with any output files. Error messages report syntactic or semantic misuse of C. The compiler always displays error messages. Errors do not stop translation but do suppress object code for the module containing the error.
  • Page 330: Messages In The Listing File

    Messages has this form: diagnostic-message ic960 level filename , line lnn , -- message is the type of diagnostic message: level WARNING , or ERROR CATASTROPHIC ERROR INTERNAL ERROR names the source file currently being processed. filename is the line number, if available, where the compilation system detects the condition.
  • Page 331 Processor Compiler User's Guide is the line number, if available, where the compilation system detects the condition. explains the diagnostic. message may be absent for those source-line diagnostic-pointer messages that are not associated with any particular source code line.
  • Page 332 Glossary For processors with on-chip floating-point support, the arithmetic control (AC) register that contains the floating-point exception flags, register floating-point exception masks, and rounding-mode bits. For processors without on-chip floating-point support, the AC register is implemented as a predefined variable fpem_CA_AC An assembly language sequence of code that has one entry basic block...
  • Page 333 Compiler User's Guide A function which cannot be referenced during the profile dead function recompilation step. If a function has been in-lined at all known call sites, or if the function is never referenced, then the function is dead.
  • Page 334 Glossary A function that is called with a branch-and-link instruction leaf function sequence. An identifier that the preprocessor replaces with C source macro text that you specify. The formatted object code resulting from compilation and object module assembly. Interleaving unused bytes between struct/union members padding and at the tail of structs/unions to ensure that struct/union members are properly aligned.
  • Page 335 Compiler User's Guide An optimization that substitutes expensive operations such strength reduction as multiplications with low-cost operations such as addition or subtraction. Strength reduction also eliminates unnecessary induction variables. For example, consider the following C code fragment: int v, a[10], j, t4, t5;...
  • Page 336 Index Architecture (A) gcc960 option, 2-18 ic960 option, 3-19 a (ANSI) ic960 option, 3-21 architecture macros, and compatibility, 8-2 A (Architecture) architecture-specific optimization, 11-1 gcc960 option, 2-18 argument block ic960 option, 3-19 passing parameters in, 7-17 Additional Fine-tune (f) ic960 option, 3-32 registers, 7-17 aggregates argument category, general-register variable,...
  • Page 337 Processor Compiler User's Guide constant expression evaluation (folding), 11-4 constructor expressions, 7-46 C (Comments) gcc960 option, 2-20 conventions, Windows and UNIX, 1-6 c (Create Object) gcc960 option, 2-20 Create Object (c) gcc960 option, 2-20 c (Create-object) ic960 option, 3-25, 3-58...
  • Page 338 Index Definitions (d) gcc960 option, 2-22 F[no-]ai ic960 option, 3-29 Dependencies (Q) ic960 option, 3-55, 3-58 f[no-]asm gcc960 option, 2-25 diagnostic messages, 13-1–13-4 f[no-]bbr Diagnostic-level (w) ic960 option, 3-69 gcc960 option, 2-26 dryrun control (gcdm option), 6-9 ic960 option, 3-33 F[no-]cb ic960 option, 3-29 f[no-]coalesce gcc960 option, 2-26...
  • Page 339 Processor Compiler User's Guide f[no-]float-store f[no-]shadow-globals gcc960 option, 2-27 gcc960 option, 2-30 ic960 option, 3-33 ic960 option, 3-35 f[no-]force-addr f[no-]shadow-mem gcc960 option, 2-27 gcc960 option, 2-30 ic960 option, 3-34 ic960 option, 3-35 f[no-]inline-functions gcc960 option, 2-27 f[no-]signed-char gcc960 option, 2-29...
  • Page 340 Index f[no-]volatile-global fprof (Instrument) gcc960 option, 2-32 gcc960 option, 2-24 ic960 option, 3-36 ic960 option, 3-31 f[no-]writable-strings fsyntax-only gcc960 option, 2-31 gcc960 option, 2-32 function inlining optimization, 11-20 ic960 option, 3-36 functions, reentrant design guidelines, 9-6 fast memory controls (gcdm option), 6-8 Fbout gcc960 option, 2-23 Fcoff G (Big-endian) gcc960 option, 2-33...
  • Page 341 Processor Compiler User's Guide gld files, described, 2-11 Include-dash, Include-dot (I- | I.) gcc960 option, 2-35 global alias analysis optimization, 11-15 induction variable elimination optimization, gmpf960 profile merger, 5-1–5-8 11-14 gmpf960 profile merger invocation command Inhibit Warnings (w) gcc960 option, 2-58...
  • Page 342 Index m[no-]cmpbr gcc960 option, 2-41 m[no-]code-align gcc960 option, 2-41 L (Library Directory) gcc960 option, 2-37 m[no]leaf-procedures gcc960 option, 2-42 l (Library) gcc960 option, 2-38 m[no-]strict-align gcc960 option, 2-43 Library (l) gcc960 option, 2-38 mabi gcc960 option, 2-39 Library Directory (L) gcc960 option, 2-37 Machine-specific (m) options, 2-39 Limit-optimizations (b) ic960 option, 3-23 macro argument substitution in strings, 12-8...
  • Page 343 Processor Compiler User's Guide mpid-safe gcc960 option, 2-43 constant expression evaluation (folding), 11-4 msoft-float gcc960 option, 2-43 constant expressions, 11-3 mstrict-ref-def gcc960 option, 2-44 constant propagation, 11-5 multi-tasking, 9-6 dead code elimination, 11-5 mwait gcc960 option, 2-44 fine-tuning, 3-29...
  • Page 344 Index Output (o) i960_align, 7-31, 8-3 gcc960 option, 2-47 inline, 7-31 ic960 option, 3-53 interrupt, 7-32 output files, 2-9, 3-12 isr, 7-34 optimize, 7-34 pack, 7-35 pure, 7-37 P (Preprocess - file) ic960 option, 3-54, 3-58 section, 7-38 P (Preprocessor Output) gcc960 option, 2-47 system, 7-38 padding, alignment, 7-6 predefined macros, 2-6, 3-6...
  • Page 345 Processor Compiler User's Guide register spilling, 11-17 setbit, 11-20 registers short parameters, 8-1 address base for position independence, sizeof, alignment, 7-4 9-5, 9-6 slash (/) character, 1-6 call-preserved, 7-15 specialized instructions optimization, 11-22 call-scratch, 7-15 Specify PDB (Z) gcc960 option, 2-58...
  • Page 346 Index v960 (Version, exit) gcc960 option, 2-51 T (Target) gcc960 option, 2-49 ic960 option, 3-65 traditional (Traditional) gcc960 option, 2-49 varargs routines, disguised, 12-10 Trigraphs (trigraphs) gcc960 option, 2-50 variable shadowing optimization, 11-16 troubleshooting, 12-10 Version, terminate (v960) ic960 option, 3-65 two-pass optimization, 4-1–4-15 versions, ic960 type promotion, 12-6...
  • Page 347 Processor Compiler User's Guide W[no-]return-type ic960 option, 3-68 Wid-clash-len gcc960 option, 2-54 W[no-]shadow ic960 option, 3-68 Wimplicit gcc960 option, 2-54 W[no-]strict-prototypes ic960 option, 3-68 Windows conventions, 1-6 W[no-]switch ic960 option, 3-68 Wmissing-braces gcc960 option, 2-54 W[no-]traditional ic960 option, 3-68...

Table of Contents