libzigc: test and fix acos

This commit is contained in:
rpkak 2026-01-20 18:02:15 +01:00
parent c857fce05b
commit e6ac1b77f0
No known key found for this signature in database
4 changed files with 3 additions and 22 deletions

View file

@ -1,18 +0,0 @@
# use acos(x) = atan2(fabs(sqrt((1-x)*(1+x))), x)
.global acos
.type acos,@function
acos:
fldl 4(%esp)
fld %st(0)
fld1
fsub %st(0),%st(1)
fadd %st(2)
fmulp
fsqrt
fabs # fix sign of zero (matters in downward rounding mode)
fxch %st(1)
fpatan
fstpl 4(%esp)
fldl 4(%esp)
ret

View file

@ -48,7 +48,7 @@ fn acos32(x: f32) f32 {
return 0.0;
}
} else {
return math.nan(f32);
return (x - x) / 0;
}
}
@ -117,7 +117,7 @@ fn acos64(x: f64) f64 {
}
}
return math.nan(f64);
return (x - x) / 0;
}
// |x| < 0.5

View file

@ -890,7 +890,6 @@ const src_files = [_][]const u8{
"musl/src/math/hypotl.c",
"musl/src/math/i386/acosf.s",
"musl/src/math/i386/acosl.s",
"musl/src/math/i386/acos.s",
"musl/src/math/i386/asinf.s",
"musl/src/math/i386/asinl.s",
"musl/src/math/i386/asin.s",

View file

@ -138,7 +138,7 @@ pub fn addCases(cases: *tests.LibcContext) void {
cases.addLibcTestCase("regression/wcsncpy-read-overflow.c", true, .{});
cases.addLibcTestCase("regression/wcsstr-false-negative.c", true, .{});
// cases.addLibcTestCase("math/acos.c", true, .{});
cases.addLibcTestCase("math/acos.c", true, .{});
// cases.addLibcTestCase("math/acosf.c", true, .{});
// cases.addLibcTestCase("math/acosh.c", true, .{});
cases.addLibcTestCase("math/acoshf.c", true, .{});