-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the generic algorithms to provide implementations for these routines.
- Loading branch information
Showing
16 changed files
with
297 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.globl libm::math::ceil::ceil | ||
.p2align 2 | ||
libm::math::ceil::ceil: | ||
Lfunc_begin17: | ||
.cfi_startproc | ||
sub sp, sp, #16 | ||
.cfi_def_cfa_offset 16 | ||
fcmp d0, #0.0 | ||
b.eq LBB17_5 | ||
fmov x8, d0 | ||
ubfx x9, x8, #52, #11 | ||
cmp w9, #1074 | ||
b.hi LBB17_5 | ||
mov x10, #-4382002437431492608 | ||
fmov d1, x10 | ||
fadd d2, d0, d1 | ||
mov x10, #4841369599423283200 | ||
fmov d3, x10 | ||
fadd d2, d2, d3 | ||
fadd d3, d0, d3 | ||
fadd d1, d3, d1 | ||
cmp x8, #0 | ||
fcsel d1, d2, d1, lt | ||
fsub d1, d1, d0 | ||
str d1, [sp, #8] | ||
cmp w9, #1023 | ||
b.hs LBB17_4 | ||
ldr d0, [sp, #8] | ||
cmp x8, #0 | ||
mov x8, #-9223372036854775808 | ||
fmov d0, x8 | ||
fmov d1, #1.00000000 | ||
fcsel d0, d0, d1, lt | ||
b LBB17_5 | ||
LBB17_4: | ||
fadd d0, d1, d0 | ||
fmov d2, #1.00000000 | ||
fadd d2, d0, d2 | ||
fcmp d1, #0.0 | ||
fcsel d0, d2, d0, mi | ||
LBB17_5: | ||
add sp, sp, #16 | ||
.cfi_def_cfa_offset 0 | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.globl libm::math::ceilf::ceilf | ||
.p2align 2 | ||
libm::math::ceilf::ceilf: | ||
Lfunc_begin18: | ||
.cfi_startproc | ||
sub sp, sp, #16 | ||
.cfi_def_cfa_offset 16 | ||
fcmp s0, #0.0 | ||
b.eq LBB18_5 | ||
fmov w8, s0 | ||
ubfx w9, w8, #23, #8 | ||
cmp w9, #149 | ||
b.hi LBB18_5 | ||
movi.2s v1, #203, lsl #24 | ||
fadd s2, s0, s1 | ||
movi.2s v3, #75, lsl #24 | ||
fadd s2, s2, s3 | ||
fadd s3, s0, s3 | ||
fadd s1, s3, s1 | ||
cmp w8, #0 | ||
fcsel s1, s2, s1, lt | ||
fsub s1, s1, s0 | ||
str s1, [sp, #12] | ||
cmp w9, #127 | ||
b.hs LBB18_4 | ||
ldr s0, [sp, #12] | ||
cmp w8, #0 | ||
movi.2s v0, #128, lsl #24 | ||
fmov s1, #1.00000000 | ||
fcsel s0, s0, s1, lt | ||
b LBB18_5 | ||
LBB18_4: | ||
fadd s0, s1, s0 | ||
fmov s2, #1.00000000 | ||
fadd s2, s0, s2 | ||
fcmp s1, #0.0 | ||
fcsel s0, s2, s0, mi | ||
LBB18_5: | ||
add sp, sp, #16 | ||
.cfi_def_cfa_offset 0 | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ cbrt | |
cbrtf | ||
ceil | ||
ceilf | ||
ceilf128 | ||
ceilf16 | ||
copysign | ||
copysignf | ||
copysignf128 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
.globl libm::math::ceil::ceil | ||
.p2align 2 | ||
libm::math::ceil::ceil: | ||
Lfunc_begin17: | ||
.cfi_startproc | ||
sub sp, sp, #16 | ||
.cfi_def_cfa_offset 16 | ||
fcmp d0, #0.0 | ||
b.eq LBB17_8 | ||
fmov x9, d0 | ||
ubfx x8, x9, #52, #11 | ||
cmp x8, #1074 | ||
b.hi LBB17_8 | ||
tbnz x9, #63, LBB17_5 | ||
mov x9, #4841369599423283200 | ||
fmov d1, x9 | ||
fadd d1, d0, d1 | ||
mov x9, #-4382002437431492608 | ||
fmov d2, x9 | ||
fadd d1, d1, d2 | ||
fsub d1, d1, d0 | ||
str d1, [sp, #8] | ||
cmp x8, #1023 | ||
b.hs LBB17_7 | ||
ldr d0, [sp, #8] | ||
fmov d0, #1.00000000 | ||
b LBB17_8 | ||
LBB17_5: | ||
mov x9, #-4382002437431492608 | ||
fmov d1, x9 | ||
fadd d1, d0, d1 | ||
mov x9, #4841369599423283200 | ||
fmov d2, x9 | ||
fadd d1, d1, d2 | ||
fsub d1, d1, d0 | ||
str d1, [sp, #8] | ||
cmp x8, #1023 | ||
b.hs LBB17_7 | ||
ldr d0, [sp, #8] | ||
mov x8, #-9223372036854775808 | ||
fmov d0, x8 | ||
b LBB17_8 | ||
LBB17_7: | ||
fadd d0, d1, d0 | ||
fmov d2, #1.00000000 | ||
fadd d2, d0, d2 | ||
fcmp d1, #0.0 | ||
fcsel d0, d2, d0, mi | ||
LBB17_8: | ||
add sp, sp, #16 | ||
.cfi_def_cfa_offset 0 | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.globl libm::math::ceilf::ceilf | ||
.p2align 2 | ||
libm::math::ceilf::ceilf: | ||
Lfunc_begin18: | ||
.cfi_startproc | ||
sub sp, sp, #16 | ||
.cfi_def_cfa_offset 16 | ||
fmov w8, s0 | ||
ubfx w9, w8, #23, #8 | ||
cmp w9, #149 | ||
b.hi LBB18_5 | ||
cmp w9, #126 | ||
b.ls LBB18_4 | ||
lsr w9, w8, #23 | ||
add w10, w9, #1 | ||
mov w9, #8388607 | ||
lsr w9, w9, w10 | ||
tst w9, w8 | ||
b.eq LBB18_5 | ||
and w10, w10, #0x1f | ||
mov w11, #2071986176 | ||
fmov s1, w11 | ||
fadd s0, s0, s1 | ||
str s0, [sp, #8] | ||
ldr s0, [sp, #8] | ||
cmp w8, #0 | ||
csel w9, wzr, w9, lt | ||
mov w11, #-8388608 | ||
asr w10, w11, w10 | ||
add w8, w9, w8 | ||
and w8, w8, w10 | ||
fmov s0, w8 | ||
b LBB18_5 | ||
LBB18_4: | ||
mov w9, #2071986176 | ||
fmov s1, w9 | ||
fadd s1, s0, s1 | ||
str s1, [sp, #12] | ||
ldr s1, [sp, #12] | ||
movi.2s v1, #128, lsl #24 | ||
cmp w8, #0 | ||
fmov s2, #1.00000000 | ||
fcsel s0, s0, s2, eq | ||
tst w8, #0x80000000 | ||
fcsel s0, s0, s1, eq | ||
LBB18_5: | ||
add sp, sp, #16 | ||
.cfi_def_cfa_offset 0 | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/// Ceil (f128) | ||
/// | ||
/// Finds the nearest integer greater than or equal to `x`. | ||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)] | ||
pub fn ceilf128(x: f128) -> f128 { | ||
super::generic::ceil(x) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/// Ceil (f16) | ||
/// | ||
/// Finds the nearest integer greater than or equal to `x`. | ||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)] | ||
pub fn ceilf16(x: f16) -> f16 { | ||
super::generic::ceil(x) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.