OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [gas/] [doc/] [c-sh64.texi] - Diff between revs 156 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 156 Rev 816
@c Copyright (C) 2002, 2003 Free Software Foundation, Inc.
@c Copyright (C) 2002, 2003 Free Software Foundation, Inc.
@c This is part of the GAS manual.
@c This is part of the GAS manual.
@c For copying conditions, see the file as.texinfo.
@c For copying conditions, see the file as.texinfo.
@page
@page
@node SH64-Dependent
@node SH64-Dependent
@chapter SuperH SH64 Dependent Features
@chapter SuperH SH64 Dependent Features
 
 
@cindex SH64 support
@cindex SH64 support
@menu
@menu
* SH64 Options::              Options
* SH64 Options::              Options
* SH64 Syntax::               Syntax
* SH64 Syntax::               Syntax
* SH64 Directives::           SH64 Machine Directives
* SH64 Directives::           SH64 Machine Directives
* SH64 Opcodes::              Opcodes
* SH64 Opcodes::              Opcodes
@end menu
@end menu
 
 
@node SH64 Options
@node SH64 Options
@section Options
@section Options
 
 
@cindex SH64 options
@cindex SH64 options
@cindex options, SH64
@cindex options, SH64
@table @code
@table @code
 
 
@cindex SH64 ISA options
@cindex SH64 ISA options
@cindex ISA options, SH64
@cindex ISA options, SH64
@item -isa=sh4 | sh4a
@item -isa=sh4 | sh4a
Specify the sh4 or sh4a instruction set.
Specify the sh4 or sh4a instruction set.
@item -isa=dsp
@item -isa=dsp
Enable sh-dsp insns, and disable sh3e / sh4 insns.
Enable sh-dsp insns, and disable sh3e / sh4 insns.
@item -isa=fp
@item -isa=fp
Enable sh2e, sh3e, sh4, and sh4a insn sets.
Enable sh2e, sh3e, sh4, and sh4a insn sets.
@item -isa=all
@item -isa=all
Enable sh1, sh2, sh2e, sh3, sh3e, sh4, sh4a, and sh-dsp insn sets.
Enable sh1, sh2, sh2e, sh3, sh3e, sh4, sh4a, and sh-dsp insn sets.
@item -isa=shmedia | -isa=shcompact
@item -isa=shmedia | -isa=shcompact
Specify the default instruction set.  @code{SHmedia} specifies the
Specify the default instruction set.  @code{SHmedia} specifies the
32-bit opcodes, and @code{SHcompact} specifies the 16-bit opcodes
32-bit opcodes, and @code{SHcompact} specifies the 16-bit opcodes
compatible with previous SH families.  The default depends on the ABI
compatible with previous SH families.  The default depends on the ABI
selected; the default for the 64-bit ABI is SHmedia, and the default for
selected; the default for the 64-bit ABI is SHmedia, and the default for
the 32-bit ABI is SHcompact.  If neither the ABI nor the ISA is
the 32-bit ABI is SHcompact.  If neither the ABI nor the ISA is
specified, the default is 32-bit SHcompact.
specified, the default is 32-bit SHcompact.
 
 
Note that the @code{.mode} pseudo-op is not permitted if the ISA is not
Note that the @code{.mode} pseudo-op is not permitted if the ISA is not
specified on the command line.
specified on the command line.
 
 
@cindex SH64 ABI options
@cindex SH64 ABI options
@cindex ABI options, SH64
@cindex ABI options, SH64
@item -abi=32 | -abi=64
@item -abi=32 | -abi=64
Specify the default ABI.  If the ISA is specified and the ABI is not,
Specify the default ABI.  If the ISA is specified and the ABI is not,
the default ABI depends on the ISA, with SHmedia defaulting to 64-bit
the default ABI depends on the ISA, with SHmedia defaulting to 64-bit
and SHcompact defaulting to 32-bit.
and SHcompact defaulting to 32-bit.
 
 
Note that the @code{.abi} pseudo-op is not permitted if the ABI is not
Note that the @code{.abi} pseudo-op is not permitted if the ABI is not
specified on the command line.  When the ABI is specified on the command
specified on the command line.  When the ABI is specified on the command
line, any @code{.abi} pseudo-ops in the source must match it.
line, any @code{.abi} pseudo-ops in the source must match it.
 
 
@item -shcompact-const-crange
@item -shcompact-const-crange
Emit code-range descriptors for constants in SHcompact code sections.
Emit code-range descriptors for constants in SHcompact code sections.
 
 
@item -no-mix
@item -no-mix
Disallow SHmedia code in the same section as constants and SHcompact
Disallow SHmedia code in the same section as constants and SHcompact
code.
code.
 
 
@item -no-expand
@item -no-expand
Do not expand MOVI, PT, PTA or PTB instructions.
Do not expand MOVI, PT, PTA or PTB instructions.
 
 
@item -expand-pt32
@item -expand-pt32
With -abi=64, expand PT, PTA and PTB instructions to 32 bits only.
With -abi=64, expand PT, PTA and PTB instructions to 32 bits only.
 
 
@end table
@end table
 
 
@node SH64 Syntax
@node SH64 Syntax
@section Syntax
@section Syntax
 
 
@menu
@menu
* SH64-Chars::                Special Characters
* SH64-Chars::                Special Characters
* SH64-Regs::                 Register Names
* SH64-Regs::                 Register Names
* SH64-Addressing::           Addressing Modes
* SH64-Addressing::           Addressing Modes
@end menu
@end menu
 
 
@node SH64-Chars
@node SH64-Chars
@subsection Special Characters
@subsection Special Characters
 
 
@cindex line comment character, SH64
@cindex line comment character, SH64
@cindex SH64 line comment character
@cindex SH64 line comment character
@samp{!} is the line comment character.
@samp{!} is the line comment character.
 
 
@cindex line separator, SH64
@cindex line separator, SH64
@cindex statement separator, SH64
@cindex statement separator, SH64
@cindex SH64 line separator
@cindex SH64 line separator
You can use @samp{;} instead of a newline to separate statements.
You can use @samp{;} instead of a newline to separate statements.
 
 
@cindex symbol names, @samp{$} in
@cindex symbol names, @samp{$} in
@cindex @code{$} in symbol names
@cindex @code{$} in symbol names
Since @samp{$} has no special meaning, you may use it in symbol names.
Since @samp{$} has no special meaning, you may use it in symbol names.
 
 
@node SH64-Regs
@node SH64-Regs
@subsection Register Names
@subsection Register Names
 
 
@cindex SH64 registers
@cindex SH64 registers
@cindex registers, SH64
@cindex registers, SH64
You can use the predefined symbols @samp{r0} through @samp{r63} to refer
You can use the predefined symbols @samp{r0} through @samp{r63} to refer
to the SH64 general registers, @samp{cr0} through @code{cr63} for
to the SH64 general registers, @samp{cr0} through @code{cr63} for
control registers, @samp{tr0} through @samp{tr7} for target address
control registers, @samp{tr0} through @samp{tr7} for target address
registers, @samp{fr0} through @samp{fr63} for single-precision floating
registers, @samp{fr0} through @samp{fr63} for single-precision floating
point registers, @samp{dr0} through @samp{dr62} (even numbered registers
point registers, @samp{dr0} through @samp{dr62} (even numbered registers
only) for double-precision floating point registers, @samp{fv0} through
only) for double-precision floating point registers, @samp{fv0} through
@samp{fv60} (multiples of four only) for single-precision floating point
@samp{fv60} (multiples of four only) for single-precision floating point
vectors, @samp{fp0} through @samp{fp62} (even numbered registers only)
vectors, @samp{fp0} through @samp{fp62} (even numbered registers only)
for single-precision floating point pairs, @samp{mtrx0} through
for single-precision floating point pairs, @samp{mtrx0} through
@samp{mtrx48} (multiples of 16 only) for 4x4 matrices of
@samp{mtrx48} (multiples of 16 only) for 4x4 matrices of
single-precision floating point registers, @samp{pc} for the program
single-precision floating point registers, @samp{pc} for the program
counter, and @samp{fpscr} for the floating point status and control
counter, and @samp{fpscr} for the floating point status and control
register.
register.
 
 
You can also refer to the control registers by the mnemonics @samp{sr},
You can also refer to the control registers by the mnemonics @samp{sr},
@samp{ssr}, @samp{pssr}, @samp{intevt}, @samp{expevt}, @samp{pexpevt},
@samp{ssr}, @samp{pssr}, @samp{intevt}, @samp{expevt}, @samp{pexpevt},
@samp{tra}, @samp{spc}, @samp{pspc}, @samp{resvec}, @samp{vbr},
@samp{tra}, @samp{spc}, @samp{pspc}, @samp{resvec}, @samp{vbr},
@samp{tea}, @samp{dcr}, @samp{kcr0}, @samp{kcr1}, @samp{ctc}, and
@samp{tea}, @samp{dcr}, @samp{kcr0}, @samp{kcr1}, @samp{ctc}, and
@samp{usr}.
@samp{usr}.
 
 
@node SH64-Addressing
@node SH64-Addressing
@subsection Addressing Modes
@subsection Addressing Modes
 
 
@cindex addressing modes, SH64
@cindex addressing modes, SH64
@cindex SH64 addressing modes
@cindex SH64 addressing modes
 
 
SH64 operands consist of either a register or immediate value.  The
SH64 operands consist of either a register or immediate value.  The
immediate value can be a constant or label reference (or portion of a
immediate value can be a constant or label reference (or portion of a
label reference), as in this example:
label reference), as in this example:
 
 
@example
@example
        movi    4,r2
        movi    4,r2
        pt      function, tr4
        pt      function, tr4
        movi    (function >> 16) & 65535,r0
        movi    (function >> 16) & 65535,r0
        shori   function & 65535, r0
        shori   function & 65535, r0
        ld.l    r0,4,r0
        ld.l    r0,4,r0
