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

Subversion Repositories openrisc

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

Only display areas with differences | Details | Blame | View Log

Rev 156 Rev 816
@c Copyright 1996, 2000, 2002 Free Software Foundation, Inc.
@c Copyright 1996, 2000, 2002 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.
@ifset GENERIC
@ifset GENERIC
@page
@page
@node D10V-Dependent
@node D10V-Dependent
@chapter D10V Dependent Features
@chapter D10V Dependent Features
@end ifset
@end ifset
@ifclear GENERIC
@ifclear GENERIC
@node Machine Dependencies
@node Machine Dependencies
@chapter D10V Dependent Features
@chapter D10V Dependent Features
@end ifclear
@end ifclear
 
 
@cindex D10V support
@cindex D10V support
@menu
@menu
* D10V-Opts::                   D10V Options
* D10V-Opts::                   D10V Options
* D10V-Syntax::                 Syntax
* D10V-Syntax::                 Syntax
* D10V-Float::                  Floating Point
* D10V-Float::                  Floating Point
* D10V-Opcodes::                Opcodes
* D10V-Opcodes::                Opcodes
@end menu
@end menu
 
 
@node D10V-Opts
@node D10V-Opts
@section D10V Options
@section D10V Options
@cindex options, D10V
@cindex options, D10V
@cindex D10V options
@cindex D10V options
The Mitsubishi D10V version of @code{@value{AS}} has a few machine
The Mitsubishi D10V version of @code{@value{AS}} has a few machine
dependent options.
dependent options.
 
 
@table @samp
@table @samp
@item -O
@item -O
The D10V can often execute two sub-instructions in parallel. When this option
The D10V can often execute two sub-instructions in parallel. When this option
is used, @code{@value{AS}} will attempt to optimize its output by detecting when
is used, @code{@value{AS}} will attempt to optimize its output by detecting when
instructions can be executed in parallel.
instructions can be executed in parallel.
@item --nowarnswap
@item --nowarnswap
To optimize execution performance, @code{@value{AS}} will sometimes swap the
To optimize execution performance, @code{@value{AS}} will sometimes swap the
order of instructions. Normally this generates a warning. When this option
order of instructions. Normally this generates a warning. When this option
is used, no warning will be generated when instructions are swapped.
is used, no warning will be generated when instructions are swapped.
@item --gstabs-packing
@item --gstabs-packing
@item --no-gstabs-packing
@item --no-gstabs-packing
@code{@value{AS}} packs adjacent short instructions into a single packed
@code{@value{AS}} packs adjacent short instructions into a single packed
instruction. @samp{--no-gstabs-packing} turns instruction packing off if
instruction. @samp{--no-gstabs-packing} turns instruction packing off if
@samp{--gstabs} is specified as well; @samp{--gstabs-packing} (the
@samp{--gstabs} is specified as well; @samp{--gstabs-packing} (the
default) turns instruction packing on even when @samp{--gstabs} is
default) turns instruction packing on even when @samp{--gstabs} is
specified.
specified.
@end table
@end table
 
 
@node D10V-Syntax
@node D10V-Syntax
@section Syntax
@section Syntax
@cindex D10V syntax
@cindex D10V syntax
@cindex syntax, D10V
@cindex syntax, D10V
 
 
The D10V syntax is based on the syntax in Mitsubishi's D10V architecture manual.
The D10V syntax is based on the syntax in Mitsubishi's D10V architecture manual.
The differences are detailed below.
The differences are detailed below.
 
 
@menu
@menu
* D10V-Size::                 Size Modifiers
* D10V-Size::                 Size Modifiers
* D10V-Subs::                 Sub-Instructions
* D10V-Subs::                 Sub-Instructions
* D10V-Chars::                Special Characters
* D10V-Chars::                Special Characters
* D10V-Regs::                 Register Names
* D10V-Regs::                 Register Names
* D10V-Addressing::           Addressing Modes
* D10V-Addressing::           Addressing Modes
* D10V-Word::                 @@WORD Modifier
* D10V-Word::                 @@WORD Modifier
@end menu
@end menu
 
 
 
 
@node D10V-Size
@node D10V-Size
@subsection Size Modifiers
@subsection Size Modifiers
@cindex D10V size modifiers
@cindex D10V size modifiers
@cindex size modifiers, D10V
@cindex size modifiers, D10V
The D10V version of @code{@value{AS}} uses the instruction names in the D10V
The D10V version of @code{@value{AS}} uses the instruction names in the D10V
Architecture Manual.  However, the names in the manual are sometimes ambiguous.
Architecture Manual.  However, the names in the manual are sometimes ambiguous.
There are instruction names that can assemble to a short or long form opcode.
There are instruction names that can assemble to a short or long form opcode.
How does the assembler pick the correct form?  @code{@value{AS}} will always pick the
How does the assembler pick the correct form?  @code{@value{AS}} will always pick the
smallest form if it can.  When dealing with a symbol that is not defined yet when a
smallest form if it can.  When dealing with a symbol that is not defined yet when a
line is being assembled, it will always use the long form.  If you need to force the
line is being assembled, it will always use the long form.  If you need to force the
assembler to use either the short or long form of the instruction, you can append
assembler to use either the short or long form of the instruction, you can append
either @samp{.s} (short) or @samp{.l} (long) to it.  For example, if you are writing
either @samp{.s} (short) or @samp{.l} (long) to it.  For example, if you are writing
an assembly program and you want to do a branch to a symbol that is defined later
an assembly program and you want to do a branch to a symbol that is defined later
in your program, you can write @samp{bra.s   foo}.
in your program, you can write @samp{bra.s   foo}.
Objdump and GDB will always append @samp{.s} or @samp{.l} to instructions which
Objdump and GDB will always append @samp{.s} or @samp{.l} to instructions which
have both short and long forms.
have both short and long forms.
 
 
@node D10V-Subs
@node D10V-Subs
@subsection Sub-Instructions
@subsection Sub-Instructions
@cindex D10V sub-instructions
@cindex D10V sub-instructions
@cindex sub-instructions, D10V
@cindex sub-instructions, D10V
The D10V assembler takes as input a series of instructions, either one-per-line,
The D10V assembler takes as input a series of instructions, either one-per-line,
or in the special two-per-line format described in the next section.  Some of these
or in the special two-per-line format described in the next section.  Some of these
instructions will be short-form or sub-instructions.  These sub-instructions can be packed
instructions will be short-form or sub-instructions.  These sub-instructions can be packed
into a single instruction.  The assembler will do this automatically.  It will also detect
into a single instruction.  The assembler will do this automatically.  It will also detect
when it should not pack instructions.  For example, when a label is defined, the next
when it should not pack instructions.  For example, when a label is defined, the next
instruction will never be packaged with the previous one.  Whenever a branch and link
instruction will never be packaged with the previous one.  Whenever a branch and link
instruction is called, it will not be packaged with the next instruction so the return
instruction is called, it will not be packaged with the next instruction so the return
address will be valid.  Nops are automatically inserted when necessary.
address will be valid.  Nops are automatically inserted when necessary.
 
 
If you do not want the assembler automatically making these decisions, you can control
If you do not want the assembler automatically making these decisions, you can control
the packaging and execution type (parallel or sequential) with the special execution
the packaging and execution type (parallel or sequential) with the special execution
symbols described in the next section.
symbols described in the next section.
 
 
@node D10V-Chars
@node D10V-Chars
@subsection Special Characters
@subsection Special Characters
@cindex line comment character, D10V
@cindex line comment character, D10V
@cindex D10V line comment character
@cindex D10V line comment character
@samp{;} and @samp{#} are the line comment characters.
@samp{;} and @samp{#} are the line comment characters.
@cindex sub-instruction ordering, D10V
@cindex sub-instruction ordering, D10V
@cindex D10V sub-instruction ordering
@cindex D10V sub-instruction ordering
Sub-instructions may be executed in order, in reverse-order, or in parallel.
Sub-instructions may be executed in order, in reverse-order, or in parallel.
Instructions listed in the standard one-per-line format will be executed sequentially.
Instructions listed in the standard one-per-line format will be executed sequentially.
To specify the executing order, use the following symbols:
To specify the executing order, use the following symbols:
@table @samp
@table @samp
@item ->
@item ->
Sequential with instruction on the left first.
Sequential with instruction on the left first.
@item <-
@item <-
Sequential with instruction on the right first.
Sequential with instruction on the right first.
@item ||
@item ||
Parallel
Parallel
@end table
@end table
The D10V syntax allows either one instruction per line, one instruction per line with
The D10V syntax allows either one instruction per line, one instruction per line with
the execution symbol, or two instructions per line.  For example
the execution symbol, or two instructions per line.  For example
@table @code
@table @code
@item abs       a1      ->      abs     r0
@item abs       a1      ->      abs     r0
Execute these sequentially.  The instruction on the right is in the right
Execute these sequentially.  The instruction on the right is in the right
container and is executed second.
container and is executed second.
@item abs       r0      <-      abs     a1
@item abs       r0      <-      abs     a1
Execute these reverse-sequentially.  The instruction on the right is in the right
Execute these reverse-sequentially.  The instruction on the right is in the right
container, and is executed first.
container, and is executed first.
@item ld2w    r2,@@r8+         ||      mac     a0,r0,r7
@item ld2w    r2,@@r8+         ||      mac     a0,r0,r7
Execute these in parallel.
Execute these in parallel.
@item ld2w    r2,@@r8+         ||
@item ld2w    r2,@@r8+         ||
@itemx mac     a0,r0,r7
@itemx mac     a0,r0,r7
Two-line format. Execute these in parallel.
Two-line format. Execute these in parallel.
@item ld2w    r2,@@r8+
@item ld2w    r2,@@r8+
@itemx mac     a0,r0,r7
@itemx mac     a0,r0,r7
Two-line format. Execute these sequentially.  Assembler will
Two-line format. Execute these sequentially.  Assembler will
put them in the proper containers.
put them in the proper containers.
@item ld2w    r2,@@r8+         ->
@item ld2w    r2,@@r8+         ->
@itemx mac     a0,r0,r7
@itemx mac     a0,r0,r7
Two-line format. Execute these sequentially.  Same as above but
Two-line format. Execute these sequentially.  Same as above but
second instruction will always go into right container.
second instruction will always go into right container.
@end table
@end table
@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 D10V-Regs
@node D10V-Regs
@subsection Register Names
@subsection Register Names
@cindex D10V registers
@cindex D10V registers
@cindex registers, D10V
@cindex registers, D10V
You can use the predefined symbols @samp{r0} through @samp{r15} to refer to the D10V
You can use the predefined symbols @samp{r0} through @samp{r15} to refer to the D10V
registers.  You can also use @samp{sp} as an alias for @samp{r15}.  The accumulators
registers.  You can also use @samp{sp} as an alias for @samp{r15}.  The accumulators
are @samp{a0} and @samp{a1}.  There are special register-pair names that may
are @samp{a0} and @samp{a1}.  There are special register-pair names that may
optionally be used in opcodes that require even-numbered registers. Register names are
optionally be used in opcodes that require even-numbered registers. Register names are
not case sensitive.
not case sensitive.
 
 
Register Pairs
Register Pairs
@table @code
@table @code
@item r0-r1
@item r0-r1
@item r2-r3
@item r2-r3
@item r4-r5
@item r4-r5
@item r6-r7
@item r6-r7
@item r8-r9
@item r8-r9
@item r10-r11
@item r10-r11
@item r12-r13
@item r12-r13
@item r14-r15
@item r14-r15
@end table
@end table
 
 
The D10V also has predefined symbols for these control registers and status bits:
The D10V also has predefined symbols for these control registers and status bits:
@table @code
@table @code
@item psw
@item psw
Processor Status Word
Processor Status Word
@item bpsw
@item bpsw
Backup Processor Status Word
Backup Processor Status Word
@item pc
@item pc
Program Counter
Program Counter
@item bpc
@item bpc
Backup Program Counter
Backup Program Counter
@item rpt_c
@item rpt_c
Repeat Count
Repeat Count
@item rpt_s
@item rpt_s
Repeat Start address
Repeat Start address
@item rpt_e
@item rpt_e
Repeat End address
Repeat End address
@item mod_s
@item mod_s
Modulo Start address
Modulo Start address
@item mod_e
@item mod_e
Modulo End address
Modulo End address
@item iba
@item iba
Instruction Break Address
Instruction Break Address
@item f0
@item f0
Flag 0
Flag 0
@item f1
@item f1
Flag 1
Flag 1
@item c
@item c
Carry flag
Carry flag
@end table
@end table
 
 
@node D10V-Addressing
@node D10V-Addressing
@subsection Addressing Modes
@subsection Addressing Modes
@cindex addressing modes, D10V
@cindex addressing modes, D10V
@cindex D10V addressing modes
@cindex D10V addressing modes
@code{@value{AS}} understands the following addressing modes for the D10V.
@code{@value{AS}} understands the following addressing modes for the D10V.
@code{R@var{n}} in the following refers to any of the numbered
@code{R@var{n}} in the following refers to any of the numbered
registers, but @emph{not} the control registers.
registers, but @emph{not} the control registers.
@table @code
@table @code
@item R@var{n}
@item R@var{n}
Register direct
Register direct
@item @@R@var{n}
@item @@R@var{n}
Register indirect
Register indirect
@item @@R@var{n}+
@item @@R@var{n}+
Register indirect with post-increment
Register indirect with post-increment
@item @@R@var{n}-
@item @@R@var{n}-
Register indirect with post-decrement
Register indirect with post-decrement
@item @@-SP
@item @@-SP
Register indirect with pre-decrement
Register indirect with pre-decrement
@item @@(@var{disp}, R@var{n})
@item @@(@var{disp}, R@var{n})
Register indirect with displacement
Register indirect with displacement
@item @var{addr}
@item @var{addr}
PC relative address (for branch or rep).
PC relative address (for branch or rep).
@item #@var{imm}
@item #@var{imm}
Immediate data (the @samp{#} is optional and ignored)
Immediate data (the @samp{#} is optional and ignored)
@end table
@end table
 
 
@node D10V-Word
@node D10V-Word
@subsection @@WORD Modifier
@subsection @@WORD Modifier
@cindex D10V @@word modifier
@cindex D10V @@word modifier
@cindex @@word modifier, D10V
@cindex @@word modifier, D10V
Any symbol followed by @code{@@word} will be replaced by the symbol's value
Any symbol followed by @code{@@word} will be replaced by the symbol's value
shifted right by 2.  This is used in situations such as loading a register
shifted right by 2.  This is used in situations such as loading a register
with the address of a function (or any other code fragment).  For example, if
with the address of a function (or any other code fragment).  For example, if
you want to load a register with the location of the function @code{main} then
you want to load a register with the location of the function @code{main} then
jump to that function, you could do it as follows:
jump to that function, you could do it as follows:
@smallexample
@smallexample
@group
@group
ldi     r2, main@@word
ldi     r2, main@@word
jmp     r2
jmp     r2
@end group
@end group
@end smallexample
@end smallexample
 
 
@node D10V-Float
@node D10V-Float
@section Floating Point
@section Floating Point
@cindex floating point, D10V
@cindex floating point, D10V
@cindex D10V floating point
@cindex D10V floating point
The D10V has no hardware floating point, but the @code{.float} and @code{.double}
The D10V has no hardware floating point, but the @code{.float} and @code{.double}
directives generates @sc{ieee} floating-point numbers for compatibility
directives generates @sc{ieee} floating-point numbers for compatibility
with other development tools.
with other development tools.
 
 
@node D10V-Opcodes
@node D10V-Opcodes
@section Opcodes
@section Opcodes
@cindex D10V opcode summary
@cindex D10V opcode summary
@cindex opcode summary, D10V
@cindex opcode summary, D10V
@cindex mnemonics, D10V
@cindex mnemonics, D10V
@cindex instruction summary, D10V
@cindex instruction summary, D10V
For detailed information on the D10V machine instruction set, see
For detailed information on the D10V machine instruction set, see
@cite{D10V Architecture: A VLIW Microprocessor for Multimedia Applications}
@cite{D10V Architecture: A VLIW Microprocessor for Multimedia Applications}
(Mitsubishi Electric Corp.).
(Mitsubishi Electric Corp.).
@code{@value{AS}} implements all the standard D10V opcodes.  The only changes are those
@code{@value{AS}} implements all the standard D10V opcodes.  The only changes are those
described in the section on size modifiers
described in the section on size modifiers
 
 
 
 

powered by: WebSVN 2.1.0

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