ARM 아키텍처에서는 곱셈과 곱셈 누적 연산을 위한 명령어인 MUL
(Multiply)과 MLA
(Multiply-Accumulate)를 제공한다. 이 글에서는 MUL
, MLA
명령어에 대해 알아본다.
Multiply instructions
곱셈과 곱셈-누산 명령은 8비트 Booth
알고리즘을 사용하여 정수 곱셈을 수행한다.
Syntax
MUL{cond}{S} Rd,Rm,Rs
MLA{cond}{S} Rd,Rm,Rs,Rn
{cond}
: two-character condition mnemonic.{S}
: set condition codes if S presentRd
,Rm
,Rs
andRn
: expressions evaluating to a register number other than R15.
Examples
MUL R1,R2,R3 ; R1:=R2*R3
MLAEQS R1,R2,R3,R4 ; Conditionally R1:=R2*R3+R4,
; setting condition codes.