mirror of
https://github.com/ziglang/zig.git
synced 2025-12-15 18:53:07 +00:00
parent
17e3fcc3a5
commit
401de6dd2f
@ -84,6 +84,13 @@ pub fn panic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace, _: ?
|
|||||||
/// here in compiler-rt.
|
/// here in compiler-rt.
|
||||||
pub fn F16T(comptime other_type: type) type {
|
pub fn F16T(comptime other_type: type) type {
|
||||||
return switch (builtin.cpu.arch) {
|
return switch (builtin.cpu.arch) {
|
||||||
|
.arm, .armeb, .thumb, .thumbeb => if (std.Target.arm.featureSetHas(builtin.cpu.features, .has_v8))
|
||||||
|
switch (builtin.abi.floatAbi()) {
|
||||||
|
.soft => u16,
|
||||||
|
.hard => f16,
|
||||||
|
}
|
||||||
|
else
|
||||||
|
u16,
|
||||||
.aarch64, .aarch64_be, .aarch64_32 => f16,
|
.aarch64, .aarch64_be, .aarch64_32 => f16,
|
||||||
.riscv64 => if (builtin.zig_backend == .stage1) u16 else f16,
|
.riscv64 => if (builtin.zig_backend == .stage1) u16 else f16,
|
||||||
.x86, .x86_64 => if (builtin.target.isDarwin()) switch (other_type) {
|
.x86, .x86_64 => if (builtin.target.isDarwin()) switch (other_type) {
|
||||||
|
|||||||
@ -1473,7 +1473,6 @@ pub const Target = struct {
|
|||||||
pub const FloatAbi = enum {
|
pub const FloatAbi = enum {
|
||||||
hard,
|
hard,
|
||||||
soft,
|
soft,
|
||||||
soft_fp,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub inline fn getFloatAbi(self: Target) FloatAbi {
|
pub inline fn getFloatAbi(self: Target) FloatAbi {
|
||||||
|
|||||||
@ -722,11 +722,6 @@ test "@floor f128" {
|
|||||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
|
||||||
|
|
||||||
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isARM()) {
|
|
||||||
// https://github.com/ziglang/zig/issues/16848
|
|
||||||
return error.SkipZigTest;
|
|
||||||
}
|
|
||||||
|
|
||||||
try testFloorLegacy(f128, 12.0);
|
try testFloorLegacy(f128, 12.0);
|
||||||
try comptime testFloorLegacy(f128, 12.0);
|
try comptime testFloorLegacy(f128, 12.0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,11 +57,6 @@ test "@mulAdd f80" {
|
|||||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
|
||||||
|
|
||||||
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isARM()) {
|
|
||||||
// https://github.com/ziglang/zig/issues/16848
|
|
||||||
return error.SkipZigTest;
|
|
||||||
}
|
|
||||||
|
|
||||||
try comptime testMulAdd80();
|
try comptime testMulAdd80();
|
||||||
try testMulAdd80();
|
try testMulAdd80();
|
||||||
}
|
}
|
||||||
@ -81,11 +76,6 @@ test "@mulAdd f128" {
|
|||||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_c and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
|
||||||
|
|
||||||
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isARM()) {
|
|
||||||
// https://github.com/ziglang/zig/issues/16848
|
|
||||||
return error.SkipZigTest;
|
|
||||||
}
|
|
||||||
|
|
||||||
try comptime testMulAdd128();
|
try comptime testMulAdd128();
|
||||||
try testMulAdd128();
|
try testMulAdd128();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,11 +12,6 @@ test "no clobbering happened" {
|
|||||||
return error.SkipZigTest;
|
return error.SkipZigTest;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isARM()) {
|
|
||||||
// https://github.com/ziglang/zig/issues/16848
|
|
||||||
return error.SkipZigTest;
|
|
||||||
}
|
|
||||||
|
|
||||||
@This().foo_function();
|
@This().foo_function();
|
||||||
@This().bar_function();
|
@This().bar_function();
|
||||||
try expect(@This().saw_foo_function);
|
try expect(@This().saw_foo_function);
|
||||||
|
|||||||
@ -66,11 +66,6 @@ test "float widening f16 to f128" {
|
|||||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||||
|
|
||||||
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isARM()) {
|
|
||||||
// https://github.com/ziglang/zig/issues/16848
|
|
||||||
return error.SkipZigTest;
|
|
||||||
}
|
|
||||||
|
|
||||||
var x: f16 = 12.34;
|
var x: f16 = 12.34;
|
||||||
var y: f128 = x;
|
var y: f128 = x;
|
||||||
try expect(x == y);
|
try expect(x == y);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user