1
0
mirror of https://github.com/golang/go synced 2024-11-20 08:14:41 -07:00

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
This commit is contained in:
Shenghou Ma 2012-04-23 23:47:36 +08:00
parent a8098cbcfd
commit e7e7b1c55c

View File

@ -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