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

math.pow test failure with an exponent of -25, only on MacOS ARM #3162

Closed
laytan opened this issue Feb 2, 2024 · 1 comment
Closed

math.pow test failure with an exponent of -25, only on MacOS ARM #3162

laytan opened this issue Feb 2, 2024 · 1 comment

Comments

@laytan
Copy link
Collaborator

laytan commented Feb 2, 2024

$ odin test tests/internal/test_pow.odin -file
[Package: test_internal_math_pow]
[Test: pow_test]
/Users/laytan/third-party/Odin/tests/internal/test_pow.odin(36:4): Expected math.pow2_f16(-25) == math.pow(2, -25) (= 0000), got 0001
[pow_test : FAILURE]
----------------------------------------
0/1 SUCCESSFUL

Useful information to add to a bug report:

Odin: dev-2024-02:01640f54e
OS:   macOS Sonoma 14.2.1 (build: 23D56, kernel: 23.2.0)
CPU:  ARM64
RAM:  8192 MiB
@laytan
Copy link
Collaborator Author

laytan commented Feb 3, 2024

This seems like the llvm intrinsic under math.pow which is llvm.pow.f16 is wrong.

It does not make sense to have a different result across architecture, x86 llvm.pow.f16 is returning 0h0001, and arm llvm.pow.f16 is returning 0h0000.

We are consistently returning 0h0001.

I believe there are plans to write our own pow implementation that would resolve this, for now we are skipping this test case (#3163).

Closing because this is an LLVM issue.

@laytan laytan closed this as completed Feb 3, 2024
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

No branches or pull requests

1 participant