Commit 4aef57c9 by Paul Koning Committed by Paul Koning

Add -mgnu-asm; change -mdec-asm to generate DEC assembler

        compatible output.

	* common/config/pdp11/pdp11-common.c (pdp11_handle_option): Handle
	-munit-asm, -mgnu-asm, -mdec-asm.
	* config/pdp11/pdp11-protos.h (pdp11_gen_int_label): New.
	(pdp11_output_labelref): New.
	(pdp11_output_def): New.
	(pdp11_output_addr_vec_elt): New.
	* config/pdp11/pdp11.c: Use tab between opcode and operands.  Use
	%# and %@ format codes.
	(pdp11_option_override): New.
	(TARGET_ASM_FILE_START_FILE_DIRECTIVE): Define.
	(pdp11_output_ident): New.
	(pdp11_asm_named_section): New.
	(pdp11_asm_init_sections): New.
	(pdp11_file_start): New.
	(pdp11_file_end): New.
	(output_ascii): Use .ascii/.asciz for -mdec-asm.
	(pdp11_asm_print_operand): Update %# and %$ for -mdec-asm.  Add
	%o, like %c but octal.
	(pdp11_option_override): New.
	* config/pdp11/pdp11.h (TEXT_SECTION_ASM_OP): Update for
	-mdec-asm.
	(DATA_SECTION_ASM_OP): Ditto.
	(READONLY_DATA_SECTION_ASM_OP): New.
	(IS_ASM_LOGICAL_LINE_SEPARATOR): New.
	(ASM_GENERATE_INTERNAL_LABEL): Use new function.
	(ASM_OUTPUT_LABELREF): Ditto.
	(ASM_OUTPUT_DEF): Ditto.
	(ASM_OUTPUT_EXTERNAL): New.
	(ASM_OUTPUT_SOURCE_FILENAME): New.
	(ASM_OUTPUT_ADDR_VEC_ELT): Use new function.
	(ASM_OUTPUT_SKIP): Update for -mdec-asm.
	* config/pdp11/pdp11.md: Use tab between opcode and operands.  Use
	%# and %@ format codes.
	* config/pdp11/pdp11.opt (mgnu-asm): New.
	(mdec-asm): Conflicts with -mgnu-asm and -munix-asm.
	(munix-asm): Conflicts with -mdec-asm and -mgnu-asm.
	* doc/invoke.txt (PDP-11 Options): Add -mgnu-asm.

