Closed
Description
Zig Version
0.13.0
Steps to Reproduce and Observed Behavior
const std = @import("std");
test {
var a: f16 = 42.0;
_ = &a;
var b: i32 = @intFromFloat(a);
_ = &b;
try std.testing.expect(b == 42);
}
$ zig test test.zig -target loongarch64-linux-musl
LLVM ERROR: Cannot select: 0x7fb49a509b20: i64 = fp_to_fp16 0x7fb49956ba80
0x7fb49956ba80: f32,ch = CopyFromReg 0x7fb4999973e0, Register:f32 %11
0x7fb49956f010: f32 = Register %11
In function: __fixhfsi
Aborted (core dumped)
Expected Behavior
all 1 tests passed