|
| 1 | +// REQUIRES: amdgpu-registered-target |
| 2 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 3 | +// RUN: -target-cpu gfx1100 -emit-cir %s -o %t.cir |
| 4 | +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 5 | + |
| 6 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 7 | +// RUN: -target-cpu gfx1101 -emit-cir %s -o %t.cir |
| 8 | +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 9 | + |
| 10 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 11 | +// RUN: -target-cpu gfx1102 -emit-cir %s -o %t.cir |
| 12 | +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 13 | + |
| 14 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 15 | +// RUN: -target-cpu gfx1103 -emit-cir %s -o %t.cir |
| 16 | +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 17 | + |
| 18 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 19 | +// RUN: -target-cpu gfx1150 -emit-cir %s -o %t.cir |
| 20 | +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 21 | + |
| 22 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 23 | +// RUN: -target-cpu gfx1151 -emit-cir %s -o %t.cir |
| 24 | +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 25 | + |
| 26 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 27 | +// RUN: -target-cpu gfx1152 -emit-cir %s -o %t.cir |
| 28 | +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 29 | + |
| 30 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 31 | +// RUN: -target-cpu gfx1153 -emit-cir %s -o %t.cir |
| 32 | +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 33 | + |
| 34 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 35 | +// RUN: -target-cpu gfx1100 -emit-llvm %s -o %t.ll |
| 36 | +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s |
| 37 | + |
| 38 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 39 | +// RUN: -target-cpu gfx1101 -emit-llvm %s -o %t.ll |
| 40 | +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s |
| 41 | + |
| 42 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 43 | +// RUN: -target-cpu gfx1102 -emit-llvm %s -o %t.ll |
| 44 | +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s |
| 45 | + |
| 46 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 47 | +// RUN: -target-cpu gfx1103 -emit-llvm %s -o %t.ll |
| 48 | +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s |
| 49 | + |
| 50 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 51 | +// RUN: -target-cpu gfx1150 -emit-llvm %s -o %t.ll |
| 52 | +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s |
| 53 | + |
| 54 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 55 | +// RUN: -target-cpu gfx1151 -emit-llvm %s -o %t.ll |
| 56 | +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s |
| 57 | + |
| 58 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 59 | +// RUN: -target-cpu gfx1152 -emit-llvm %s -o %t.ll |
| 60 | +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s |
| 61 | + |
| 62 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 -fclangir \ |
| 63 | +// RUN: -target-cpu gfx1153 -emit-llvm %s -o %t.ll |
| 64 | +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s |
| 65 | + |
| 66 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 \ |
| 67 | +// RUN: -target-cpu gfx1100 -emit-llvm %s -o %t.ll |
| 68 | +// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s |
| 69 | + |
| 70 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 \ |
| 71 | +// RUN: -target-cpu gfx1101 -emit-llvm %s -o %t.ll |
| 72 | +// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s |
| 73 | + |
| 74 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 \ |
| 75 | +// RUN: -target-cpu gfx1102 -emit-llvm %s -o %t.ll |
| 76 | +// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s |
| 77 | + |
| 78 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 \ |
| 79 | +// RUN: -target-cpu gfx1103 -emit-llvm %s -o %t.ll |
| 80 | +// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s |
| 81 | + |
| 82 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 \ |
| 83 | +// RUN: -target-cpu gfx1150 -emit-llvm %s -o %t.ll |
| 84 | +// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s |
| 85 | + |
| 86 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 \ |
| 87 | +// RUN: -target-cpu gfx1151 -emit-llvm %s -o %t.ll |
| 88 | +// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s |
| 89 | + |
| 90 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 \ |
| 91 | +// RUN: -target-cpu gfx1152 -emit-llvm %s -o %t.ll |
| 92 | +// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s |
| 93 | + |
| 94 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -cl-std=CL2.0 \ |
| 95 | +// RUN: -target-cpu gfx1153 -emit-llvm %s -o %t.ll |
| 96 | +// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s |
| 97 | + |
| 98 | +//===----------------------------------------------------------------------===// |
| 99 | +// Test AMDGPU builtins |
| 100 | +//===----------------------------------------------------------------------===// |
| 101 | + |
| 102 | +#pragma OPENCL EXTENSION cl_khr_fp16 : enable |
| 103 | + |
| 104 | +typedef unsigned int uint; |
| 105 | +typedef unsigned long ulong; |
| 106 | + |
| 107 | +// CIR-LABEL: @test_permlanex16 |
| 108 | +// CIR: cir.llvm.intrinsic "amdgcn.permlanex16" {{.*}} : (!u32i, !u32i, !u32i, !u32i, !cir.bool, !cir.bool) -> !u32i |
| 109 | +// LLVM: define{{.*}} void @test_permlanex16 |
| 110 | +// LLVM: call i32 @llvm.amdgcn.permlanex16.i32(i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 false, i1 false) |
| 111 | +// OGCG: define{{.*}} void @test_permlanex16 |
| 112 | +// OGCG: call i32 @llvm.amdgcn.permlanex16.i32(i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 false, i1 false) |
| 113 | +void test_permlanex16(global uint* out, uint a, uint b, uint c, uint d) { |
| 114 | + *out = __builtin_amdgcn_permlanex16(a, b, c, d, 0, 0); |
| 115 | +} |
0 commit comments