ssa: fix bitcast for float32

This commit is contained in:
visualfc
2024-12-24 10:02:30 +08:00
parent 6dd4ec160d
commit 3741a28d94
3 changed files with 211 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
package main
const pi = 3.14159265
func check32(v any) {
if v.(float32) != pi {
panic("error f32")
}
}
func check64(v any) {
if v.(float64) != pi {
panic("error f64")
}
}
func f32() float32 {
return pi
}
func f64() float64 {
return pi
}
func main() {
check32(f32())
check64(f64())
}