Files
TheRock/compiler/amd-llvm/amd/device-libs/test/compile/lgamma_r.cl
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

104 lines
4.2 KiB
Common Lisp

// Verify lgamma_r function constant folds to correct values.
// Run with filecheck from test cmake
__attribute__((always_inline))
static float test_lgamma_r(float val, volatile global int* sign_out) {
int tmp;
float result = lgamma_r(val, &tmp);
*sign_out = tmp;
return result;
}
// CHECK-LABEL: {{^}}constant_fold_lgamma_r_f32:
// CONSTANTFOLD-LABEL: @constant_fold_lgamma_r_f32(
kernel void constant_fold_lgamma_r_f32(volatile global float* out,
volatile global int* sign_out) {
// CONSTANTFOLD: store volatile i32 0,
// CONSTANTFOLD-NEXT: store volatile float 0x7FF0000000000000
out[0] = test_lgamma_r(0.0f, sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 0,
// CONSTANTFOLD-NEXT: store volatile float 0x7FF0000000000000
out[0] = test_lgamma_r(-0.0f, sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 0,
// CONSTANTFOLD-NEXT: store volatile float 0x7FF8000000000000,
out[0] = test_lgamma_r(__builtin_nanf(""), sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 0,
// CONSTANTFOLD-NEXT: store volatile float 0x7FF4000000000000,
out[0] = test_lgamma_r(__builtin_nansf(""), sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 1,
// CONSTANTFOLD-NEXT: store volatile float 0x7FF0000000000000,
out[0] = test_lgamma_r(__builtin_inff(), sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 0,
// CONSTANTFOLD-NEXT: store volatile float 0x7FF0000000000000,
out[0] = test_lgamma_r(-__builtin_inff(), sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 1,
// CONSTANTFOLD-NEXT: store volatile float 0x419DE28020000000,
out[0] = test_lgamma_r(0x1.0p+23f, sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 0,
// CONSTANTFOLD-NEXT: store volatile float 0x7FF0000000000000,
out[0] = test_lgamma_r(-0x1.0p+23f, sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 1,
// CONSTANTFOLD-NEXT: store volatile float 0.000000e+00,
out[0] = test_lgamma_r(1.0f, sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 1,
// CONSTANTFOLD-NEXT: store volatile float 0.000000e+00,
out[0] = test_lgamma_r(2.0f, sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 1,
// CONSTANTFOLD-NEXT: store volatile float 0x3FE62E4300000000,
out[0] = test_lgamma_r(3.0f, sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 1,
// CONSTANTFOLD-NEXT: store volatile float 0x3FE250D040000000,
out[0] = test_lgamma_r(0.5f, sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 1,
// CONSTANTFOLD-NEXT: store volatile float 0x405601E680000000,
out[0] = test_lgamma_r(0x1.0p-127f, sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 1,
// CONSTANTFOLD-NEXT: store volatile float 0x419DE28060000000,
out[0] = test_lgamma_r(nextafter(0x1.0p+23f, __builtin_inff()), sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 1,
// CONSTANTFOLD-NEXT: store volatile float 0x419DE28000000000,
out[0] = test_lgamma_r(nextafter(0x1.0p+23f, -__builtin_inff()), sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 1,
// CONSTANTFOLD-NEXT: store volatile float 0xC19DE28040000000,
out[0] = test_lgamma_r(nextafter(-0x1.0p+23f, __builtin_inff()), sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 0,
// CONSTANTFOLD-NEXT: store volatile float 0x7FF0000000000000,
out[0] = test_lgamma_r(nextafter(-0x1.0p+23f, -__builtin_inff()), sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 0,
// CONSTANTFOLD-NEXT: store volatile float 0x7FF0000000000000,
out[0] = test_lgamma_r(-1.0f, sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 0,
// CONSTANTFOLD-NEXT: store volatile float 0x7FF0000000000000,
out[0] = test_lgamma_r(-2.0f, sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 0,
// CONSTANTFOLD-NEXT: store volatile float 0x7FF0000000000000,
out[0] = test_lgamma_r(-3.0f, sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 1,
// CONSTANTFOLD-NEXT: store volatile float 0xBFF4F1B100000000,
out[0] = test_lgamma_r(-3.5f, sign_out);
// CONSTANTFOLD-NEXT: store volatile i32 1,
// CONSTANTFOLD-NEXT: store volatile float 0xC19DE28040000000,
out[0] = test_lgamma_r(as_float(0xcaffffff), sign_out);
}