mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 01:24:49 +01:00
libzigc: test and fix acos
This commit is contained in:
parent
c857fce05b
commit
e6ac1b77f0
4 changed files with 3 additions and 22 deletions
18
lib/libc/musl/src/math/i386/acos.s
vendored
18
lib/libc/musl/src/math/i386/acos.s
vendored
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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, .{});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue