05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The Instruction Sets<br />

A4.4.7 Parallel addition <strong>and</strong> subtraction instructions<br />

These instructions perform additions <strong>and</strong> subtractions on the values of two registers <strong>and</strong> write the result to<br />

a destination register, treating the register values as sets of two halfwords or four bytes. They are available<br />

in <strong>ARM</strong>v6 <strong>and</strong> above.<br />

These instructions consist of a prefix followed by a main instruction mnemonic. The prefixes are as follows:<br />

S Signed arithmetic modulo 2 8 or 2 16.<br />

Q Signed saturating arithmetic.<br />

SH Signed arithmetic, halving the results.<br />

U Unsigned arithmetic modulo 2 8 or 2 16.<br />

UQ Unsigned saturating arithmetic.<br />

UH Unsigned arithmetic, halving the results.<br />

The main instruction mnemonics are as follows:<br />

ADD16 Adds the top halfwords of two oper<strong>and</strong>s to form the top halfword of the result, <strong>and</strong> the<br />

bottom halfwords of the same two oper<strong>and</strong>s to form the bottom halfword of the result.<br />

ASX Exchanges halfwords of the second oper<strong>and</strong>, <strong>and</strong> then adds top halfwords <strong>and</strong> subtracts<br />

bottom halfwords.<br />

SAX Exchanges halfwords of the second oper<strong>and</strong>, <strong>and</strong> then subtracts top halfwords <strong>and</strong> adds<br />

bottom halfwords.<br />

SUB16 Subtracts each halfword of the second oper<strong>and</strong> from the corresponding halfword of the first<br />

oper<strong>and</strong> to form the corresponding halfword of the result.<br />

ADD8 Adds each byte of the second oper<strong>and</strong> to the corresponding byte of the first oper<strong>and</strong> to form<br />

the corresponding byte of the result.<br />

SUB8 Subtracts each byte of the second oper<strong>and</strong> from the corresponding byte of the first oper<strong>and</strong><br />

to form the corresponding byte of the result.<br />

The instruction set permits all 36 combinations of prefix <strong>and</strong> main instruction oper<strong>and</strong>.<br />

See also Advanced SIMD parallel addition <strong>and</strong> subtraction on page A4-31.<br />

A4-16 Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DDI 0406B

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!