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

[SE-0425] Int128 and UInt128 APIs have different attributes #74481

Closed
benrimmington opened this issue Jun 17, 2024 · 2 comments · Fixed by #74523
Closed

[SE-0425] Int128 and UInt128 APIs have different attributes #74481

benrimmington opened this issue Jun 17, 2024 · 2 comments · Fixed by #74523
Assignees
Labels
attributes Feature: Declaration and type attributes numerics Area → standard library: Numeric API standard library Area: Standard library umbrella task

Comments

@benrimmington
Copy link
Contributor

For the following APIs:

  • Int128 uses either @_transparent, or @inline(__always), or no attribute.

  • UInt128 uses @inlinable only.

APIs Int128 UInt128
zero, min, max @_transparent @inlinable
init(_builtinIntegerLiteral:) @_transparent @inlinable
addingReportingOverflow(_:) @_transparent @inlinable
subtractingReportingOverflow(_:) @_transparent @inlinable
multipliedReportingOverflow(by:) @inline(__always) @inlinable
dividedReportingOverflow(by:) @inline(__always) @inlinable
remainderReportingOverflow(dividingBy:) @inline(__always) @inlinable
*, /, % @inlinable
&=, |=, ^=, &>>=, &<<= @inlinable
trailingZeroBitCount @inlinable
bitWidth @_transparent @inlinable
nonzeroBitCount @inlinable
leadingZeroBitCount @inlinable
byteSwapped @inlinable

Should the attributes be the same, when the APIs have the same implementations?

(main and release/6.0 branches.)

@benrimmington benrimmington added the numerics Area → standard library: Numeric API label Jun 17, 2024
@benrimmington
Copy link
Contributor Author

@Azoy and @lorentey

@Azoy
Copy link
Contributor

Azoy commented Jun 18, 2024

I put up a PR to hopefully address this. I think all of these should just be @_transparent like their sister integer types are doing.

@AnthonyLatsis AnthonyLatsis added standard library Area: Standard library umbrella task attributes Feature: Declaration and type attributes labels Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attributes Feature: Declaration and type attributes numerics Area → standard library: Numeric API standard library Area: Standard library umbrella task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants