Files
TheRock/compiler/amd-llvm/clang/test/CodeGenOpenCL/builtins-f16.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

102 lines
2.8 KiB
Common Lisp

// RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-darwin-apple %s | FileCheck %s
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
// CHECK-LABEL: define{{.*}} void @test_half_builtins
void test_half_builtins(half h0, half h1, half h2, int i0) {
volatile half res;
// CHECK: call half @llvm.acos.f16(half %h0)
res = __builtin_acosf16(h0);
// CHECK: call half @llvm.asin.f16(half %h0)
res = __builtin_asinf16(h0);
// CHECK: call half @llvm.atan.f16(half %h0)
res = __builtin_atanf16(h0);
// CHECK: call half @llvm.atan2.f16(half %h0, half %h1)
res = __builtin_atan2f16(h0, h1);
// CHECK: call half @llvm.copysign.f16(half %h0, half %h1)
res = __builtin_copysignf16(h0, h1);
// CHECK: call half @llvm.fabs.f16(half %h0)
res = __builtin_fabsf16(h0);
// CHECK: call half @llvm.ceil.f16(half %h0)
res = __builtin_ceilf16(h0);
// CHECK: call half @llvm.cos.f16(half %h0)
res = __builtin_cosf16(h0);
// CHECK: call half @llvm.cosh.f16(half %h0)
res = __builtin_coshf16(h0);
// CHECK: call half @llvm.exp.f16(half %h0)
res = __builtin_expf16(h0);
// CHECK: call half @llvm.exp2.f16(half %h0)
res = __builtin_exp2f16(h0);
// CHECK: call half @llvm.exp10.f16(half %h0)
res = __builtin_exp10f16(h0);
// CHECK: call half @llvm.floor.f16(half %h0)
res = __builtin_floorf16(h0);
// CHECK: call half @llvm.fma.f16(half %h0, half %h1, half %h2)
res = __builtin_fmaf16(h0, h1 ,h2);
// CHECK: call nsz half @llvm.maxnum.f16(half %h0, half %h1)
res = __builtin_fmaxf16(h0, h1);
// CHECK: call nsz half @llvm.minnum.f16(half %h0, half %h1)
res = __builtin_fminf16(h0, h1);
// CHECK: frem half %h0, %h1
res = __builtin_fmodf16(h0, h1);
// CHECK: call half @llvm.pow.f16(half %h0, half %h1)
res = __builtin_powf16(h0, h1);
// CHECK: call half @llvm.log10.f16(half %h0)
res = __builtin_log10f16(h0);
// CHECK: call half @llvm.log2.f16(half %h0)
res = __builtin_log2f16(h0);
// CHECK: call half @llvm.log.f16(half %h0)
res = __builtin_logf16(h0);
// CHECK: call half @llvm.rint.f16(half %h0)
res = __builtin_rintf16(h0);
// CHECK: call half @llvm.round.f16(half %h0)
res = __builtin_roundf16(h0);
// CHECK: call half @llvm.sin.f16(half %h0)
res = __builtin_sinf16(h0);
// CHECK: call half @llvm.sinh.f16(half %h0)
res = __builtin_sinhf16(h0);
// CHECK: call half @llvm.sqrt.f16(half %h0)
res = __builtin_sqrtf16(h0);
// CHECK: call half @llvm.tan.f16(half %h0)
res = __builtin_tanf16(h0);
// CHECK: call half @llvm.tanh.f16(half %h0)
res = __builtin_tanhf16(h0);
// CHECK: call half @llvm.trunc.f16(half %h0)
res = __builtin_truncf16(h0);
// CHECK: call half @llvm.canonicalize.f16(half %h0)
res = __builtin_canonicalizef16(h0);
// CHECK: call half @llvm.ldexp.f16.i32(half %h0, i32 %i0)
res = __builtin_ldexpf16(h0, i0);
}