[compiler-rt] Fix extendhfxf2 test (PR #117665)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 25 22:27:22 PST 2024


================
@@ -5,59 +5,55 @@
 #include <math.h> // for isnan, isinf
 #include <stdio.h>
 
-#include "int_lib.h"
+#include "fp_test.h"
 
 #if HAS_80_BIT_LONG_DOUBLE && defined(COMPILER_RT_HAS_FLOAT16)
 
-long double __extendhfxf2(_Float16 f);
+xf_float __extendhfxf2(TYPE_FP16 f);
 
-int test_extendhfxf2(_Float16 a, long double expected) {
-  long double x = __extendhfxf2(a);
-  __uint16_t *b = (void *)&a;
-  int ret = !((isnan(x) && isnan(expected)) || x == expected);
+int test_extendhfxf2(TYPE_FP16 a, xf_float expected) {
+  xf_float x = __extendhfxf2(a);
+  uint16_t a_rep = toRep16(a);
+  int ret = compareResultF80(x, expected);
----------------
arichardson wrote:

I.e. change the if in fp_test.h to just HAS_80_BIT_LONG_DOUBLE

https://github.com/llvm/llvm-project/pull/117665


More information about the llvm-commits mailing list