zig/lib/compiler_rt/negsf2.zig
Andrew Kelley 6bc6e47b15 stage2: lower float negation explicitly
Rather than lowering float negation as `0.0 - x`.

 * Add AIR instruction for float negation.
 * Add compiler-rt functions for f128, f80 negation

closes #11853
2022-06-30 00:02:00 -07:00

20 lines
447 B
Zig

const common = @import("./common.zig");
pub const panic = common.panic;
comptime {
if (common.want_aeabi) {
@export(__aeabi_fneg, .{ .name = "__aeabi_fneg", .linkage = common.linkage });
} else {
@export(__negsf2, .{ .name = "__negsf2", .linkage = common.linkage });
}
}
fn __negsf2(a: f32) callconv(.C) f32 {
return common.fneg(a);
}
fn __aeabi_fneg(a: f32) callconv(.AAPCS) f32 {
return common.fneg(a);
}