core/llvm_intrinsic: use llvm.rint for rounding #447

Merged
sb10q merged 1 commits from issue-396 into master 2024-07-07 14:24:33 +08:00
Collaborator

rint is supported by glibc, musl libc, and RUST libm (279e5f6abe/src/math/mod.rs (L173)).
The functionality provided is same as np.rint i.e. rounding to the nearest even integer.

`rint` is supported by `glibc`, `musl libc`, and RUST `libm` (https://github.com/rust-lang/libm/blob/279e5f6abe0a2ca9066962d9ec894f0df1f417ac/src/math/mod.rs#L173). The functionality provided is same as `np.rint` i.e. rounding to the nearest even integer.
Owner
  1. The function should be renamed call_float_rint if it calls rint. Please also check for any similar discrepancies that may have crept up elsewhere.
  2. How do we set and enforce the rounding mode?
  3. All those functions have a lot of copy-pasted code. Please prepare another PR that cleans this up, e.g. using macros.
1. The function should be renamed call_float_rint if it calls rint. Please also check for any similar discrepancies that may have crept up elsewhere. 2. How do we set and enforce the rounding mode? 3. All those functions have a lot of copy-pasted code. Please prepare another PR that cleans this up, e.g. using macros.
abdul124 force-pushed issue-396 from d6f3403927 to 3e4a096e82 2024-07-05 15:13:07 +08:00 Compare
sb10q merged commit f062ef5f59 into master 2024-07-07 14:24:28 +08:00
sb10q deleted branch issue-396 2024-07-07 14:24:52 +08:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#447
No description provided.