Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
00001 /* 00002 00003 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify it 00006 under the terms of version 2 of the GNU General Public License as 00007 published by the Free Software Foundation. 00008 00009 This program is distributed in the hope that it would be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 00013 Further, this software is distributed without any warranty that it is 00014 free of the rightful claim of any third person regarding infringement 00015 or the like. Any license provided herein, whether implied or 00016 otherwise, applies only to this software file. Patent licenses, if 00017 any, provided herein do not apply to combinations of this program with 00018 other software, or any other product whatsoever. 00019 00020 You should have received a copy of the GNU General Public License along 00021 with this program; if not, write the Free Software Foundation, Inc., 59 00022 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00023 00024 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00025 Mountain View, CA 94043, or: 00026 00027 http://www.sgi.com 00028 00029 For further information regarding this notice, see: 00030 00031 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00032 00033 */ 00034 00035 00036 #ifndef config_asm_INCLUDED 00037 #define config_asm_INCLUDED 00038 #ifdef __cplusplus 00039 extern "C" { 00040 #endif 00041 00042 /* ==================================================================== 00043 * ==================================================================== 00044 * 00045 * 00046 * Revision history: 00047 * 17-Jun-91 - Original Version 00048 * 26-Sep-91 - Modified AS_CMNT_START, AS_IDENT 00049 * 00050 * Description: 00051 * 00052 * This file contains #defines which configure assembly code emission 00053 * to the current host assembler. The intent is to isolate all 00054 * dependencies on the host's assembly language format and directives 00055 * here. 00056 * 00057 * ==================================================================== 00058 * ==================================================================== 00059 */ 00060 00061 00062 #ifdef _KEEP_RCS_ID 00063 #endif /* _KEEP_RCS_ID */ 00064 00065 #define Label_Name_Separator "_" 00066 00067 /* to distinguish from register names: */ 00068 #define Symbol_Name_Suffix "#" 00069 00070 /* The following sprintf format is used to create a basic block label 00071 * from the BB id and the PU name: 00072 */ 00073 #define BB_Label_Format ".BB%d_%s" 00074 00075 /* The following sprintf format is used to create a basic block label 00076 * from a user label name and the PU name: 00077 */ 00078 #define User_Label_Format ".L_%s_%s" 00079 #define User_Label_Number_Format ".L_%d_%d_%s" 00080 00081 /* The following sprintf format is used to create the magic label for 00082 * the common return point (if Only_1_Exit_Point is TRUE). 00083 */ 00084 #define Ret_Block_Label_Format ".RET_%s" 00085 00086 /* The following sprintf format to ensure correct alignment of 00087 * entry points: 00088 */ 00089 #define Entry_Point_Alignment_Format "\t.align\t4\n" 00090 00091 /* The following sprintf formats define the mapping of objects in 00092 * various storage classes to the assembly code and symbol table 00093 * (naming) conventions of the target: 00094 * Fortran: 00095 * INTEGER X, Y 00096 * COMMON /CBLOCK/ X, Y 00097 * => loadd _cblock$,f0 -- load X 00098 * loadd _cblock$+8,f1 -- load Y 00099 * 00100 * CALL SUB() 00101 * => call sp,_sub_ 00102 * 00103 * The Intrnisic_Proc_Format describes a modification to intrinsic 00104 * procedure names, allowing an easy way of describing intrinsic 00105 * naming conventions. Our convention: Intrinsic functions have 00106 * an underscore, '_', prepended to their names, so this format is 00107 * "_%s". Note that the processing by Intrinsic_Proc_Format is done 00108 * at compiler-build time (by the program "mkintr.x"). 00109 * 00110 * Note also that the Ftn_Extern_Proc_Format is *not* applied to 00111 * intrinsic functions, even though they are external procedures. 00112 * 00113 * There are some language-specific things here. For example, the 00114 * naming convention for Fortran functions is not the same as the 00115 * naming convention for C functions. Consequently, there are two 00116 * formats for external procedure names: 00117 * Ftn_Extern_Proc_Format 00118 * C_Extern_Proc_Format 00119 */ 00120 #define Intrinsic_Proc_Format "%s" /* eg: "_exp" */ 00121 #define Ftn_Extern_Data_Format "%s_" /* eg: "cblock_" */ 00122 #define C_Extern_Data_Format "%s" /* eg: "extrn" */ 00123 #define Ftn_Extern_Proc_Format "%s_" /* eg: "sub_" */ 00124 #define C_Extern_Proc_Format "%s" /* eg: "sub" */ 00125 #define C_Global_Static_Format "GS.%s" /* statics in global scope */ 00126 #define C_Local_Static_Format "LS.%1d.%s"/* statics in local scope */ 00127 #define Deferred_Ref_Format "%s" /* eg: "name" */ 00128 #define Deferred_Ref_Ofst_Format "%s%c%d" /* eg: "name" '-' offset */ 00129 #define Local_Ret_Buf_Format "%s.RBUF" /* eg: "func.RBUF" */ 00130 00131 #define DFLT_FTN_MAIN "MAIN" 00132 #define DFLT_FTN_LOWMAIN "main" 00133 #define BLANK_COM_NAME "_BLNK__" 00134 #define RDATA_RAW_NAME ".rdata" 00135 #define SDATA_RAW_NAME ".sdata" 00136 #define DATA_RAW_NAME ".data" 00137 #define GOT_RAW_NAME ".got" 00138 #define BSS_RAW_NAME ".bss" 00139 #define LIT4_RAW_NAME ".lit4" 00140 #define LIT8_RAW_NAME ".lit8" 00141 #define LIT16_RAW_NAME ".lit16" 00142 00143 #define ASM_CMNT_LINE "//" /* use for whole line comments */ 00144 #define ASM_CMNT "//" /* other than whole line comments */ 00145 00146 #define AS_STOP_BIT ";;" 00147 00148 /* Defines for assembly directives */ 00149 #define AS_ALIGN ".align" 00150 #define AS_BYTE "data1" 00151 #define AS_COM ".common" 00152 #define AS_DATA ".data" 00153 #define AS_DOUBLE ".double" 00154 #define AS_DWORD "data8" 00155 #define AS_DWORD_UNALIGNED "data8.ua" 00156 #define AS_DYNSYM ((char *)0) 00157 #define AS_END ".endp" 00158 #define AS_ENT ".proc" 00159 #define AS_AENT "//.aproc" 00160 #define AS_FLOAT ".float" 00161 #define AS_FILE ".file" 00162 #define AS_FMASK ".fmask" 00163 #define AS_FRAME ".fframe" 00164 #define AS_GLOBAL ".global" 00165 #define AS_GPVALUE ".gpvalue" 00166 #define AS_HALF "data2" 00167 #define AS_HALF_UNALIGNED "data2.ua" 00168 #define AS_BSS ".lcomm" 00169 #define AS_MASK "//.mask" 00170 #define AS_ORIGIN ".org" 00171 #define AS_RDATA ".rdata" 00172 #define AS_SDATA ".sdata" 00173 #define AS_SECTION ".section" 00174 #define AS_SIZE ".size" 00175 #define AS_SPACE ".skip" 00176 #define AS_STRING "string" 00177 #define AS_TEXT ".text" 00178 #define AS_TYPE ".type" 00179 #define AS_TYPE_FUNC "@function" 00180 #define AS_TYPE_OBJECT "@object" 00181 #define AS_WEAK ".weak" 00182 #define AS_WORD "data4" 00183 #define AS_WORD_UNALIGNED "data4.ua" 00184 #define AS_IDENT "#ident" /* Make this ASM_CMNT_START if no ident */ 00185 00186 /* The directive for emitting an address depends on the target pointer 00187 * size. The following is defined and initialized in config_targ.c: 00188 */ 00189 extern char *AS_ADDRESS; 00190 extern char *AS_ADDRESS_UNALIGNED; 00191 00192 /* Defines for emission of special relocations */ 00193 #define AS_GPREL "@gprel" 00194 #define AS_LTOFF "@ltoff" 00195 #define AS_FPTR "@fptr" 00196 #define AS_GP_REL ((char *)0) 00197 #define AS_NEGATE ((char *)0) 00198 00199 /* A printf format for emitting a function of an external name, where 00200 * the function is typically given by one of the above kind symbols: 00201 */ 00202 #define ASM_NAME_FUNC(kind,name) "%s(%s)", kind, name 00203 #define ASM_DIR_NOTRANSFORM() ; /* no equivalent */ 00204 #define ASM_DIR_TRANSFORM() ; /* no equivalent */ 00205 #define ASM_DIR_NOREORDER() ; /* no equivalent */ 00206 #define ASM_DIR_NOAT() ; /* no equivalent */ 00207 #define ASM_DIR_STOINTERNAL(n) ; /* no equivalent */ 00208 #define ASM_DIR_GPVALUE() fprintf(Asm_File, "//\t%s %d\n", \ 00209 AS_GPVALUE, GP_DISP); 00210 #define ASM_DIR_FILE(count, file, name) fprintf (Asm_File, \ 00211 "\t%s\t\"%s/%s\"\n", \ 00212 AS_FILE, \ 00213 incl_table[DST_FILE_NAME_dir(file)], name); 00214 #define ASM_DIR_ALIGN(p, s) fprintf(Asm_File, "\t%s %d\n", AS_ALIGN,STB_align(s)); 00215 00216 /* gas .skip fills with zeroes */ 00217 #define ASM_DIR_ZERO(fl, l) fprintf(fl, "\t%s %d\n", AS_SPACE, l) 00218 #define ASM_DIR_SKIP(fl, l) fprintf(fl, "\t%s %d\n", AS_SPACE, l) 00219 00220 #ifdef __cplusplus 00221 } 00222 #endif 00223 #endif /* config_asm_INCLUDED */