67 lines · plain
1// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \2// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s3 4int shl32(int V, int S) {5 return V << S;6}7 8// CHECK-LABEL: define hidden noundef i32 @_Z5shl32ii(i32 noundef %V, i32 noundef %S) #0 {9// CHECK-DAG: %[[Masked:.*]] = and i32 %{{.*}}, 3110// CHECK-DAG: %{{.*}} = shl i32 %{{.*}}, %[[Masked]]11 12int shr32(int V, int S) {13 return V >> S;14}15 16// CHECK-LABEL: define hidden noundef i32 @_Z5shr32ii(i32 noundef %V, i32 noundef %S) #0 {17// CHECK-DAG: %[[Masked:.*]] = and i32 %{{.*}}, 3118// CHECK-DAG: %{{.*}} = ashr i32 %{{.*}}, %[[Masked]]19 20int64_t shl64(int64_t V, int64_t S) {21 return V << S;22}23 24// CHECK-LABEL: define hidden noundef i64 @_Z5shl64ll(i64 noundef %V, i64 noundef %S) #0 {25// CHECK-DAG: %[[Masked:.*]] = and i64 %{{.*}}, 6326// CHECK-DAG: %{{.*}} = shl i64 %{{.*}}, %[[Masked]]27 28int64_t shr64(int64_t V, int64_t S) {29 return V >> S;30}31 32// CHECK-LABEL: define hidden noundef i64 @_Z5shr64ll(i64 noundef %V, i64 noundef %S) #0 {33// CHECK-DAG: %[[Masked:.*]] = and i64 %{{.*}}, 6334// CHECK-DAG: %{{.*}} = ashr i64 %{{.*}}, %[[Masked]]35 36uint shlu32(uint V, uint S) {37 return V << S;38}39 40// CHECK-LABEL: define hidden noundef i32 @_Z6shlu32jj(i32 noundef %V, i32 noundef %S) #0 {41// CHECK-DAG: %[[Masked:.*]] = and i32 %{{.*}}, 3142// CHECK-DAG: %{{.*}} = shl i32 %{{.*}}, %[[Masked]]43 44uint shru32(uint V, uint S) {45 return V >> S;46}47 48// CHECK-LABEL: define hidden noundef i32 @_Z6shru32jj(i32 noundef %V, i32 noundef %S) #0 {49// CHECK-DAG: %[[Masked:.*]] = and i32 %{{.*}}, 3150// CHECK-DAG: %{{.*}} = lshr i32 %{{.*}}, %[[Masked]]51 52uint64_t shlu64(uint64_t V, uint64_t S) {53 return V << S;54}55 56// CHECK-LABEL: define hidden noundef i64 @_Z6shlu64mm(i64 noundef %V, i64 noundef %S) #0 {57// CHECK-DAG: %[[Masked:.*]] = and i64 %{{.*}}, 6358// CHECK-DAG: %{{.*}} = shl i64 %{{.*}}, %[[Masked]]59 60uint64_t shru64(uint64_t V, uint64_t S) {61 return V >> S;62}63 64// CHECK-LABEL: define hidden noundef i64 @_Z6shru64mm(i64 noundef %V, i64 noundef %S) #0 {65// CHECK-DAG: %[[Masked:.*]] = and i64 %{{.*}}, 6366// CHECK-DAG: %{{.*}} = lshr i64 %{{.*}}, %[[Masked]]67