CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
76 lines
1.8 KiB
C
76 lines
1.8 KiB
C
// RUN: %clang_builtins %s %librt -o %t && %run %t
|
|
// REQUIRES: librt_has_extendhfxf2
|
|
|
|
#include <limits.h>
|
|
#include <math.h> // for isnan, isinf
|
|
#include <stdio.h>
|
|
|
|
#include "fp_test.h"
|
|
|
|
#if HAS_80_BIT_LONG_DOUBLE
|
|
|
|
xf_float __extendhfxf2(TYPE_FP16 f);
|
|
|
|
int test_extendhfxf2(TYPE_FP16 a, uint16_t expectedHi, uint64_t expectedLo) {
|
|
xf_float x = __extendhfxf2(a);
|
|
int ret = compareResultF80(x, expectedHi, expectedLo);
|
|
if (ret) {
|
|
printf("error in test__extendhfxf2(%#.4x) = %.20Lf, "
|
|
"expected %.20Lf\n",
|
|
toRep16(a), x, F80FromRep80(expectedHi, expectedLo));
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
int main() {
|
|
// Small positive value
|
|
if (test_extendhfxf2(fromRep16(0x2e66), UINT16_C(0x3ffb),
|
|
UINT64_C(0xccc0000000000000)))
|
|
return 1;
|
|
|
|
// Small negative value
|
|
if (test_extendhfxf2(fromRep16(0xae66), UINT16_C(0xbffb),
|
|
UINT64_C(0xccc0000000000000)))
|
|
return 1;
|
|
|
|
// Zero
|
|
if (test_extendhfxf2(fromRep16(0), UINT16_C(0x0), UINT64_C(0x0)))
|
|
return 1;
|
|
|
|
// Smallest positive non-zero value
|
|
if (test_extendhfxf2(fromRep16(0x0100), UINT16_C(0x3fef),
|
|
UINT64_C(0x8000000000000000)))
|
|
return 1;
|
|
|
|
// Smallest negative non-zero value
|
|
if (test_extendhfxf2(fromRep16(0x8100), UINT16_C(0xbfef),
|
|
UINT64_C(0x8000000000000000)))
|
|
return 1;
|
|
|
|
// Positive infinity
|
|
if (test_extendhfxf2(makeInf16(), UINT16_C(0x7fff),
|
|
UINT64_C(0x8000000000000000)))
|
|
return 1;
|
|
|
|
// Negative infinity
|
|
if (test_extendhfxf2(makeNegativeInf16(), UINT16_C(0xffff),
|
|
UINT64_C(0x8000000000000000)))
|
|
return 1;
|
|
|
|
// NaN
|
|
if (test_extendhfxf2(makeQNaN16(), UINT16_C(0x7fff),
|
|
UINT64_C(0xc000000000000000)))
|
|
return 1;
|
|
|
|
return 0;
|
|
}
|
|
|
|
#else
|
|
|
|
int main() {
|
|
printf("skipped\n");
|
|
return 0;
|
|
}
|
|
|
|
#endif
|