diff options
Diffstat (limited to 'test/codegen')
| -rw-r--r-- | test/codegen/math.go | 7 | ||||
| -rw-r--r-- | test/codegen/mathbits.go | 21 |
2 files changed, 28 insertions, 0 deletions
diff --git a/test/codegen/math.go b/test/codegen/math.go index aaf6b080ff..597271ce72 100644 --- a/test/codegen/math.go +++ b/test/codegen/math.go @@ -15,12 +15,14 @@ func approx(x float64) { // arm64:"FRINTPD" // ppc64:"FRIP" // ppc64le:"FRIP" + // wasm:"F64Ceil" sink64[0] = math.Ceil(x) // s390x:"FIDBR\t[$]7" // arm64:"FRINTMD" // ppc64:"FRIM" // ppc64le:"FRIM" + // wasm:"F64Floor" sink64[1] = math.Floor(x) // s390x:"FIDBR\t[$]1" @@ -33,10 +35,12 @@ func approx(x float64) { // arm64:"FRINTZD" // ppc64:"FRIZ" // ppc64le:"FRIZ" + // wasm:"F64Trunc" sink64[3] = math.Trunc(x) // s390x:"FIDBR\t[$]4" // arm64:"FRINTND" + // wasm:"F64Nearest" sink64[4] = math.RoundToEven(x) } @@ -47,6 +51,7 @@ func sqrt(x float64) float64 { // arm/7:"SQRTD" // mips/hardfloat:"SQRTD" mips/softfloat:-"SQRTD" // mips64/hardfloat:"SQRTD" mips64/softfloat:-"SQRTD" + // wasm:"F64Sqrt" return math.Sqrt(x) } @@ -57,6 +62,7 @@ func abs(x, y float64) { // s390x:"LPDFR\t",-"MOVD\t" (no integer load/store) // ppc64:"FABS\t" // ppc64le:"FABS\t" + // wasm:"F64Abs" sink64[0] = math.Abs(x) // amd64:"BTRQ\t[$]63","PXOR" (TODO: this should be BTSQ) @@ -78,6 +84,7 @@ func copysign(a, b, c float64) { // s390x:"CPSDR",-"MOVD" (no integer load/store) // ppc64:"FCPSGN" // ppc64le:"FCPSGN" + // wasm:"F64Copysign" sink64[0] = math.Copysign(a, b) // amd64:"BTSQ\t[$]63" diff --git a/test/codegen/mathbits.go b/test/codegen/mathbits.go index c77b66c3f7..9a4051a0ce 100644 --- a/test/codegen/mathbits.go +++ b/test/codegen/mathbits.go @@ -17,6 +17,7 @@ func LeadingZeros(n uint) int { // s390x:"FLOGR" // arm:"CLZ" arm64:"CLZ" // mips:"CLZ" + // wasm:"I64Clz" return bits.LeadingZeros(n) } @@ -25,6 +26,7 @@ func LeadingZeros64(n uint64) int { // s390x:"FLOGR" // arm:"CLZ" arm64:"CLZ" // mips:"CLZ" + // wasm:"I64Clz" return bits.LeadingZeros64(n) } @@ -33,6 +35,7 @@ func LeadingZeros32(n uint32) int { // s390x:"FLOGR" // arm:"CLZ" arm64:"CLZW" // mips:"CLZ" + // wasm:"I64Clz" return bits.LeadingZeros32(n) } @@ -41,6 +44,7 @@ func LeadingZeros16(n uint16) int { // s390x:"FLOGR" // arm:"CLZ" arm64:"CLZ" // mips:"CLZ" + // wasm:"I64Clz" return bits.LeadingZeros16(n) } @@ -49,6 +53,7 @@ func LeadingZeros8(n uint8) int { // s390x:"FLOGR" // arm:"CLZ" arm64:"CLZ" // mips:"CLZ" + // wasm:"I64Clz" return bits.LeadingZeros8(n) } @@ -61,6 +66,7 @@ func Len(n uint) int { // s390x:"FLOGR" // arm:"CLZ" arm64:"CLZ" // mips:"CLZ" + // wasm:"I64Clz" return bits.Len(n) } @@ -69,6 +75,7 @@ func Len64(n uint64) int { // s390x:"FLOGR" // arm:"CLZ" arm64:"CLZ" // mips:"CLZ" + // wasm:"I64Clz" return bits.Len64(n) } @@ -77,6 +84,7 @@ func Len32(n uint32) int { // s390x:"FLOGR" // arm:"CLZ" arm64:"CLZ" // mips:"CLZ" + // wasm:"I64Clz" return bits.Len32(n) } @@ -85,6 +93,7 @@ func Len16(n uint16) int { // s390x:"FLOGR" // arm:"CLZ" arm64:"CLZ" // mips:"CLZ" + // wasm:"I64Clz" return bits.Len16(n) } @@ -93,6 +102,7 @@ func Len8(n uint8) int { // s390x:"FLOGR" // arm:"CLZ" arm64:"CLZ" // mips:"CLZ" + // wasm:"I64Clz" return bits.Len8(n) } @@ -106,6 +116,7 @@ func OnesCount(n uint) int { // s390x:"POPCNT" // ppc64:"POPCNTD" // ppc64le:"POPCNTD" + // wasm:"I64Popcnt" return bits.OnesCount(n) } @@ -115,6 +126,7 @@ func OnesCount64(n uint64) int { // s390x:"POPCNT" // ppc64:"POPCNTD" // ppc64le:"POPCNTD" + // wasm:"I64Popcnt" return bits.OnesCount64(n) } @@ -124,6 +136,7 @@ func OnesCount32(n uint32) int { // s390x:"POPCNT" // ppc64:"POPCNTW" // ppc64le:"POPCNTW" + // wasm:"I64Popcnt" return bits.OnesCount32(n) } @@ -133,6 +146,7 @@ func OnesCount16(n uint16) int { // s390x:"POPCNT" // ppc64:"POPCNTW" // ppc64le:"POPCNTW" + // wasm:"I64Popcnt" return bits.OnesCount16(n) } @@ -140,6 +154,7 @@ func OnesCount8(n uint8) int { // s390x:"POPCNT" // ppc64:"POPCNTB" // ppc64le:"POPCNTB" + // wasm:"I64Popcnt" return bits.OnesCount8(n) } @@ -187,6 +202,7 @@ func RotateLeft64(n uint64) uint64 { // ppc64:"ROTL" // ppc64le:"ROTL" // s390x:"RLLG" + // wasm:"I64Rotl" return bits.RotateLeft64(n, 37) } @@ -246,6 +262,7 @@ func TrailingZeros(n uint) int { // s390x:"FLOGR" // ppc64:"ANDN","POPCNTD" // ppc64le:"ANDN","POPCNTD" + // wasm:"I64Ctz" return bits.TrailingZeros(n) } @@ -255,6 +272,7 @@ func TrailingZeros64(n uint64) int { // s390x:"FLOGR" // ppc64:"ANDN","POPCNTD" // ppc64le:"ANDN","POPCNTD" + // wasm:"I64Ctz" return bits.TrailingZeros64(n) } @@ -264,6 +282,7 @@ func TrailingZeros32(n uint32) int { // s390x:"FLOGR","MOVWZ" // ppc64:"ANDN","POPCNTW" // ppc64le:"ANDN","POPCNTW" + // wasm:"I64Ctz" return bits.TrailingZeros32(n) } @@ -273,6 +292,7 @@ func TrailingZeros16(n uint16) int { // s390x:"FLOGR","OR\t\\$65536" // ppc64:"POPCNTD","OR\\t\\$65536" // ppc64le:"POPCNTD","OR\\t\\$65536" + // wasm:"I64Ctz" return bits.TrailingZeros16(n) } @@ -280,6 +300,7 @@ func TrailingZeros8(n uint8) int { // amd64:"BSFL","BTSL\\t\\$8" // arm64:"ORR\t\\$256","RBITW","CLZW",-"MOVBU\tR",-"RBIT\t",-"CLZ\t" // s390x:"FLOGR","OR\t\\$256" + // wasm:"I64Ctz" return bits.TrailingZeros8(n) } |
