Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
a4da349f
Commit
a4da349f
authored
Sep 20, 1994
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced file, for as1750.
From-SVN: r8108
parent
39ffdc1e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
108 additions
and
94 deletions
+108
-94
gcc/config/1750a/1750a.h
+108
-94
No files found.
gcc/config/1750a/1750a.h
View file @
a4da349f
/* Definitions of target machine for GNU compiler
, MIL-STD-1750A version
.
/* Definitions of target machine for GNU compiler.
Copyright (C) 1994 Free Software Foundation, Inc.
Copyright (C) 1994 Free Software Foundation, Inc.
Contributed by O.M.Kellogg, D
eutsche Aerospace
(okellogg@salyko.cube.net).
Contributed by O.M.Kellogg, D
ASA
(okellogg@salyko.cube.net).
This file is part of GNU CC.
This file is part of GNU CC.
...
@@ -48,7 +48,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
...
@@ -48,7 +48,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* SPECIAL ADDITION FOR MIL-STD-1750A by O.M.Kellogg, 15-Apr-1993 */
/* SPECIAL ADDITION FOR MIL-STD-1750A by O.M.Kellogg, 15-Apr-1993 */
/* See file aux-output.c for the actual data instances. */
/* See file aux-output.c for the actual data instances. */
struct
datalabel_array
{
struct
datalabel_array
{
char
name
[
14
]
;
char
*
name
;
char
value
[
14
];
char
value
[
14
];
int
size
;
int
size
;
};
};
...
@@ -56,7 +56,7 @@ struct jumplabel_array {
...
@@ -56,7 +56,7 @@ struct jumplabel_array {
int
pc
;
int
pc
;
int
num
;
int
num
;
};
};
enum
section
{
NREL
,
IREL
,
KREL
,
SREL
};
enum
section
{
Init
,
Normal
,
Konst
,
Static
};
#define DATALBL_ARRSIZ 256
#define DATALBL_ARRSIZ 256
#define JMPLBL_ARRSIZ 256
#define JMPLBL_ARRSIZ 256
#ifndef __datalbl
#ifndef __datalbl
...
@@ -65,6 +65,7 @@ extern struct jumplabel_array jmplbl[];
...
@@ -65,6 +65,7 @@ extern struct jumplabel_array jmplbl[];
extern
int
datalbl_ndx
,
jmplbl_ndx
,
label_pending
,
program_counter
;
extern
int
datalbl_ndx
,
jmplbl_ndx
,
label_pending
,
program_counter
;
extern
enum
section
current_section
;
extern
enum
section
current_section
;
extern
char
*
sectname
[
4
];
extern
char
*
sectname
[
4
];
extern
char
*
strdup
(),
*
float_label
();
#endif
#endif
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
...
@@ -179,12 +180,11 @@ extern char *sectname[4];
...
@@ -179,12 +180,11 @@ extern char *sectname[4];
/* 1 for registers that have pervasive standard uses
/* 1 for registers that have pervasive standard uses
and are not available for the register allocator.
and are not available for the register allocator.
R15 is the 1750A stack pointer. R14 would be the frame
R15 is the 1750A stack pointer. R14 is the frame pointer. */
pointer, but we'd like to try avoid using it if possible. */
#define FIXED_REGISTERS \
#define FIXED_REGISTERS \
{ 0, 0, 0, 0, 0, 0, 0, 0, \
{ 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0,
0
, 1 }
0, 0, 0, 0, 0, 0,
1
, 1 }
/* 1 for registers not available across function calls.
/* 1 for registers not available across function calls.
These must include the FIXED_REGISTERS and also any
These must include the FIXED_REGISTERS and also any
...
@@ -232,7 +232,7 @@ extern char *sectname[4];
...
@@ -232,7 +232,7 @@ extern char *sectname[4];
Zero means the frame pointer need not be set up (and parms
Zero means the frame pointer need not be set up (and parms
may be accessed via the stack pointer) in functions that seem suitable.
may be accessed via the stack pointer) in functions that seem suitable.
This is computed in `reload', in reload1.c. */
This is computed in `reload', in reload1.c. */
#define FRAME_POINTER_REQUIRED
0
#define FRAME_POINTER_REQUIRED
1
/* Base register for access to arguments of the function. */
/* Base register for access to arguments of the function. */
#define ARG_POINTER_REGNUM 14
#define ARG_POINTER_REGNUM 14
...
@@ -348,11 +348,8 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -348,11 +348,8 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
(C) == 'O' ? (VALUE) == 0 : 0)
(C) == 'O' ? (VALUE) == 0 : 0)
/* Similar, but for floating constants, and defining letter 'G'.
/* Similar, but for floating constants, and defining letter 'G'.
Here VALUE is the CONST_DOUBLE rtx itself.
Here VALUE is the CONST_DOUBLE rtx itself. */
1750 longfloat constant 0.0 is worth recognizing 'cause it's got
#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
all bits zero. */
#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
((C) == 'G' && (VALUE) == CONST0_RTX(HFmode))
/* Given an rtx X being reloaded into a reg required to be
/* Given an rtx X being reloaded into a reg required to be
in class CLASS, return the class of reg to actually use.
in class CLASS, return the class of reg to actually use.
...
@@ -452,7 +449,7 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -452,7 +449,7 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
/* 1 if the tree TYPE should be returned in memory instead of in regs.
/* 1 if the tree TYPE should be returned in memory instead of in regs.
#define RETURN_IN_MEMORY(TYPE) \
#define RETURN_IN_MEMORY(TYPE) \
(int_size_in_bytes(TYPE) > 1
3
)
(int_size_in_bytes(TYPE) > 1
2
)
*/
*/
/* Define this if PCC uses the nonreentrant convention for returning
/* Define this if PCC uses the nonreentrant convention for returning
...
@@ -471,7 +468,7 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -471,7 +468,7 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
and about the args processed so far, enough to enable macros
and about the args processed so far, enough to enable macros
such as FUNCTION_ARG to determine where the next arg should go.
such as FUNCTION_ARG to determine where the next arg should go.
For 1750A, this is a single integer, which is a number of
byte
s
For 1750A, this is a single integer, which is a number of
word
s
of arguments scanned so far. */
of arguments scanned so far. */
#define CUMULATIVE_ARGS int
#define CUMULATIVE_ARGS int
...
@@ -548,10 +545,10 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -548,10 +545,10 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
fprintf(FILE," (none)"); \
fprintf(FILE," (none)"); \
fprintf(FILE,"\n"); \
fprintf(FILE,"\n"); \
if (SIZE > 0) \
if (SIZE > 0) \
fprintf(FILE,"\t%s
R
15,%d ; reserve local-variable space\n",\
fprintf(FILE,"\t%s
\tr
15,%d ; reserve local-variable space\n",\
(SIZE <= 16 ? "
SISP" : "SIM
"),SIZE); \
(SIZE <= 16 ? "
sisp" : "sim
"),SIZE); \
fprintf(FILE,"\t
PSHM R14,R
14 ; push old frame\n"); \
fprintf(FILE,"\t
pshm\tr14,r
14 ; push old frame\n"); \
fprintf(FILE,"\t
LR R14,R
15 ; set new frame\n"); \
fprintf(FILE,"\t
lr\tr14,r
15 ; set new frame\n"); \
program_counter = 0; jmplbl_ndx = -1; \
program_counter = 0; jmplbl_ndx = -1; \
}
}
...
@@ -591,10 +588,11 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -591,10 +588,11 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
#define FUNCTION_EPILOGUE(FILE, SIZE) { \
#define FUNCTION_EPILOGUE(FILE, SIZE) { \
if (SIZE > 0) \
if (SIZE > 0) \
fprintf(FILE,"\t%s R14,%d ; free up local-var space\n", \
fprintf(FILE,"\t%s\tr14,%d ; free up local-var space\n", \
(SIZE <= 16 ? "AISP" : "AIM "),SIZE); \
(SIZE <= 16 ? "aisp" : "aim"),SIZE); \
fprintf(FILE,"\tLR R15,R14 ; set stack to return addr\n");\
fprintf(FILE,"\tlr\tr15,r14 ; set stack to return addr\n"); \
fprintf(FILE,"\tURS R15\n"); }
fprintf(FILE,"\tpopm\tr14,r14 ; restore prev. frame ptr\n"); \
fprintf(FILE,"\turs\tr15\n"); }
/* If the memory address ADDR is relative to the frame pointer,
/* If the memory address ADDR is relative to the frame pointer,
correct it to be relative to the stack pointer instead.
correct it to be relative to the stack pointer instead.
...
@@ -602,7 +600,7 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -602,7 +600,7 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
ADDR should be a variable name. */
ADDR should be a variable name. */
#define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH) \
#define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH) \
fprintf(
asm_out_file
,"FIX_FRAME_POINTER_ADDRESS called, DEPTH=%d\n"), \
fprintf(
stderr
,"FIX_FRAME_POINTER_ADDRESS called, DEPTH=%d\n"), \
DEPTH), abort()
DEPTH), abort()
/* Store in the variable DEPTH the initial difference between the
/* Store in the variable DEPTH the initial difference between the
...
@@ -795,7 +793,7 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -795,7 +793,7 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
/* Max number of bytes we can move from memory to memory
/* Max number of bytes we can move from memory to memory
in one reasonably fast instruction. */
in one reasonably fast instruction. */
/* (was: "1750: not counting the MOV instruction") */
/* (was: "1750: not counting the MOV instruction") */
#define MOVE_MAX
25
6
#define MOVE_MAX
1
6
/* Define this if zero-extension is slow (more than one real instruction). */
/* Define this if zero-extension is slow (more than one real instruction). */
/* #define SLOW_ZERO_EXTEND */
/* #define SLOW_ZERO_EXTEND */
...
@@ -883,49 +881,51 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -883,49 +881,51 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
strcpy(name,p); \
strcpy(name,p); \
if (p = (char *)strchr(name,'.')) \
if (p = (char *)strchr(name,'.')) \
*p = '\0'; \
*p = '\0'; \
if (strlen(name) > 12) \
fprintf(FILE,"\tname %s\n",name); \
name[12] = '\0';
/* TekAs can handle only up to 12 char. */
\
fprintf(FILE,"\tnolist\n\tinclude \"ms1750.inc\"\n\tlist\n\n"); \
fprintf(FILE,"\tNAME %s\n",name); \
fprintf(FILE,"\tglobal\t__main\n\n"); }
fprintf(FILE,"\tNOLIST\n\tINCLUDE \"M1750.INC\"\n\tLIST\n"); \
fprintf(FILE,"\n\tSECTION SREL\n\tSECTION KREL\n\tSECTION IREL\n"); \
fprintf(FILE,"\tSECTION NREL\n"); }
/* Output at end of assembler file.
/* Output at end of assembler file.
For 1750, we copy the data labels accrued in datalbl[] from the Constants
For 1750, we copy the data labels accrued in datalbl[] from the Constants
section (K
REL) to the Writable-Data section (SREL
). */
section (K
onst) to the Writable-Data section (Static
). */
#define ASM_FILE_END(FILE) \
#define ASM_FILE_END(FILE) \
do { \
do { \
if (datalbl_ndx >= 0) { \
if (datalbl_ndx >= 0) { \
int i, cum_size=0; \
int i, cum_size=0; \
fprintf(FILE,"\n\t
RESUME SREL\nINIT_SREL
\n"); \
fprintf(FILE,"\n\t
static\ninit_srel
\n"); \
for (i = 0; i <= datalbl_ndx; i++) { \
for (i = 0; i <= datalbl_ndx; i++) { \
fprintf(FILE,"%s\t BLOCK %d\n", \
if (datalbl[i].name == NULL) \
{ \
fprintf(stderr, "asm_file_end internal datalbl err\n"); \
exit (0); \
} \
fprintf(FILE,"%s \tblock %d\n", \
datalbl[i].name,datalbl[i].size); \
datalbl[i].name,datalbl[i].size); \
cum_size += datalbl[i].size; \
cum_size += datalbl[i].size; \
} \
} \
fprintf(FILE,"\n\t
RESUME IREL\n");
\
fprintf(FILE,"\n\t
init\n");
\
fprintf(FILE,"\t
LIM R0,INIT_SREL
\n");
/* destin. */
\
fprintf(FILE,"\t
lim\tr0,init_srel
\n");
/* destin. */
\
fprintf(FILE,"\t
LIM R
1,%d\n",cum_size);
/* count */
\
fprintf(FILE,"\t
lim\tr
1,%d\n",cum_size);
/* count */
\
fprintf(FILE,"\t
LIM R
2,K%s\n",datalbl[0].name);
/* source */
\
fprintf(FILE,"\t
lim\tr
2,K%s\n",datalbl[0].name);
/* source */
\
fprintf(FILE,"\t
MOV R0,R
2\n"); \
fprintf(FILE,"\t
mov\tr0,r
2\n"); \
fprintf(FILE,"\n\t
RESUME NREL\n");
\
fprintf(FILE,"\n\t
normal\n");
\
datalbl_ndx = -1;
/* reset stuff */
\
datalbl_ndx = -1;
/* reset stuff */
\
for (i = 0; i < DATALBL_ARRSIZ; i++) \
for (i = 0; i < DATALBL_ARRSIZ; i++) \
datalbl[i].size = 0; \
datalbl[i].size = 0; \
} \
} \
fprintf(FILE,"\n\t
END
\n"); \
fprintf(FILE,"\n\t
end
\n"); \
} while (0)
} while (0)
/* Output to assembler file text saying following lines
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
may contain character constants, extra white space, comments, etc. */
#define ASM_APP_ON "\n\t
IF
0\n; by ASM_APP_ON\n"
#define ASM_APP_ON "\n\t
if
0\n; by ASM_APP_ON\n"
/* Output to assembler file text saying following lines
/* Output to assembler file text saying following lines
no longer contain unusual constructs. */
no longer contain unusual constructs. */
#define ASM_APP_OFF "\n\t
ENDIF
\n"
#define ASM_APP_OFF "\n\t
endif
\n"
#define EXTRA_SECTIONS in_readonly_data
#define EXTRA_SECTIONS in_readonly_data
...
@@ -933,23 +933,24 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -933,23 +933,24 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
#define EXTRA_SECTION_FUNCTIONS \
#define EXTRA_SECTION_FUNCTIONS \
void const_section() \
void const_section() \
{ \
{ \
fprintf(asm_out_file,"\t
RESUME KREL\n");
\
fprintf(asm_out_file,"\t
konst\n");
\
current_section = K
REL
; \
current_section = K
onst
; \
} \
} \
check_section(enum section sect) \
check_section(enum section sect) \
{ \
{ \
if (current_section != sect) { \
if (current_section != sect) { \
fprintf(asm_out_file,"\t
RESUME
%s\n",sectname[(int)sect]); \
fprintf(asm_out_file,"\t%s\n",sectname[(int)sect]); \
current_section = sect; \
current_section = sect; \
} \
} \
switch (sect) { \
switch (sect) { \
case NREL: \
case Init: \
case Normal: \
in_section = in_text; \
in_section = in_text; \
break; \
break; \
case S
REL
: \
case S
tatic
: \
in_section = in_data; \
in_section = in_data; \
break; \
break; \
case K
REL
: \
case K
onst
: \
in_section = in_readonly_data; \
in_section = in_readonly_data; \
break; \
break; \
} \
} \
...
@@ -959,11 +960,14 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -959,11 +960,14 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
/* Function that switches to the read-only data section (optional) */
/* Function that switches to the read-only data section (optional) */
#define READONLY_DATA_SECTION const_section
#define READONLY_DATA_SECTION const_section
/* Output before program init section */
#define INIT_SECTION_ASM_OP "\n\tinit ; init_section\n"
/* Output before program text section */
/* Output before program text section */
#define TEXT_SECTION_ASM_OP "\n\t
RESUME NREL
; text_section\n"
#define TEXT_SECTION_ASM_OP "\n\t
normal
; text_section\n"
/* Output before writable data. */
/* Output before writable data. */
#define DATA_SECTION_ASM_OP "\n\t
RESUME SREL
; data_section\n"
#define DATA_SECTION_ASM_OP "\n\t
static
; data_section\n"
/* How to refer to registers in assembler output.
/* How to refer to registers in assembler output.
This sequence is indexed by compiler's hard-register-number (see above). */
This sequence is indexed by compiler's hard-register-number (see above). */
...
@@ -978,7 +982,7 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -978,7 +982,7 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
/****************** Assembler output formatting **********************/
/****************** Assembler output formatting **********************/
#define ASM_IDENTIFY_GCC(FILE)
#define ASM_IDENTIFY_GCC(FILE)
fputs ("; gcc2_compiled:\n", FILE)
#define ASM_COMMENT_START ";"
#define ASM_COMMENT_START ";"
...
@@ -986,6 +990,13 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -986,6 +990,13 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
fprintf(FILE,"%s\n",NAME)
fprintf(FILE,"%s\n",NAME)
#define ASM_OUTPUT_OPCODE(FILE,PTR) do { \
#define ASM_OUTPUT_OPCODE(FILE,PTR) do { \
while (*(PTR) != '\0' && *(PTR) != ' ') { \
putc (*(PTR), FILE); \
(PTR)++; \
} \
while (*(PTR) == ' ') \
(PTR)++; \
putc ('\t', FILE); \
program_counter += 2; \
program_counter += 2; \
} while (0)
} while (0)
...
@@ -996,21 +1007,22 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -996,21 +1007,22 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
such as the label on a static function or variable NAME. */
such as the label on a static function or variable NAME. */
/* 1750 note: Labels are prefixed with a 'K'. This is because handling
/* 1750 note: Labels are prefixed with a 'K'. This is because handling
has been changed for labels to be output in the "Constants" section
has been changed for labels to be output in the "Constants" section
(named "K
REL
"), and special initialization code takes care of copying
(named "K
onst
"), and special initialization code takes care of copying
the Const-section data into the writable data section (named "S
REL
").
the Const-section data into the writable data section (named "S
tatic
").
In the S
REL
section we therefore have the true label names (i.e.
In the S
tatic
section we therefore have the true label names (i.e.
not prefixed with 'K'). */
not prefixed with 'K'). */
#define ASM_OUTPUT_LABEL(FILE,NAME) \
#define ASM_OUTPUT_LABEL(FILE,NAME) \
do { if (NAME[0] == '.') \
do { if (NAME[0] == '.') { \
fprintf(FILE,"%s\n",NAME); \
fprintf(stderr,"Oops! label %s can't begin with '.'\n",NAME); \
else { \
abort(); \
if (strlen(NAME) > 11) NAME[11] = '\0'; \
} \
check_section(KREL); \
else { \
fprintf(FILE,"K%s\n",NAME); \
check_section(Konst); \
strcpy(datalbl[++datalbl_ndx].name,NAME); \
fprintf(FILE,"K%s\n",NAME); \
label_pending = 1; \
datalbl[++datalbl_ndx].name = (char *)strdup (NAME); \
} \
label_pending = 1; \
} \
} while (0)
} while (0)
...
@@ -1018,9 +1030,8 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -1018,9 +1030,8 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
defined for reference from other files. */
defined for reference from other files. */
#define ASM_GLOBALIZE_LABEL(FILE,NAME) do { \
#define ASM_GLOBALIZE_LABEL(FILE,NAME) do { \
check_section(NREL); \
fprintf (FILE, "\tglobal %s\t; export\n", NAME); \
fputs ("\tGLOBAL ", FILE); assemble_name (FILE, NAME); \
} while (0)
fputs (" ; export\n", FILE); } while (0)
/* This is how to output a reference to a user-level label named NAME.
/* This is how to output a reference to a user-level label named NAME.
`assemble_name' uses this. */
`assemble_name' uses this. */
...
@@ -1035,8 +1046,9 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -1035,8 +1046,9 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
do { \
do { \
if (strcmp(PREFIX,"LC") == 0) { \
if (strcmp(PREFIX,"LC") == 0) { \
label_pending = 1; \
label_pending = 1; \
sprintf(datalbl[++datalbl_ndx].name,"LC%d",NUM); \
datalbl[++datalbl_ndx].name = (char *) malloc (9); \
check_section(KREL); \
sprintf(datalbl[datalbl_ndx].name,"LC%d",NUM); \
check_section(Konst); \
fprintf(FILE,"K%s%d\n",PREFIX,NUM); \
fprintf(FILE,"K%s%d\n",PREFIX,NUM); \
} \
} \
else if (find_jmplbl(NUM) < 0) { \
else if (find_jmplbl(NUM) < 0) { \
...
@@ -1058,17 +1070,15 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -1058,17 +1070,15 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
/* This is how to output an assembler line defining a 1750A `float'
/* This is how to output an assembler line defining a 1750A `float'
constant. */
constant. */
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
#define ASM_OUTPUT_
SHORT_
FLOAT(FILE,VALUE) \
do { \
do { \
char *tekfltstr = (char *)tekasm_float('E',VALUE); \
if (label_pending) \
if (label_pending) \
label_pending = 0; \
label_pending = 0; \
else \
else \
strcpy(datalbl[++datalbl_ndx].name, \
datalbl[++datalbl_ndx].name = float_label('D',VALUE); \
(char *)float_label('E',tekfltstr)); \
sprintf (datalbl[datalbl_ndx].value, "%lf", (double) VALUE); \
strcpy(datalbl[datalbl_ndx].value,tekfltstr); \
datalbl[datalbl_ndx].size = 2; \
datalbl[datalbl_ndx].size = 2; \
fprintf (FILE, "\t
DATAF %s\n",tekfltstr
); \
fprintf (FILE, "\t
dataf\t%lf\n",VALUE
); \
} while(0)
} while(0)
/* This is how to output an assembler line defining a 1750A `double'
/* This is how to output an assembler line defining a 1750A `double'
...
@@ -1076,15 +1086,13 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -1076,15 +1086,13 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
#define ASM_OUTPUT_THREE_QUARTER_FLOAT(FILE,VALUE) \
#define ASM_OUTPUT_THREE_QUARTER_FLOAT(FILE,VALUE) \
do { \
do { \
char *tekfltstr = (char *)tekasm_float('D',VALUE); \
if (label_pending) \
if (label_pending) \
label_pending = 0; \
label_pending = 0; \
else \
else \
strcpy(datalbl[++datalbl_ndx].name, \
datalbl[++datalbl_ndx].name = float_label('E',VALUE); \
(char *)float_label('D',tekfltstr)); \
sprintf (datalbl[datalbl_ndx].value, "%lf", VALUE); \
strcpy(datalbl[datalbl_ndx].value,tekfltstr); \
datalbl[datalbl_ndx].size = 3; \
datalbl[datalbl_ndx].size = 3; \
fprintf(FILE,"\t
DATAF %s\n",tekfltstr
); \
fprintf(FILE,"\t
dataef\t%lf\n",VALUE
); \
} while (0)
} while (0)
/* This is how to output an assembler line defining a string constant. */
/* This is how to output an assembler line defining a string constant. */
...
@@ -1099,9 +1107,9 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -1099,9 +1107,9 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
} \
} \
for (i = 0; i < LEN; i++) \
for (i = 0; i < LEN; i++) \
if (PTR[i] >= 32 && PTR[i] < 127) \
if (PTR[i] >= 32 && PTR[i] < 127) \
fprintf(FILE,"\t
DATA %d\t; '%c'\n",PTR[i],PTR[i]);
\
fprintf(FILE,"\t
data\t%d\t; '%c'\n",PTR[i],PTR[i]);
\
else \
else \
fprintf(FILE,"\t
DATA
%d\t; (ascii)\n",PTR[i]); \
fprintf(FILE,"\t
data\t
%d\t; (ascii)\n",PTR[i]); \
} while (0)
} while (0)
/* This is how to output an assembler line defining an `int' constant. */
/* This is how to output an assembler line defining an `int' constant. */
...
@@ -1113,7 +1121,7 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -1113,7 +1121,7 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
label_pending = 0; \
label_pending = 0; \
datalbl[datalbl_ndx].size = 1; \
datalbl[datalbl_ndx].size = 1; \
} \
} \
fprintf(FILE, "\t
DATA
"); output_addr_const(FILE,VALUE); \
fprintf(FILE, "\t
data\t
"); output_addr_const(FILE,VALUE); \
fprintf(FILE, "\n"); } while (0)
fprintf(FILE, "\n"); } while (0)
/* This is how to output an assembler line defining a `long int' constant. */
/* This is how to output an assembler line defining a `long int' constant. */
...
@@ -1125,7 +1133,7 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -1125,7 +1133,7 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
label_pending = 0; \
label_pending = 0; \
datalbl[datalbl_ndx].size = 2; \
datalbl[datalbl_ndx].size = 2; \
} \
} \
fprintf(FILE, "\t
DATAL
"); output_addr_const(FILE,VALUE); \
fprintf(FILE, "\t
datal\t
"); output_addr_const(FILE,VALUE); \
fprintf(FILE, "\n"); } while (0)
fprintf(FILE, "\n"); } while (0)
/* Likewise for `short' and `char' constants. */
/* Likewise for `short' and `char' constants. */
...
@@ -1156,12 +1164,12 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -1156,12 +1164,12 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
/* This is how to output an element of a case-vector that is absolute. */
/* This is how to output an element of a case-vector that is absolute. */
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
fprintf (FILE, "\t
DATA
L%d ;addr_vec_elt\n", VALUE)
fprintf (FILE, "\t
data\t
L%d ;addr_vec_elt\n", VALUE)
/* This is how to output an element of a case-vector that is relative. */
/* This is how to output an element of a case-vector that is relative. */
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
fprintf (FILE, "\t
DATA
L%d-L%d ;addr_diff_elt\n", VALUE,REL)
fprintf (FILE, "\t
data\t
L%d-L%d ;addr_diff_elt\n", VALUE,REL)
/* This is how to output an assembler line
/* This is how to output an assembler line
that says to advance the location counter
that says to advance the location counter
...
@@ -1177,21 +1185,19 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -1177,21 +1185,19 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
to define a global common symbol. */
to define a global common symbol. */
#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) do { \
#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) do { \
check_section(NREL); \
fprintf (FILE, "\tcommon %s,%d\n", NAME, SIZE); \
fprintf(FILE,"\tGLOBAL "); assemble_name(FILE,NAME); \
} while (0)
fprintf(FILE," ; common\n"); } while (0)
#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) do { \
#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) do { \
check_section(NREL); \
fprintf (FILE, "\tglobal %s\t; import\n", NAME); \
fprintf(FILE,"\tGLOBAL "); assemble_name(FILE,NAME); \
} while (0)
fprintf(FILE,"\t; external\n"); } while (0)
/* This says how to output an assembler line
/* This says how to output an assembler line
to define a local common symbol. */
to define a local common symbol. */
#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) do { \
#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) do { \
check_section
(SREL
); \
check_section
(Static
); \
fprintf(FILE,"%s \t
BLOCK %d ; local
\n",NAME,SIZE); \
fprintf(FILE,"%s \t
block %d\t; local common
\n",NAME,SIZE); \
} while (0)
} while (0)
/* Store in OUTPUT a string (made with alloca) containing
/* Store in OUTPUT a string (made with alloca) containing
...
@@ -1202,6 +1208,14 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
...
@@ -1202,6 +1208,14 @@ enum reg_class { NO_REGS, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLASSES };
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
#define ASM_OUTPUT_CONSTRUCTOR(FILE, NAME) do { \
fprintf(FILE, "\tinit\n\t"); assemble_name(NAME); \
fprintf(FILE," ;constructor"); } while (0)
#define ASM_OUTPUT_DESTRUCTOR(FILE, NAME) do { \
fprintf(FILE, "\tinit\n\t"); assemble_name(NAME); \
fprintf(FILE," ;destructor"); } while (0)
/* Define the parentheses used to group arithmetic operations
/* Define the parentheses used to group arithmetic operations
in assembler code. */
in assembler code. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment