Page 336 - ARM 64 Bit Assembly Language
P. 336
326 Chapter 10
{opt} Braces around a string indicate that the string is optional. For example, several op-
erations have an optional r which indicates that the result is rounded instead of trun-
cated.
(s|u) Parentheses indicate a choice between two or more possible characters or strings, sep-
arated by the pipe “|” character. For example, (s|u)shr would describe two forms for
the shr instruction: sshr and ushr.
<Tn> A string inside the < and > symbols indicates a choice or special syntax that is too
complex to be easily described using the parenthesis and pipe (a|b) syntax, and is
described in the following text. It is also used to define a syntactical token when simply
using a character would lead to confusion.
The following function definitions are used in describing the effects of many of the instruc-
tions:
x The floor function maps a real number, x, to the next smallest integer.
x The saturate function limits the value of x to the highest or lowest value that can be
stored in the destination register. Saturation is a method used to prevent overflow.
x The round function maps a real number, x, to the nearest integer.
x ≺ The narrow function reduces a 2n bit number to an n bit number, by taking the n least
significant bits.
≺x The extend function converts an n bit number to a 2n bit number, performing zero ex-
tension if the number is unsigned, or sign extension if the number is signed.
10.2 Load and store instructions
These instructions can be used to perform interleaving of data when structured data is loaded
or stored. The data should be properly aligned for best performance. These instructions are
very useful for common multimedia data types.
For example, image data is typically stored in arrays of pixels, where each pixel is a small
data structure such as the pixel struct shown in Listing 5.38. Since each pixel is three bytes,
and a d register is 8 bytes, loading a single pixel into one register would be inefficient. It
would be much better to load multiple pixels at once, but an even number of pixels will not
fit in a register. It will take three doubleword or quadword registers to hold an even number of
pixels without wasting space, as shown in Fig. 10.2. This is the way data would be loaded us-
ing an Advanced SIMD ldr instruction. Many image processing operations work best if each
color “channel” is processed separately. The SIMD load and store instructions can be used to