Files
oldlinux-files/study/Ref-docs/manual as/as_17.html
2024-02-19 00:25:23 -05:00

256 lines
9.5 KiB
HTML

<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
from ../texi/as.texinfo on 24 April 1999 -->
<TITLE>Using as - Intel 80960 Dependent Features</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="as_1.html">first</A>, <A HREF="as_16.html">previous</A>, <A HREF="as_18.html">next</A>, <A HREF="as_27.html">last</A> section, <A HREF="as_toc.html">table of contents</A>.
<P><HR><P>
<H1><A NAME="SEC207" HREF="as_toc.html#TOC207">Intel 80960 Dependent Features</A></H1>
<P>
<A NAME="IDX638"></A>
</P>
<H2><A NAME="SEC208" HREF="as_toc.html#TOC208">i960 Command-line Options</A></H2>
<P>
<A NAME="IDX639"></A>
<A NAME="IDX640"></A>
<DL COMPACT>
<DT><CODE>-ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC</CODE>
<DD>
<A NAME="IDX641"></A>
<A NAME="IDX642"></A>
<A NAME="IDX643"></A>
Select the 80960 architecture. Instructions or features not supported
by the selected architecture cause fatal errors.
<SAMP>`-ACA'</SAMP> is equivalent to <SAMP>`-ACA_A'</SAMP>; <SAMP>`-AKC'</SAMP> is equivalent to
<SAMP>`-AMC'</SAMP>. Synonyms are provided for compatibility with other tools.
If you do not specify any of these options, <CODE>as</CODE> generates code
for any instruction or feature that is supported by <EM>some</EM> version of the
960 (even if this means mixing architectures!). In principle,
<CODE>as</CODE> attempts to deduce the minimal sufficient processor type if
none is specified; depending on the object code format, the processor type may
be recorded in the object file. If it is critical that the <CODE>as</CODE>
output match a specific architecture, specify that architecture explicitly.
<A NAME="IDX644"></A>
<A NAME="IDX645"></A>
<A NAME="IDX646"></A>
<DT><CODE>-b</CODE>
<DD>
Add code to collect information about conditional branches taken, for
later optimization using branch prediction bits. (The conditional branch
instructions have branch prediction bits in the CA, CB, and CC
architectures.) If <VAR>BR</VAR> represents a conditional branch instruction,
the following represents the code generated by the assembler when
<SAMP>`-b'</SAMP> is specified:
<PRE>
call <VAR>increment routine</VAR>
.word 0 # pre-counter
Label: <VAR>BR</VAR>
call <VAR>increment routine</VAR>
.word 0 # post-counter
</PRE>
The counter following a branch records the number of times that branch
was <EM>not</EM> taken; the differenc between the two counters is the
number of times the branch <EM>was</EM> taken.
<A NAME="IDX647"></A>
<A NAME="IDX648"></A>
A table of every such <CODE>Label</CODE> is also generated, so that the
external postprocessor <CODE>gbr960</CODE> (supplied by Intel) can locate all
the counters. This table is always labelled <SAMP>`__BRANCH_TABLE__'</SAMP>;
this is a local symbol to permit collecting statistics for many separate
object files. The table is word aligned, and begins with a two-word
header. The first word, initialized to 0, is used in maintaining linked
lists of branch tables. The second word is a count of the number of
entries in the table, which follow immediately: each is a word, pointing
to one of the labels illustrated above.
The first word of the header is used to locate multiple branch tables,
since each object file may contain one. Normally the links are
maintained with a call to an initialization routine, placed at the
beginning of each function in the file. The GNU C compiler
generates these calls automatically when you give it a <SAMP>`-b'</SAMP> option.
For further details, see the documentation of <SAMP>`gbr960'</SAMP>.
<A NAME="IDX649"></A>
<DT><CODE>-no-relax</CODE>
<DD>
Normally, Compare-and-Branch instructions with targets that require
displacements greater than 13 bits (or that have external targets) are
replaced with the corresponding compare (or <SAMP>`chkbit'</SAMP>) and branch
instructions. You can use the <SAMP>`-no-relax'</SAMP> option to specify that
<CODE>as</CODE> should generate errors instead, if the target displacement
is larger than 13 bits.
This option does not affect the Compare-and-Jump instructions; the code
emitted for them is <EM>always</EM> adjusted when necessary (depending on
displacement size), regardless of whether you use <SAMP>`-no-relax'</SAMP>.
</DL>
<H2><A NAME="SEC209" HREF="as_toc.html#TOC209">Floating Point</A></H2>
<P>
<A NAME="IDX650"></A>
<A NAME="IDX651"></A>
<CODE>as</CODE> generates IEEE floating-point numbers for the directives
<SAMP>`.float'</SAMP>, <SAMP>`.double'</SAMP>, <SAMP>`.extended'</SAMP>, and <SAMP>`.single'</SAMP>.
</P>
<H2><A NAME="SEC210" HREF="as_toc.html#TOC210">i960 Machine Directives</A></H2>
<P>
<A NAME="IDX652"></A>
<A NAME="IDX653"></A>
</P>
<DL COMPACT>
<DT><CODE>.bss <VAR>symbol</VAR>, <VAR>length</VAR>, <VAR>align</VAR></CODE>
<DD>
<A NAME="IDX654"></A>
Reserve <VAR>length</VAR> bytes in the bss section for a local <VAR>symbol</VAR>,
aligned to the power of two specified by <VAR>align</VAR>. <VAR>length</VAR> and
<VAR>align</VAR> must be positive absolute expressions. This directive
differs from <SAMP>`.lcomm'</SAMP> only in that it permits you to specify
an alignment. See section <A HREF="as_7.html#SEC101"><CODE>.lcomm <VAR>symbol</CODE> , <VAR>length</VAR></VAR></A>.
</DL>
<DL COMPACT>
<DT><CODE>.extended <VAR>flonums</VAR></CODE>
<DD>
<A NAME="IDX655"></A>
<CODE>.extended</CODE> expects zero or more flonums, separated by commas; for
each flonum, <SAMP>`.extended'</SAMP> emits an IEEE extended-format (80-bit)
floating-point number.
<A NAME="IDX656"></A>
<DT><CODE>.leafproc <VAR>call-lab</VAR>, <VAR>bal-lab</VAR></CODE>
<DD>
You can use the <SAMP>`.leafproc'</SAMP> directive in conjunction with the
optimized <CODE>callj</CODE> instruction to enable faster calls of leaf
procedures. If a procedure is known to call no other procedures, you
may define an entry point that skips procedure prolog code (and that does
not depend on system-supplied saved context), and declare it as the
<VAR>bal-lab</VAR> using <SAMP>`.leafproc'</SAMP>. If the procedure also has an
entry point that goes through the normal prolog, you can specify that
entry point as <VAR>call-lab</VAR>.
A <SAMP>`.leafproc'</SAMP> declaration is meant for use in conjunction with the
optimized call instruction <SAMP>`callj'</SAMP>; the directive records the data
needed later to choose between converting the <SAMP>`callj'</SAMP> into a
<CODE>bal</CODE> or a <CODE>call</CODE>.
<VAR>call-lab</VAR> is optional; if only one argument is present, or if the
two arguments are identical, the single argument is assumed to be the
<CODE>bal</CODE> entry point.
<A NAME="IDX657"></A>
<DT><CODE>.sysproc <VAR>name</VAR>, <VAR>index</VAR></CODE>
<DD>
The <SAMP>`.sysproc'</SAMP> directive defines a name for a system procedure.
After you define it using <SAMP>`.sysproc'</SAMP>, you can use <VAR>name</VAR> to
refer to the system procedure identified by <VAR>index</VAR> when calling
procedures with the optimized call instruction <SAMP>`callj'</SAMP>.
Both arguments are required; <VAR>index</VAR> must be between 0 and 31
(inclusive).
</DL>
<H2><A NAME="SEC211" HREF="as_toc.html#TOC211">i960 Opcodes</A></H2>
<P>
<A NAME="IDX658"></A>
<A NAME="IDX659"></A>
All Intel 960 machine instructions are supported;
see section <A HREF="as_17.html#SEC208">i960 Command-line Options</A> for a discussion of
selecting the instruction subset for a particular 960
architecture.
</P>
<P>
Some opcodes are processed beyond simply emitting a single corresponding
instruction: <SAMP>`callj'</SAMP>, and Compare-and-Branch or Compare-and-Jump
instructions with target displacements larger than 13 bits.
</P>
<H3><A NAME="SEC212" HREF="as_toc.html#TOC212"><CODE>callj</CODE></A></H3>
<P>
<A NAME="IDX660"></A>
<A NAME="IDX661"></A>
You can write <CODE>callj</CODE> to have the assembler or the linker determine
the most appropriate form of subroutine call: <SAMP>`call'</SAMP>,
<SAMP>`bal'</SAMP>, or <SAMP>`calls'</SAMP>. If the assembly source contains
enough information--a <SAMP>`.leafproc'</SAMP> or <SAMP>`.sysproc'</SAMP> directive
defining the operand--then <CODE>as</CODE> translates the
<CODE>callj</CODE>; if not, it simply emits the <CODE>callj</CODE>, leaving it
for the linker to resolve.
</P>
<H3><A NAME="SEC213" HREF="as_toc.html#TOC213">Compare-and-Branch</A></H3>
<P>
<A NAME="IDX662"></A>
<A NAME="IDX663"></A>
The 960 architectures provide combined Compare-and-Branch instructions
that permit you to store the branch target in the lower 13 bits of the
instruction word itself. However, if you specify a branch target far
enough away that its address won't fit in 13 bits, the assembler can
either issue an error, or convert your Compare-and-Branch instruction
into separate instructions to do the compare and the branch.
</P>
<P>
<A NAME="IDX664"></A>
<A NAME="IDX665"></A>
Whether <CODE>as</CODE> gives an error or expands the instruction depends
on two choices you can make: whether you use the <SAMP>`-no-relax'</SAMP> option,
and whether you use a "Compare and Branch" instruction or a "Compare
and Jump" instruction. The "Jump" instructions are <EM>always</EM>
expanded if necessary; the "Branch" instructions are expanded when
necessary <EM>unless</EM> you specify <CODE>-no-relax</CODE>---in which case
<CODE>as</CODE> gives an error instead.
</P>
<P>
These are the Compare-and-Branch instructions, their "Jump" variants,
and the instruction pairs they may expand into:
</P>
<P><HR><P>
Go to the <A HREF="as_1.html">first</A>, <A HREF="as_16.html">previous</A>, <A HREF="as_18.html">next</A>, <A HREF="as_27.html">last</A> section, <A HREF="as_toc.html">table of contents</A>.
</BODY>
</HTML>