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

58 lines
2.2 KiB
Common Lisp

// RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL1.2 -O1 -triple x86_64-unknown-linux-gnu | FileCheck %s
// RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=clc++ -O1 -triple x86_64-unknown-linux-gnu | FileCheck %s
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
typedef int int4 __attribute((ext_vector_type(4)));
typedef long long4 __attribute((ext_vector_type(4)));
typedef float float4 __attribute((ext_vector_type(4)));
typedef double double4 __attribute((ext_vector_type(4)));
// CHECK: floatops
kernel void floatops(global int4 *out, global float4 *fout) {
// CHECK: store <4 x i32> splat (i32 -1)
out[0] = (float4)(1, 1, 1, 1) && 1.0f;
// CHECK: store <4 x i32> zeroinitializer
out[1] = (float4)(0, 0, 0, 0) && (float4)(0, 0, 0, 0);
// CHECK: store <4 x i32> splat (i32 -1)
out[2] = (float4)(0, 0, 0, 0) || (float4)(1, 1, 1, 1);
// CHECK: store <4 x i32> zeroinitializer
out[3] = (float4)(0, 0, 0, 0) || 0.0f;
// CHECK: store <4 x i32> splat (i32 -1)
out[4] = !(float4)(0, 0, 0, 0);
// CHECK: store <4 x i32> zeroinitializer
out[5] = !(float4)(1, 2, 3, 4);
// CHECK: store <4 x i32> <i32 -1, i32 0, i32 -1, i32 0>
out[6] = !(float4)(0, 1, 0, 1);
// CHECK: store <4 x float> splat (float 1.000000e+00)
fout[0] = (float4)(!0.0f);
// CHECK: store <4 x float> zeroinitializer
fout[1] = (float4)(!1.0f);
}
// CHECK: doubleops
kernel void doubleops(global long4 *out, global double4 *dout) {
// CHECK: store <4 x i64> splat (i64 -1)
out[0] = (double4)(1, 1, 1, 1) && 1.0;
// CHECK: store <4 x i64> zeroinitializer
out[1] = (double4)(0, 0, 0, 0) && (double4)(0, 0, 0, 0);
// CHECK: store <4 x i64> splat (i64 -1)
out[2] = (double4)(0, 0, 0, 0) || (double4)(1, 1, 1, 1);
// CHECK: store <4 x i64> zeroinitializer
out[3] = (double4)(0, 0, 0, 0) || 0.0f;
// CHECK: store <4 x i64> splat (i64 -1)
out[4] = !(double4)(0, 0, 0, 0);
// CHECK: store <4 x i64> zeroinitializer
out[5] = !(double4)(1, 2, 3, 4);
// CHECK: store <4 x i64> <i64 -1, i64 0, i64 -1, i64 0>
out[6] = !(double4)(0, 1, 0, 1);
// CHECK: store <4 x double> splat (double 1.000000e+00)
dout[0] = (double4)(!0.0f);
// CHECK: store <4 x double> zeroinitializer
dout[1] = (double4)(!1.0f);
}