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

Float: Introduce floating point api infinite #522

Conversation

Incarnation-p-lee
Copy link
Contributor

  • Introduce new float api float_is_inf.
  • Add test case for half, single and double floating point.
  • Add inf to interface.

Signed-off-by: Pan Li [email protected]

* Remove the TODO workaround as fixed.

Signed-off-by: Pan Li <[email protected]>
* Introduce new float api float_is_inf.
* Add test case for half, single and double floating point.
* Add inf to interface.

Signed-off-by: Pan Li <[email protected]>
Copy link

github-actions bot commented May 6, 2024

Test Results

    9 files  ± 0     20 suites  ±0   0s ⏱️ ±0s
  625 tests + 4    625 ✅ + 4  0 💤 ±0  0 ❌ ±0 
2 006 runs  +13  2 005 ✅ +13  1 💤 ±0  0 ❌ ±0 

Results for commit 0b6571a. ± Comparison against base commit ba9f7f1.

♻️ This comment has been updated with latest results.

val float_is_inf : fp_bits -> bool
function float_is_inf (op) = {
let struct {_, exp, mantissa} = float_decompose(op);
let is_nan = exp == sail_ones(length(exp))
Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably be is_inf instead of is_nan

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, thanks and updated!

Signed-off-by: Pan Li <[email protected]>
$include <float/inf.sail>

function test_float_is_inf() -> unit = {
/* Half flating point */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo in the comments here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, let me update soon and file another PR for other test files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@Alasdair Alasdair merged commit 36eb33a into rems-project:sail2 May 14, 2024
3 checks passed
@Alasdair
Copy link
Collaborator

Sorry for taking a while with these, I've been rather busy the past week.

@Incarnation-p-lee Incarnation-p-lee deleted the panli/introduce-float-point-infinite branch May 15, 2024 01:09
@Incarnation-p-lee
Copy link
Contributor Author

Incarnation-p-lee commented May 15, 2024

Sorry for taking a while with these, I've been rather busy the past week.

Thanks. Never mind and take your time, ;)!

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.

3 participants