Skip to content

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

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions