Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<ranges>: _(Add|Mul)_overflow could be much faster #3618

Open
JMazurkiewicz opened this issue Apr 3, 2023 · 0 comments
Open

<ranges>: _(Add|Mul)_overflow could be much faster #3618

JMazurkiewicz opened this issue Apr 3, 2023 · 0 comments
Labels
performance Must go faster

Comments

@JMazurkiewicz
Copy link
Contributor

JMazurkiewicz commented Apr 3, 2023

New functions (added by #3561) _Add_overflow<Int> and _Multiply_overflow<Int> could be much faster when Int is:

  1. Standard integer type. MSVC should consider implementing Clang's checked arithmetic builtins (__builtin_add_overflow and __builtin_mul_overflow). This would vastly improve performance and codegen.

    Also tracked by DevCom-10326281.

  2. Integer-class type. I believe that it is possible to implement those checked operations directly in _Signed128 and _Unsigned128, for example by modifying already existing functions (overflow could be detected during addition/multiplication?).

    This requires further investigation.

@JMazurkiewicz JMazurkiewicz changed the title _(Add|Multiply)_with_overflow_check can be much faster <ranges>: _(Add|Multiply)_with_overflow_check could be much faster Apr 3, 2023
@StephanTLavavej StephanTLavavej added the performance Must go faster label Apr 3, 2023
@JMazurkiewicz JMazurkiewicz changed the title <ranges>: _(Add|Multiply)_with_overflow_check could be much faster <ranges>: _(Add|Mul)_overflow could be much faster May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster
Projects
None yet
Development

No branches or pull requests

2 participants