Skip to content

Commit

Permalink
test/codegen: enable Mul2 DivPow2 test for riscv64
Browse files Browse the repository at this point in the history
Change-Id: Ice0bb7a665599b334e927a1b00d1a5b400c15e3d
Reviewed-on: https://go-review.googlesource.com/c/go/+/506035
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: David Chase <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
Run-TryBot: Keith Randall <[email protected]>
  • Loading branch information
mengzhuo authored and randall77 committed Jul 4, 2023
1 parent 5b72f45 commit 5c1a15d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/codegen/floats.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func Mul2(f float64) float64 {
// arm/7:"ADDD",-"MULD"
// arm64:"FADDD",-"FMULD"
// ppc64x:"FADD",-"FMUL"
// riscv64:"FADDD",-"FMULD"
return f * 2.0
}

Expand All @@ -29,20 +30,23 @@ func DivPow2(f1, f2, f3 float64) (float64, float64, float64) {
// arm/7:"MULD",-"DIVD"
// arm64:"FMULD",-"FDIVD"
// ppc64x:"FMUL",-"FDIV"
// riscv64:"FMULD",-"FDIVD"
x := f1 / 16.0

// 386/sse2:"MULSD",-"DIVSD"
// amd64:"MULSD",-"DIVSD"
// arm/7:"MULD",-"DIVD"
// arm64:"FMULD",-"FDIVD"
// ppc64x:"FMUL",-"FDIVD"
// riscv64:"FMULD",-"FDIVD"
y := f2 / 0.125

// 386/sse2:"ADDSD",-"DIVSD",-"MULSD"
// amd64:"ADDSD",-"DIVSD",-"MULSD"
// arm/7:"ADDD",-"MULD",-"DIVD"
// arm64:"FADDD",-"FMULD",-"FDIVD"
// ppc64x:"FADD",-"FMUL",-"FDIV"
// riscv64:"FADDD",-"FMULD",-"FDIVD"
z := f3 / 0.5

return x, y, z
Expand Down

0 comments on commit 5c1a15d

Please sign in to comment.