1 // RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
2 // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s
4 int shl32(int V, int S) {
8 // CHECK-LABEL: define noundef i32 @_Z5shl32ii(i32 noundef %V, i32 noundef %S) #0 {
9 // CHECK-DAG: %[[Masked:.*]] = and i32 %{{.*}}, 31
10 // CHECK-DAG: %{{.*}} = shl i32 %{{.*}}, %[[Masked]]
12 int shr32(int V, int S) {
16 // CHECK-LABEL: define noundef i32 @_Z5shr32ii(i32 noundef %V, i32 noundef %S) #0 {
17 // CHECK-DAG: %[[Masked:.*]] = and i32 %{{.*}}, 31
18 // CHECK-DAG: %{{.*}} = ashr i32 %{{.*}}, %[[Masked]]
20 int64_t shl64(int64_t V, int64_t S) {
24 // CHECK-LABEL: define noundef i64 @_Z5shl64ll(i64 noundef %V, i64 noundef %S) #0 {
25 // CHECK-DAG: %[[Masked:.*]] = and i64 %{{.*}}, 63
26 // CHECK-DAG: %{{.*}} = shl i64 %{{.*}}, %[[Masked]]
28 int64_t shr64(int64_t V, int64_t S) {
32 // CHECK-LABEL: define noundef i64 @_Z5shr64ll(i64 noundef %V, i64 noundef %S) #0 {
33 // CHECK-DAG: %[[Masked:.*]] = and i64 %{{.*}}, 63
34 // CHECK-DAG: %{{.*}} = ashr i64 %{{.*}}, %[[Masked]]
36 uint shlu32(uint V, uint S) {
40 // CHECK-LABEL: define noundef i32 @_Z6shlu32jj(i32 noundef %V, i32 noundef %S) #0 {
41 // CHECK-DAG: %[[Masked:.*]] = and i32 %{{.*}}, 31
42 // CHECK-DAG: %{{.*}} = shl i32 %{{.*}}, %[[Masked]]
44 uint shru32(uint V, uint S) {
48 // CHECK-LABEL: define noundef i32 @_Z6shru32jj(i32 noundef %V, i32 noundef %S) #0 {
49 // CHECK-DAG: %[[Masked:.*]] = and i32 %{{.*}}, 31
50 // CHECK-DAG: %{{.*}} = lshr i32 %{{.*}}, %[[Masked]]
52 uint64_t shlu64(uint64_t V, uint64_t S) {
56 // CHECK-LABEL: define noundef i64 @_Z6shlu64mm(i64 noundef %V, i64 noundef %S) #0 {
57 // CHECK-DAG: %[[Masked:.*]] = and i64 %{{.*}}, 63
58 // CHECK-DAG: %{{.*}} = shl i64 %{{.*}}, %[[Masked]]
60 uint64_t shru64(uint64_t V, uint64_t S) {
64 // CHECK-LABEL: define noundef i64 @_Z6shru64mm(i64 noundef %V, i64 noundef %S) #0 {
65 // CHECK-DAG: %[[Masked:.*]] = and i64 %{{.*}}, 63
66 // CHECK-DAG: %{{.*}} = lshr i64 %{{.*}}, %[[Masked]]