aboutsummaryrefslogtreecommitdiff
path: root/gas/doc
diff options
context:
space:
mode:
authorAndrew Jenner <andrew@codesourcery.com>2018-07-30 12:24:14 +0100
committerNick Clifton <nickc@redhat.com>2018-07-30 12:24:14 +0100
commitb8891f8d622a31306062065813fc278d8a94fe21 (patch)
tree4476440b69e1ce90b7e2b5a90d08f42563b43a7a /gas/doc
parent7d8a31665739412395f6dd370d2279acd322e78e (diff)
downloadbinutils-b8891f8d622a31306062065813fc278d8a94fe21.zip
binutils-b8891f8d622a31306062065813fc278d8a94fe21.tar.gz
binutils-b8891f8d622a31306062065813fc278d8a94fe21.tar.bz2
Add support for the C_SKY series of processors.
This patch series is a new binutils port for C-SKY processors, including support for both the V1 and V2 processor variants. V1 is derived from the MCore architecture while V2 is substantially different, with mixed 16- and 32-bit instructions, a larger register set, a different (but overlapping) ABI, etc. There is support for bare-metal ELF targets and Linux with both glibc and uClibc. This code is being contributed jointly by C-SKY Microsystems and Mentor Graphics. C-SKY is responsible for the technical content and has proposed Lifang Xia and Yunhai Shang as port maintainers. (Note that C-SKY does have a corporate copyright assignment on file with the FSF.) Mentor Graphics' role has been cleaning up the code, adding documentation and additional test cases, etc, to address issues we anticipated reviewers would complain about. bfd * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES): Add C-SKY. (BFD32_BACKENDS, BFD_BACKENDS_CFILES): Likewise. * Makefile.in: Regenerated. * archures.c (enum bfd_architecture): Add bfd_arch_csky and related bfd_mach defines. (bfd_csky_arch): Declare. (bfd_archures_list): Add C-SKY. * bfd-in.h (elf32_csky_build_stubs): Declare. (elf32_csky_size_stubs): Declare. (elf32_csky_next_input_section: Declare. (elf32_csky_setup_section_lists): Declare. * bfd-in2.h: Regenerated. * config.bfd: Add C-SKY. * configure.ac: Likewise. * configure: Regenerated. * cpu-csky.c: New file. * elf-bfd.h (enum elf_target_id): Add C-SKY. * elf32-csky.c: New file. * libbfd.h: Regenerated. * reloc.c: Add C-SKY relocations. * targets.c (csky_elf32_be_vec, csky_elf32_le_vec): Declare. (_bfd_target_vector): Add C-SKY target vector entries. binutils* readelf.c: Include elf/csky.h. (guess_is_rela): Handle EM_CSKY. (dump_relocations): Likewise. (get_machine_name): Likewise. (is_32bit_abs_reloc): Likewise. include * dis-asm.h (csky_symbol_is_valid): Declare. * opcode/csky.h: New file. opcodes * Makefile.am (TARGET_LIBOPCODES_CFILES): Add csky-dis.c. * Makefile.in: Regenerated. * configure.ac: Add C-SKY. * configure: Regenerated. * csky-dis.c: New file. * csky-opc.h: New file. * disassemble.c (ARCH_csky): Define. (disassembler, disassemble_init_for_target): Add case for ARCH_csky. * disassemble.h (print_insn_csky, csky_get_disassembler): Declare. gas * Makefile.am (TARGET_CPU_CFILES): Add entry for C-SKY. (TARGET_CPU_HFILES, TARGET_ENV_HFILES): Likewise. * Makefile.in: Regenerated. * config/tc-csky.c: New file. * config/tc-csky.h: New file. * config/te-csky_abiv1.h: New file. * config/te-csky_abiv1_linux.h: New file. * config/te-csky_abiv2.h: New file. * config/te-csky_abiv2_linux.h: New file. * configure.tgt: Add C-SKY. * doc/Makefile.am (CPU_DOCS): Add entry for C-SKY. * doc/Makefile.in: Regenerated. * doc/all.texi: Set CSKY feature. * doc/as.texi (Overview): Add C-SKY options. (Machine Dependencies): Likewise. * doc/c-csky.texi: New file. * testsuite/gas/csky/*: New test cases. ld * Makefile.am (ALL_EMULATION_SOURCES): Add C-SKY emulations. (ecskyelf.c, ecskyelf_linux.c): New rules. * Makefile.in: Regenerated. * configure.tgt: Add C-SKY. * emulparams/cskyelf.sh: New file. * emulparams/cskyelf_linux.sh: New file. * emultempl/cskyelf.em: New file. * gen-doc.texi: Add C-SKY. * ld.texi: Likewise. (Options specific to C-SKY targets): New section. * testsuite/ld-csky/*: New tests.
Diffstat (limited to 'gas/doc')
-rw-r--r--gas/doc/Makefile.am1
-rw-r--r--gas/doc/Makefile.in1
-rw-r--r--gas/doc/all.texi1
-rw-r--r--gas/doc/as.texi46
-rw-r--r--gas/doc/c-csky.texi195
5 files changed, 244 insertions, 0 deletions
diff --git a/gas/doc/Makefile.am b/gas/doc/Makefile.am
index b3d4fa7..210f2e4 100644
--- a/gas/doc/Makefile.am
+++ b/gas/doc/Makefile.am
@@ -54,6 +54,7 @@ CPU_DOCS = \
c-bfin.texi \
c-cr16.texi \
c-cris.texi \
+ c-csky.texi \
c-d10v.texi \
c-epiphany.texi \
c-h8300.texi \
diff --git a/gas/doc/Makefile.in b/gas/doc/Makefile.in
index b745b7e..765e6b0 100644
--- a/gas/doc/Makefile.in
+++ b/gas/doc/Makefile.in
@@ -409,6 +409,7 @@ CPU_DOCS = \
c-bfin.texi \
c-cr16.texi \
c-cris.texi \
+ c-csky.texi \
c-d10v.texi \
c-epiphany.texi \
c-h8300.texi \
diff --git a/gas/doc/all.texi b/gas/doc/all.texi
index 2b8af69..ef103de 100644
--- a/gas/doc/all.texi
+++ b/gas/doc/all.texi
@@ -32,6 +32,7 @@
@set Blackfin
@set CR16
@set CRIS
+@set CSKY
@set D10V
@set D30V
@set EPIPHANY
diff --git a/gas/doc/as.texi b/gas/doc/as.texi
index aea5e71..be84bf2 100644
--- a/gas/doc/as.texi
+++ b/gas/doc/as.texi
@@ -306,6 +306,26 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}.
@c Deprecated -- deliberately not documented.
@c [@b{-h}] [@b{-H}]
@end ifset
+@ifset CSKY
+
+@emph{Target C-SKY options:}
+ [@b{-march=@var{arch}}] [@b{-mcpu=@var{cpu}}]
+ [@b{-EL}] [@b{-mlittle-endian}] [@b{-EB}] [@b{-mbig-endian}]
+ [@b{-fpic}] [@b{-pic}]
+ [@b{-mljump}] [@b{-mno-ljump}]
+ [@b{-force2bsr}] [@b{-mforce2bsr}] [@b{-no-force2bsr}] [@b{-mno-force2bsr}]
+ [@b{-jsri2bsr}] [@b{-mjsri2bsr}] [@b{-no-jsri2bsr }] [@b{-mno-jsri2bsr}]
+ [@b{-mnolrw }] [@b{-mno-lrw}]
+ [@b{-melrw}] [@b{-mno-elrw}]
+ [@b{-mlaf }] [@b{-mliterals-after-func}]
+ [@b{-mno-laf}] [@b{-mno-literals-after-func}]
+ [@b{-mlabr}] [@b{-mliterals-after-br}]
+ [@b{-mno-labr}] [@b{-mnoliterals-after-br}]
+ [@b{-mistack}] [@b{-mno-istack}]
+ [@b{-mhard-float}] [@b{-mmp}] [@b{-mcp}] [@b{-mcache}]
+ [@b{-msecurity}] [@b{-mtrust}]
+ [@b{-mdsp}] [@b{-medsp}] [@b{-mvdsp}]
+@end ifset
@ifset D10V
@emph{Target D10V options:}
@@ -979,6 +999,25 @@ the Blackfin processor family.
See the info pages for documentation of the CRIS-specific options.
@end ifset
+@ifset CSKY
+
+@ifclear man
+@xref{C-SKY Options}, for the options available when @value{AS} is
+configured for the C-SKY processor family.
+@end ifclear
+
+@ifset man
+@c man begin OPTIONS
+The following options are available when @value{AS} is configured for
+the C-SKY processor family.
+@c man end
+@c man begin INCLUDE
+@include c-csky.texi
+@c ended inside the included file
+@end ifset
+
+@end ifset
+
@ifset D10V
The following options are available when @value{AS} is configured for
a D10V processor.
@@ -7548,6 +7587,9 @@ subject, see the hardware manufacturer's manual.
@ifset CRIS
* CRIS-Dependent:: CRIS Dependent Features
@end ifset
+@ifset CSKY
+* C-SKY-Dependent:: C-SKY Dependent Features
+@end ifset
@ifset D10V
* D10V-Dependent:: D10V Dependent Features
@end ifset
@@ -7731,6 +7773,10 @@ subject, see the hardware manufacturer's manual.
@include c-cris.texi
@end ifset
+@ifset CSKY
+@include c-csky.texi
+@end ifset
+
@ifset Renesas-all
@ifclear GENERIC
@node Machine Dependencies
diff --git a/gas/doc/c-csky.texi b/gas/doc/c-csky.texi
new file mode 100644
index 0000000..5087de9
--- /dev/null
+++ b/gas/doc/c-csky.texi
@@ -0,0 +1,195 @@
+@c Copyright (C) 2012-2018 Free Software Foundation, Inc.
+@c This is part of the GAS manual.
+@c For copying conditions, see the file as.texinfo.
+@c man end
+@ifset GENERIC
+@page
+@node C-SKY-Dependent
+@chapter C-SKY Dependent Features
+@end ifset
+@ifclear GENERIC
+@node Machine Dependencies
+@chapter C-SKY Dependent Features
+@end ifclear
+
+@cindex C-SKY support
+@menu
+* C-SKY Options:: Options
+* C-SKY Syntax:: Syntax
+@end menu
+
+@node C-SKY Options
+@section Options
+@cindex C-SKY options
+@cindex options for C-SKY
+
+@c man begin OPTIONS
+@table @gcctabopt
+
+@cindex @code{march} command-line option, C-SKY
+@item -march=@var{archname}
+Assemble for architecture @var{archname}. The @option{--help} option
+lists valid values for @var{archname}.
+
+@cindex @code{mcpu} command-line option, C-SKY
+@item -mcpu=@var{cpuname}
+Assemble for architecture @var{cpuname}. The @option{--help} option
+lists valid values for @var{cpuname}.
+
+@cindex @code{EL} command-line option, C-SKY
+@cindex @code{mlittle-endian} command-line option, C-SKY
+@item -EL
+@itemx -mlittle-endian
+Generate little-endian output.
+
+@cindex @code{EB} command-line option, C-SKY
+@cindex @code{mbig-endian} command-line option, C-SKY
+@item -EB
+@itemx -mbig-endian
+Generate big-endian output.
+
+@cindex @code{fpic} command-line option, C-SKY
+@cindex @code{pic} command-line option, C-SKY
+@item -fpic
+@itemx -pic
+Generate position-independent code.
+
+@cindex @code{mljump} command-line option, C-SKY
+@cindex @code{mno-ljump} command-line option, C-SKY
+@item -mljump
+@itemx -mno-ljump
+Enable/disable transformation of the short branch instructions
+@code{jbf}, @code{jbt}, and @code{jbr} to @code{jmpi}.
+This option is for V2 processors only.
+It is ignored on CK801 and CK802 targets, which do not support the @code{jmpi}
+instruction, and is enabled by default for other processors.
+
+@cindex @code{mbranch-stub} command-line option, C-SKY
+@cindex @code{mno-branch-stub} command-line option, C-SKY
+@item -mbranch-stub
+@itemx -mno-branch-stub
+Pass through @code{R_CKCORE_PCREL_IMM26BY2} relocations for @code{bsr}
+instructions to the linker.
+
+This option is only available for bare-metal C-SKY V2 ELF targets,
+where it is enabled by default. It cannot be used in code that will be
+dynamically linked against shared libraries.
+
+@cindex @code{force2bsr} command-line option, C-SKY
+@cindex @code{mforce2bsr} command-line option, C-SKY
+@cindex @code{no-force2bsr} command-line option, C-SKY
+@cindex @code{mno-force2bsr} command-line option, C-SKY
+@item -force2bsr
+@itemx -mforce2bsr
+@itemx -no-force2bsr
+@itemx -mno-force2bsr
+Enable/disable transformation of @code{jbsr} instructions to @code{bsr}.
+This option is always enabled (and @option{-mno-force2bsr} is ignored)
+for CK801/CK802 targets. It is also always enabled when
+@option{-mbranch-stub} is in effect.
+
+@cindex @code{jsri2bsr} command-line option, C-SKY
+@cindex @code{mjsri2bsr} command-line option, C-SKY
+@cindex @code{no-jsri2bsr} command-line option, C-SKY
+@cindex @code{mno-jsri2bsr} command-line option, C-SKY
+@item -jsri2bsr
+@itemx -mjsri2bsr
+@itemx -no-jsri2bsr
+@itemx -mno-jsri2bsr
+Enable/disable transformation of @code{jsri} instructions to @code{bsr}.
+This option is enabled by default.
+
+@cindex @code{mnolrw} command-line option, C-SKY
+@cindex @code{mno-lrw} command-line option, C-SKY
+@item -mnolrw
+@itemx -mno-lrw
+Enable/disable transformation of @code{lrw} instructions into a
+@code{movih}/@code{ori} pair.
+
+@cindex @code{melrw} command-line option, C-SKY
+@cindex @code{mno-elrw} command-line option, C-SKY
+@item -melrw
+@itemx -mno-elrw
+Enable/disable extended @code{lrw} instructions.
+This option is enabled by default for CK800-series processors.
+
+@cindex @code{mlaf} command-line option, C-SKY
+@cindex @code{mliterals-after-func} command-line option, C-SKY
+@cindex @code{mno-laf} command-line option, C-SKY
+@cindex @code{mno-literals-after-func} command-line option, C-SKY
+@item -mlaf
+@itemx -mliterals-after-func
+@itemx -mno-laf
+@itemx -mno-literals-after-func
+Enable/disable placement of literal pools after each function.
+
+@cindex @code{mlabr} command-line option, C-SKY
+@cindex @code{mliterals-after-br} command-line option, C-SKY
+@cindex @code{mno-labr} command-line option, C-SKY
+@cindex @code{mnoliterals-after-br} command-line option, C-SKY
+@item -mlabr
+@itemx -mliterals-after-br
+@itemx -mno-labr
+@itemx -mnoliterals-after-br
+Enable/disable placement of literal pools after unconditional branches.
+This option is enabled by default.
+
+@cindex @code{mistack} command-line option, C-SKY
+@cindex @code{mno-istack} command-line option, C-SKY
+@item -mistack
+@itemx -mno-istack
+Enable/disable interrupt stack instructions. This option is enabled by
+default on CK801, CK802, and CK802 processors.
+
+@end table
+
+The following options explicitly enable certain optional instructions.
+These features are also enabled implicitly by using @code{-mcpu=} to specify
+a processor that supports it.
+
+@table @gcctabopt
+@cindex @code{mhard-float} command-line option, C-SKY
+@item -mhard-float
+Enable hard float instructions.
+
+@cindex @code{mmp} command-line option, C-SKY
+@item -mmp
+Enable multiprocessor instructions.
+
+@cindex @code{mcp} command-line option, C-SKY
+@item -mcp
+Enable coprocessor instructions.
+
+@cindex @code{mcache} command-line option, C-SKY
+@item -mcache
+Enable cache prefetch instruction.
+
+@cindex @code{msecurity} command-line option, C-SKY
+@item -msecurity
+Enable C-SKY security instructions.
+
+@cindex @code{mtrust} command-line option, C-SKY
+@item -mtrust
+Enable C-SKY trust instructions.
+
+@cindex @code{mdsp} command-line option, C-SKY
+@item -mdsp
+Enable DSP instructions.
+
+@cindex @code{medsp} command-line option, C-SKY
+@item -medsp
+Enable enhanced DSP instructions.
+
+@cindex @code{mvdsp} command-line option, C-SKY
+@item -mvdsp
+Enable vector DSP instructions.
+
+@end table
+@c man end
+
+@node C-SKY Syntax
+@section Syntax
+
+@code{@value{AS}} implements the standard C-SKY assembler syntax
+documented in the
+@cite{C-SKY V2 CPU Applications Binary Interface Standards Manual}.