Skip to content

Test unboxed numerics (part of unboxed-types version 2)#71

Closed
goldfirere wants to merge 18 commits intomainfrom
rae/ubt-v2-tests
Closed

Test unboxed numerics (part of unboxed-types version 2)#71
goldfirere wants to merge 18 commits intomainfrom
rae/ubt-v2-tests

Conversation

@goldfirere
Copy link
Copy Markdown
Contributor

@lpw25 and I thought it might be good to write tests to accurately define the expected functionality of upcoming releases of unboxed types. There doesn't seem to be a good reason not to just check this into the repo now, but I'm happy to consider other ways of doing this.

@goldfirere
Copy link
Copy Markdown
Contributor Author

Chatted about this with @ceastlund, who may enjoy taking a look.

@goldfirere goldfirere requested review from antalsz and mshinwell March 16, 2023 13:50
Copy link
Copy Markdown
Contributor

@antalsz antalsz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This basically looks good to me! A few comments made inline

(Int64.add (Uint64.to_int64 x) (Uint64.to_int64 y)) in
Uint64.of_int64 (Int64.mul (Uint64.to_int64 i) (Uint64.to_int64 i))

let[@inline never] g i : #int64 -> #int64 =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why [@inline never]?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

goldfirere and others added 10 commits March 24, 2023 14:03
Co-authored-by: Antal Spector-Zabusky <antal.b.sz@gmail.com>
Co-authored-by: Antal Spector-Zabusky <antal.b.sz@gmail.com>
Co-authored-by: Antal Spector-Zabusky <antal.b.sz@gmail.com>
Co-authored-by: Antal Spector-Zabusky <antal.b.sz@gmail.com>
Co-authored-by: Antal Spector-Zabusky <antal.b.sz@gmail.com>
Co-authored-by: Antal Spector-Zabusky <antal.b.sz@gmail.com>
Co-authored-by: Antal Spector-Zabusky <antal.b.sz@gmail.com>
Co-authored-by: Antal Spector-Zabusky <antal.b.sz@gmail.com>
Co-authored-by: Antal Spector-Zabusky <antal.b.sz@gmail.com>
|}]

let f (x : #int64) =
let () = Sys.opaque_identity () in
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, not fully sure. These got contributed by @mshinwell.

(Int64.add (Uint64.to_int64 x) (Uint64.to_int64 y)) in
Uint64.of_int64 (Int64.mul (Uint64.to_int64 i) (Uint64.to_int64 i))

let[@inline never] g i : #int64 -> #int64 =
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@goldfirere
Copy link
Copy Markdown
Contributor Author

These tests appear to be well represented in the current flambda-backend. Closing

@goldfirere goldfirere closed this Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants