Commit 93e27e01 authored by Ben Shi's avatar Ben Shi Committed by Cherry Zhang

test/codegen: add tests of FMA for arm/arm64

This CL adds tests of fused multiplication-accumulation
on arm/arm64.

Change-Id: Ic85d5277c0d6acb7e1e723653372dfaf96824a39
Reviewed-on: https://go-review.googlesource.com/c/141652
Run-TryBot: Ben Shi <powerman1st@163.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
parent bb3bf5bb
......@@ -72,27 +72,43 @@ func indexStore(b0 []float64, b1 float64, idx int) {
func FusedAdd32(x, y, z float32) float32 {
// s390x:"FMADDS\t"
// ppc64le:"FMADDS\t"
// arm/7:"MULAF"
// arm64:"FMADDS"
return x*y + z
}
func FusedSub32(x, y, z float32) float32 {
func FusedSub32_a(x, y, z float32) float32 {
// s390x:"FMSUBS\t"
// ppc64le:"FMSUBS\t"
return x*y - z
}
func FusedSub32_b(x, y, z float32) float32 {
// arm/7:"MULSF"
// arm64:"FMSUBS"
return z - x*y
}
func FusedAdd64(x, y, z float64) float64 {
// s390x:"FMADD\t"
// ppc64le:"FMADD\t"
// arm/7:"MULAD"
// arm64:"FMADDD"
return x*y + z
}
func FusedSub64(x, y, z float64) float64 {
func FusedSub64_a(x, y, z float64) float64 {
// s390x:"FMSUB\t"
// ppc64le:"FMSUB\t"
return x*y - z
}
func FusedSub64_b(x, y, z float64) float64 {
// arm/7:"MULSD"
// arm64:"FMSUBD"
return z - x*y
}
// ---------------- //
// Non-floats //
// ---------------- //
......
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