From-SVN: r262289
parent 518ab2a0
2018-07-01 Paul Koning <ni1d@arrl.net>
* common/config/pdp11/pdp11-common.c (pdp11_handle_option): Handle
-munit-asm, -mgnu-asm, -mdec-asm.
* config/pdp11/pdp11-protos.h (pdp11_gen_int_label): New.
(pdp11_output_labelref): New.
(pdp11_output_def): New.
(pdp11_output_addr_vec_elt): New.
* config/pdp11/pdp11.c: Use tab between opcode and operands. Use
%# and %@ format codes.
(pdp11_option_override): New.
(TARGET_ASM_FILE_START_FILE_DIRECTIVE): Define.
(pdp11_output_ident): New.
(pdp11_asm_named_section): New.
(pdp11_asm_init_sections): New.
(pdp11_file_start): New.
(pdp11_file_end): New.
(output_ascii): Use .ascii/.asciz for -mdec-asm.
(pdp11_asm_print_operand): Update %# and %$ for -mdec-asm. Add
%o, like %c but octal.
(pdp11_option_override): New.
* config/pdp11/pdp11.h (TEXT_SECTION_ASM_OP): Update for
-mdec-asm.
(DATA_SECTION_ASM_OP): Ditto.
(READONLY_DATA_SECTION_ASM_OP): New.
(IS_ASM_LOGICAL_LINE_SEPARATOR): New.
(ASM_GENERATE_INTERNAL_LABEL): Use new function.
(ASM_OUTPUT_LABELREF): Ditto.
(ASM_OUTPUT_DEF): Ditto.
(ASM_OUTPUT_EXTERNAL): New.
(ASM_OUTPUT_SOURCE_FILENAME): New.
(ASM_OUTPUT_ADDR_VEC_ELT): Use new function.
(ASM_OUTPUT_SKIP): Update for -mdec-asm.
* config/pdp11/pdp11.md: Use tab between opcode and operands. Use
%# and %@ format codes.
* config/pdp11/pdp11.opt (mgnu-asm): New.
(mdec-asm): Conflicts with -mgnu-asm and -munix-asm.
(munix-asm): Conflicts with -mdec-asm and -mgnu-asm.
* doc/invoke.txt (PDP-11 Options): Add -mgnu-asm.
2018-07-01 Aldy Hernandez <aldyh@redhat.com> 2018-07-01 Aldy Hernandez <aldyh@redhat.com>
* tree-ssa-threadupdate.c (mark_threaded_blocks): Avoid * tree-ssa-threadupdate.c (mark_threaded_blocks): Avoid
......
...@@ -59,7 +59,16 @@ pdp11_handle_option (struct gcc_options *opts, ...@@ -59,7 +59,16 @@ pdp11_handle_option (struct gcc_options *opts,
opts->x_target_flags &= ~MASK_40; opts->x_target_flags &= ~MASK_40;
opts->x_target_flags |= MASK_45; opts->x_target_flags |= MASK_45;
return true; return true;
case OPT_munix_asm:
case OPT_mgnu_asm:
targetm_common.have_named_sections = false;
return true;
case OPT_mdec_asm:
targetm_common.have_named_sections = true;
return true;
default: default:
return true; return true;
} }
......
...@@ -51,3 +51,7 @@ extern void pdp11_asm_output_var (FILE *, const char *, int, int, bool); ...@@ -51,3 +51,7 @@ extern void pdp11_asm_output_var (FILE *, const char *, int, int, bool);
extern void pdp11_expand_prologue (void); extern void pdp11_expand_prologue (void);
extern void pdp11_expand_epilogue (void); extern void pdp11_expand_epilogue (void);
extern poly_int64 pdp11_push_rounding (poly_int64); extern poly_int64 pdp11_push_rounding (poly_int64);
extern void pdp11_gen_int_label (char *, const char *, int);
extern void pdp11_output_labelref (FILE *, const char *);
extern void pdp11_output_def (FILE *, const char *, const char *);
extern void pdp11_output_addr_vec_elt (FILE *, int);
...@@ -45,6 +45,10 @@ along with GCC; see the file COPYING3. If not see ...@@ -45,6 +45,10 @@ along with GCC; see the file COPYING3. If not see
#define TARGET_UNIX_ASM_DEFAULT 0 #define TARGET_UNIX_ASM_DEFAULT 0
/* "Dialect" just distinguishes between standard DEC mnemonics, which
are also used by the GNU assembler, vs. Unix mnemonics and float
register names. So it is tied to the -munit-asm option, and treats
-mgnu-asm and -mdec-asm as equivalent (both are dialect zero). */
#define ASSEMBLER_DIALECT (TARGET_UNIX_ASM ? 1 : 0) #define ASSEMBLER_DIALECT (TARGET_UNIX_ASM ? 1 : 0)
...@@ -489,11 +493,19 @@ extern int may_call_alloca; ...@@ -489,11 +493,19 @@ extern int may_call_alloca;
/* Output before read-only data. */ /* Output before read-only data. */
#define TEXT_SECTION_ASM_OP "\t.text\n" #define TEXT_SECTION_ASM_OP \
((TARGET_DEC_ASM) ? "\t.psect\tcode,i,ro,con" : "\t.text")
/* Output before writable data. */ /* Output before writable data. */
#define DATA_SECTION_ASM_OP "\t.data\n" #define DATA_SECTION_ASM_OP \
((TARGET_DEC_ASM) ? "\t.psect\tdata,d,rw,con" : "\t.data")
/* Output before read-only data. Same as read-write data for non-DEC
assemblers because they don't know about .rodata. */
#define READONLY_DATA_SECTION_ASM_OP \
((TARGET_DEC_ASM) ? "\t.psect\trodata,d,ro,con" : "\t.data")
/* 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). */
...@@ -504,38 +516,59 @@ extern int may_call_alloca; ...@@ -504,38 +516,59 @@ extern int may_call_alloca;
"cc", "fcc" } "cc", "fcc" }
/* Globalizing directive for a label. */ /* Globalizing directive for a label. */
#define GLOBAL_ASM_OP "\t.globl " #define GLOBAL_ASM_OP "\t.globl\t"
/* The prefix to add to user-visible assembler symbols. */ /* The prefix to add to user-visible assembler symbols. For the DEC
assembler case, this is not used. */
#define USER_LABEL_PREFIX "_" #define USER_LABEL_PREFIX "_"
/* Line separators. */
#define IS_ASM_LOGICAL_LINE_SEPARATOR(C, STR) \
((C) == '\n' || (!TARGET_DEC_ASM && (C) == ';'))
/* This is how to store into the string LABEL /* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class. PREFIX is the class of label and NUM is the number within the class.
This is suitable for output with `assemble_name'. */ This is suitable for output with `assemble_name'. */
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
sprintf (LABEL, "*%s_%lu", PREFIX, (unsigned long)(NUM)) pdp11_gen_int_label ((LABEL), (PREFIX), (NUM))
/* Emit a string. */
#define ASM_OUTPUT_ASCII(FILE, P, SIZE) \ #define ASM_OUTPUT_ASCII(FILE, P, SIZE) \
output_ascii (FILE, P, SIZE) output_ascii (FILE, P, SIZE)
/* This is how to output an element of a case-vector that is absolute. */ /* Print a label reference, with _ prefix if not DEC. */
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ #define ASM_OUTPUT_LABELREF(STREAM, NAME) \
fprintf (FILE, "\t%sL_%d\n", TARGET_UNIX_ASM ? "" : ".word ", VALUE) pdp11_output_labelref ((STREAM), (NAME))
/* Equate a symbol to an expression. */
#define ASM_OUTPUT_DEF(STREAM, NAME, VALUE) \
pdp11_output_def (STREAM, NAME, VALUE)
/* This is how to output an element of a case-vector that is relative. /* Mark a reference to an external symbol. Needed for DEC assembler. */
Don't define this if it is not supported. */
/* #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) */ #define ASM_OUTPUT_EXTERNAL(STREAM, DECL, NAME) \
if (TARGET_DEC_ASM) \
fprintf ((STREAM), "\t.globl\t%s\n", (NAME))
#define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) \
if (TARGET_DEC_ASM) \
fprintf ((STREAM), ".title\t%s\n", (NAME))
/* This is how to output an element of a case-vector that is absolute. */
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
pdp11_output_addr_vec_elt (FILE, VALUE)
/* 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
to a multiple of 2**LOG bytes. to a multiple of 2**LOG bytes.
who needs this????
*/ */
#define ASM_OUTPUT_ALIGN(FILE,LOG) \ #define ASM_OUTPUT_ALIGN(FILE,LOG) \
...@@ -551,35 +584,34 @@ extern int may_call_alloca; ...@@ -551,35 +584,34 @@ extern int may_call_alloca;
} }
#define ASM_OUTPUT_SKIP(FILE,SIZE) \ #define ASM_OUTPUT_SKIP(FILE,SIZE) \
fprintf (FILE, "\t.=.+ %#ho\n", (unsigned short)(SIZE)) if (TARGET_DEC_ASM) \
fprintf (FILE, "\t.blkb\t%ho\n", (SIZE) & 0xffff); \
else \
fprintf (FILE, "\t.=.+ %#ho\n", (SIZE) & 0xffff);
/* This says how to output an assembler line /* This says how to output an assembler line
to define a global common symbol. */ to define a global common symbol. */
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
pdp11_asm_output_var (FILE, NAME, SIZE, ALIGN, true) pdp11_asm_output_var (FILE, NAME, SIZE, ALIGN, true)
/* 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_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
pdp11_asm_output_var (FILE, NAME, SIZE, ALIGN, false) pdp11_asm_output_var (FILE, NAME, SIZE, ALIGN, false)
/* Print a memory address as an operand to reference that memory location. */ /* Print a memory address as an operand to reference that memory location. */
#define PRINT_OPERAND_ADDRESS(FILE, ADDR) \ #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
print_operand_address (FILE, ADDR) print_operand_address (FILE, ADDR)
#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \ #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
( \ fprintf (FILE, "\tmov\t%s,-(sp)\n", reg_names[REGNO])
fprintf (FILE, "\tmov %s, -(sp)\n", reg_names[REGNO]) \
)
#define ASM_OUTPUT_REG_POP(FILE,REGNO) \ #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
( \ fprintf (FILE, "\tmov\t(sp)+,%s\n", reg_names[REGNO])
fprintf (FILE, "\tmov (sp)+, %s\n", reg_names[REGNO]) \
)
#define TRAMPOLINE_SIZE 8 #define TRAMPOLINE_SIZE 8
#define TRAMPOLINE_ALIGNMENT 16 #define TRAMPOLINE_ALIGNMENT 16
...@@ -588,6 +620,7 @@ extern int may_call_alloca; ...@@ -588,6 +620,7 @@ extern int may_call_alloca;
#define COMPARE_FLAG_MODE HImode #define COMPARE_FLAG_MODE HImode
/* May be overridden by command option processing. */
#define TARGET_HAVE_NAMED_SECTIONS false #define TARGET_HAVE_NAMED_SECTIONS false
/* pdp11-unknown-aout target has no support of C99 runtime */ /* pdp11-unknown-aout target has no support of C99 runtime */
......
...@@ -35,9 +35,13 @@ Target Report Mask(AC0) ...@@ -35,9 +35,13 @@ Target Report Mask(AC0)
Return floating-point results in ac0 (fr0 in Unix assembler syntax). Return floating-point results in ac0 (fr0 in Unix assembler syntax).
mdec-asm mdec-asm
Target RejectNegative Report InverseMask(UNIX_ASM) Target RejectNegative Report Mask(DEC_ASM) Negative(mgnu-asm)
Use the DEC assembler syntax. Use the DEC assembler syntax.
mgnu-asm
Target RejectNegative Report Mask(GNU_ASM) Negative(munix-asm)
Use the GNU assembler syntax.
mfloat32 mfloat32
Target Report Mask(FLOAT32) Target Report Mask(FLOAT32)
Use 32 bit float. Use 32 bit float.
...@@ -67,5 +71,5 @@ Target Report Mask(SPLIT) ...@@ -67,5 +71,5 @@ Target Report Mask(SPLIT)
Target has split I&D. Target has split I&D.
munix-asm munix-asm
Target RejectNegative Report Mask(UNIX_ASM) Target RejectNegative Report Mask(UNIX_ASM) Negative(mdec-asm)
Use UNIX assembler syntax. Use UNIX assembler syntax.
...@@ -972,7 +972,7 @@ Objective-C and Objective-C++ Dialects}. ...@@ -972,7 +972,7 @@ Objective-C and Objective-C++ Dialects}.
@gccoptlist{-mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45 -m10 @gol @gccoptlist{-mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45 -m10 @gol
-mint32 -mno-int16 -mint16 -mno-int32 @gol -mint32 -mno-int16 -mint16 -mno-int32 @gol
-mfloat32 -mno-float64 -mfloat64 -mno-float32 @gol -mfloat32 -mno-float64 -mfloat64 -mno-float32 @gol
-msplit -munix-asm -mdec-asm} -msplit -munix-asm -mdec-asm -mgnu-asm}
@emph{picoChip Options} @emph{picoChip Options}
@gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
...@@ -22080,7 +22080,11 @@ Use Unix assembler syntax. ...@@ -22080,7 +22080,11 @@ Use Unix assembler syntax.
@item -mdec-asm @item -mdec-asm
@opindex mdec-asm @opindex mdec-asm
Use DEC assembler syntax. This is the default. Use DEC assembler syntax.
@item -mgnu-asm
@opindex mgnu-asm
Use GNU assembler syntax. This is the default.
@end table @end table
@node picoChip Options @node picoChip Options
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment