microsoft / microsoft/STL

<cmath>: Use ceil/floor/round/etc. intrinsics

Open
#1,234 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

performance
Dominant language
C++
Stars
11.1k
Forks
1.7k
Avg merge
4d 15h
Merged PRs (30d)
22

Description

In VS 2019 16.8 Preview 3, the following intrinsics will be available (MS-internal MSVC-PR-265316):

double __ceil(double);
float __ceilf(float);
double __floor(double);
float __floorf(float);
double __round(double);
float __roundf(float);
double __trunc(double);
float __truncf(float);
double __copysign(double, double);
float __copysignf(float, float);
unsigned int __signbitvalue(double);
unsigned int __signbitvaluef(float);

These are available for all architectures, declared in <intrin0.h>. We should take advantage of them. (We may need to report this to the UCRT too.)

Also tracked by DevCom-987080 (MS-internal VSO-1101527 / AB#1101527) and DevCom-1038270 (MS-internal VSO-1129605 / AB#1129605).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the implementation and the intrinsic declarations in <intrin0.h>, then trace how the listed rounding, sign, and sign-bit operations are currently handled. Check support across all architectures and determine whether the corresponding UCRT work also needs reporting. Done means the relevant operations use the available intrinsics and the associated behavior is validated.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.