Commit e7e7b1c5 authored by Shenghou Ma's avatar Shenghou Ma

math: ARM assembly implementation for Abs

Obtained on 700MHz OMAP4460:
benchmark       old ns/op    new ns/op    delta
BenchmarkAbs           61           23  -61.63%

R=dave, remyoudompheng, mtj, rsc
CC=golang-dev
https://golang.org/cl/6094047
parent a8098cbc
......@@ -3,4 +3,9 @@
// license that can be found in the LICENSE file.
TEXT ·Abs(SB),7,$0
B ·abs(SB)
MOVW lo+0(FP), R0
MOVW hi+4(FP), R1
AND $((1<<31)-1), R1
MOVW R0, resultlo+8(FP)
MOVW R1, resulthi+12(FP)
RET
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment