<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58531>58531</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [mlir][aarch64] Test failure: correctness.mlir
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          banach-space
      </td>
    </tr>
</table>

<pre>
    Hello 👋🏻 !

I'm looking into MLIR [integration tests](https://github.com/llvm/llvm-project/tree/main/mlir/test/Integration/Dialect/Complex) and I've noticed that [correctness.mlir](https://github.com/llvm/llvm-project/blob/main/mlir/test/Integration/Dialect/Complex/CPU/correctness.mlir) is failing on AArch64. On closer inspection, I see that that test:
*  runs some FP calculations, and then
* verifies the generated FP output matches the expected output. 

I see the following discrepancies when running these tests on AArch64:

**MISMATCH 1**
EXPECTED: `nan`
GENERATED: `-nan`

**MISMATCH 2**
EXPECTED: `0`
GENERATED: `5.96046e-08`

I'm a bit more worried about the 2nd case, but haven't had the bandwidth to dive deeper. I'm not sure about the 1st mismatch. 

**Next step**
I propose that for now we `XFAL` this test on AArch64. I don't have the spare cycles to investigate this further at the moment, but am happy to support volunteers :)

**On FP integrations tests in LLVM in general**
One other thing that's worth pointing out is that such integration tests would normally reside [llvm-test-suite](https://github.com/llvm/llvm-test-suite). In particular, FP tests would use [fpcmp](https://github.com/llvm/llvm-test-suite/blob/release/15.x/tools/fpcmp.c) for comparing FP results so that relative and absolute tolerances can be taken into account. Perhaps I should bring this up on Discourse 🤔 .

Thanks for taking a look!
-Andrzej

CC @pifon2a @bixia1 @Lewuathe 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydVd9v4jgQ_mvCy4goPyDAAw8Uyi1Su1vt9U776jgT4l1jR7YD7f31N5PAQbd3J22lKI4znvE333wel7Z6XX5CrS1E2yRabKNFGs3vzt_zbX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