Correct qfloat16's 1/inf == 0 test
It should have been qfloat16(1)/qfloat16(infinity) in any case.
Sadly, that behaves no better than qfloat16(1.f/qfloat16(infinity)),
which was promoting the infinity back to float. So retain the check
for over-optimization (but make the comment more accurate).
This is a follow-up to d441f6bba7.
Change-Id: Iec4afe4b04081b0ebfbf98058da606dc3ade07f4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
parent
4df554c652
commit
c3571d2922
|
|
@ -172,9 +172,9 @@ void tst_qfloat16::qNan()
|
|||
QVERIFY(qIsInf(-inf));
|
||||
QVERIFY(qIsInf(2.f*inf));
|
||||
QVERIFY(qIsInf(inf*2.f));
|
||||
// QTBUG-75812: QEMU's over-optimized arm64 flakily fails 1/inf == 0 :-(
|
||||
// QTBUG-75812: QEMU/arm64 compiler over-optimizes, so flakily fails 1/inf == 0 :-(
|
||||
if (qfloat16(9.785e-4f) == qfloat16(9.794e-4f))
|
||||
QCOMPARE(qfloat16(1.f/inf), qfloat16(0.f));
|
||||
QCOMPARE(qfloat16(1.f) / inf, qfloat16(0.f));
|
||||
#ifdef Q_CC_INTEL
|
||||
QEXPECT_FAIL("", "ICC optimizes zero * anything to zero", Continue);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue