annotate clang/test/CodeGenOpenCL/printf.cl @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -cl-std=CL1.2 -cl-ext=-+cl_khr_fp64 -triple spir-unknown-unknown -disable-llvm-passes -emit-llvm -o - %s | FileCheck -check-prefixes=FP64,ALL %s
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 -cl-std=CL1.2 -cl-ext=-cl_khr_fp64 -triple spir-unknown-unknown -disable-llvm-passes -emit-llvm -o - %s | FileCheck -check-prefixes=NOFP64,ALL %s
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
3 // RUN: %clang_cc1 -cl-std=CL3.0 -cl-ext=+__opencl_c_fp64,+cl_khr_fp64 -triple spir-unknown-unknown -disable-llvm-passes -emit-llvm -o - %s | FileCheck -check-prefixes=FP64,ALL %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
4 // RUN: %clang_cc1 -cl-std=CL3.0 -cl-ext=-__opencl_c_fp64,-cl_khr_fp64 -triple spir-unknown-unknown -disable-llvm-passes -emit-llvm -o - %s | FileCheck -check-prefixes=NOFP64,ALL %s
150
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 typedef __attribute__((ext_vector_type(2))) float float2;
anatofuz
parents:
diff changeset
7 typedef __attribute__((ext_vector_type(2))) half half2;
anatofuz
parents:
diff changeset
8
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
9 #if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
150
anatofuz
parents:
diff changeset
10 typedef __attribute__((ext_vector_type(2))) double double2;
anatofuz
parents:
diff changeset
11 #endif
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 int printf(__constant const char* st, ...) __attribute__((format(printf, 1, 2)));
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 // ALL-LABEL: @test_printf_float2(
anatofuz
parents:
diff changeset
17 // FP64: %call = call spir_func i32 (i8 addrspace(2)*, ...) @printf(i8 addrspace(2)* getelementptr inbounds ([7 x i8], [7 x i8] addrspace(2)* @.str, i32 0, i32 0), <2 x float> %0)
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 // NOFP64: call spir_func i32 (i8 addrspace(2)*, ...) @printf(i8 addrspace(2)* getelementptr inbounds ([7 x i8], [7 x i8] addrspace(2)* @.str, i32 0, i32 0), <2 x float> %0)
anatofuz
parents:
diff changeset
21 kernel void test_printf_float2(float2 arg) {
anatofuz
parents:
diff changeset
22 printf("%v2hlf", arg);
anatofuz
parents:
diff changeset
23 }
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 // ALL-LABEL: @test_printf_half2(
anatofuz
parents:
diff changeset
26 // FP64: %call = call spir_func i32 (i8 addrspace(2)*, ...) @printf(i8 addrspace(2)* getelementptr inbounds ([6 x i8], [6 x i8] addrspace(2)* @.str.1, i32 0, i32 0), <2 x half> %0)
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 // NOFP64: %call = call spir_func i32 (i8 addrspace(2)*, ...) @printf(i8 addrspace(2)* getelementptr inbounds ([6 x i8], [6 x i8] addrspace(2)* @.str.1, i32 0, i32 0), <2 x half> %0)
anatofuz
parents:
diff changeset
29 kernel void test_printf_half2(half2 arg) {
anatofuz
parents:
diff changeset
30 printf("%v2hf", arg);
anatofuz
parents:
diff changeset
31 }
anatofuz
parents:
diff changeset
32
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
33 #if defined(cl_khr_fp64) || defined(__opencl_c_fp64)
150
anatofuz
parents:
diff changeset
34 // FP64-LABEL: @test_printf_double2(
anatofuz
parents:
diff changeset
35 // FP64: call spir_func i32 (i8 addrspace(2)*, ...) @printf(i8 addrspace(2)* getelementptr inbounds ([6 x i8], [6 x i8] addrspace(2)* @.str.2, i32 0, i32 0), <2 x double> %0)
anatofuz
parents:
diff changeset
36 kernel void test_printf_double2(double2 arg) {
anatofuz
parents:
diff changeset
37 printf("%v2lf", arg);
anatofuz
parents:
diff changeset
38 }
anatofuz
parents:
diff changeset
39 #endif