@end example
@end example
 
 
@cindex datalabel, SH64
@cindex datalabel, SH64
Instruction label references can reference labels in either SHmedia or
Instruction label references can reference labels in either SHmedia or
SHcompact.  To differentiate between the two, labels in SHmedia sections
SHcompact.  To differentiate between the two, labels in SHmedia sections
will always have the least significant bit set (i.e. they will be odd),
will always have the least significant bit set (i.e. they will be odd),
which SHcompact labels will have the least significant bit reset
which SHcompact labels will have the least significant bit reset
(i.e. they will be even).  If you need to reference the actual address
(i.e. they will be even).  If you need to reference the actual address
of a label, you can use the @code{datalabel} modifier, as in this
of a label, you can use the @code{datalabel} modifier, as in this
example:
example:
 
 
@example
@example
        .long   function
        .long   function
        .long   datalabel function
        .long   datalabel function
@end example
@end example
 
 
In that example, the first longword may or may not have the least
In that example, the first longword may or may not have the least
significant bit set depending on whether the label is an SHmedia label
significant bit set depending on whether the label is an SHmedia label
or an SHcompact label.  The second longword will be the actual address
or an SHcompact label.  The second longword will be the actual address
of the label, regardless of what type of label it is.
of the label, regardless of what type of label it is.
 
 
@node SH64 Directives
@node SH64 Directives
@section SH64 Machine Directives
@section SH64 Machine Directives
 
 
In addition to the SH directives, the SH64 provides the following
In addition to the SH directives, the SH64 provides the following
directives:
directives:
 
 
@cindex SH64 machine directives
@cindex SH64 machine directives
@cindex machine directives, SH64
@cindex machine directives, SH64
 
 
@table @code
@table @code
 
 
@item .mode [shmedia|shcompact]
@item .mode [shmedia|shcompact]
@itemx .isa [shmedia|shcompact]
@itemx .isa [shmedia|shcompact]
Specify the ISA for the following instructions (the two directives are
Specify the ISA for the following instructions (the two directives are
equivalent).  Note that programs such as @code{objdump} rely on symbolic
equivalent).  Note that programs such as @code{objdump} rely on symbolic
labels to determine when such mode switches occur (by checking the least
labels to determine when such mode switches occur (by checking the least
significant bit of the label's address), so such mode/isa changes should
significant bit of the label's address), so such mode/isa changes should
always be followed by a label (in practice, this is true anyway).  Note
always be followed by a label (in practice, this is true anyway).  Note
that you cannot use these directives if you didn't specify an ISA on the
that you cannot use these directives if you didn't specify an ISA on the
command line.
command line.
 
 
@item .abi [32|64]
@item .abi [32|64]
Specify the ABI for the following instructions.  Note that you cannot use
Specify the ABI for the following instructions.  Note that you cannot use
this directive unless you specified an ABI on the command line, and the
this directive unless you specified an ABI on the command line, and the
ABIs specified must match.
ABIs specified must match.
 
 
@item .uaquad
@item .uaquad
Like .uaword and .ualong, this allows you to specify an intentionally
Like .uaword and .ualong, this allows you to specify an intentionally
unaligned quadword (64 bit word).
unaligned quadword (64 bit word).
 
 
@end table
@end table
 
 
@node SH64 Opcodes
@node SH64 Opcodes
@section Opcodes
@section Opcodes
 
 
@cindex SH64 opcode summary
@cindex SH64 opcode summary
@cindex opcode summary, SH64
@cindex opcode summary, SH64
@cindex mnemonics, SH64
@cindex mnemonics, SH64
@cindex instruction summary, SH64
@cindex instruction summary, SH64
For detailed information on the SH64 machine instruction set, see
For detailed information on the SH64 machine instruction set, see
@cite{SuperH 64 bit RISC Series Architecture Manual} (SuperH, Inc.).
@cite{SuperH 64 bit RISC Series Architecture Manual} (SuperH, Inc.).
 
 
@code{@value{AS}} implements all the standard SH64 opcodes.  In
@code{@value{AS}} implements all the standard SH64 opcodes.  In
addition, the following pseudo-opcodes may be expanded into one or more
addition, the following pseudo-opcodes may be expanded into one or more
alternate opcodes:
alternate opcodes:
 
 
@table @code
@table @code
 
 
@item movi
@item movi
If the value doesn't fit into a standard @code{movi} opcode,
If the value doesn't fit into a standard @code{movi} opcode,
@code{@value{AS}} will replace the @code{movi} with a sequence of
@code{@value{AS}} will replace the @code{movi} with a sequence of
@code{movi} and @code{shori} opcodes.
@code{movi} and @code{shori} opcodes.
 
 
@item pt
@item pt
This expands to a sequence of @code{movi} and @code{shori} opcode,
This expands to a sequence of @code{movi} and @code{shori} opcode,
followed by a @code{ptrel} opcode, or to a @code{pta} or @code{ptb}
followed by a @code{ptrel} opcode, or to a @code{pta} or @code{ptb}
opcode, depending on the label referenced.
opcode, depending on the label referenced.
 
 
@end table
@end table
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.