================
@@ -0,0 +1,60 @@
+// RUN: %clang_cc1 -ffreestanding -fms-extensions -triple 
x86_64-unknown-linux-gnu \
+// RUN:         -Oz -fclangir -emit-cir %s -o %t.cir
+// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR
+
+// RUN: %clang_cc1 -ffreestanding -fms-extensions -triple 
x86_64-unknown-linux-gnu \
+// RUN:         -Oz -fclangir -emit-llvm %s -o %t.ll
+// RUN: FileCheck --input-file=%t.ll %s -check-prefix=LLVM
+
+// RUN: %clang_cc1 -ffreestanding -fms-extensions -triple 
x86_64-unknown-linux-gnu \
+// RUN:         -Oz -emit-llvm %s -o %t.ll
+// RUN: FileCheck --input-file=%t.ll %s -check-prefix=OGCG
+
+unsigned __int64 __shiftleft128(unsigned __int64 low, unsigned __int64 high,
+                                unsigned char shift);
+unsigned __int64 __shiftright128(unsigned __int64 low, unsigned __int64 high,
+                                 unsigned char shift);
+
+// CIR-LABEL: cir.func{{.*}}@test_shiftleft128
+// CIR: (%[[L:[^,]+]]: !u64i{{.*}}, %[[H:[^,]+]]: !u64i{{.*}}, %[[D:[^,]+]]: 
!u8i{{.*}})
+// CIR: %[[D_LOAD:[^ ]+]] = cir.load {{.*}} %{{[^ ]+}} : !cir.ptr<!u8i>, !u8i
+// CIR: %[[D_CAST:[^ ]+]] = cir.cast integral %[[D_LOAD]] : !u8i -> !u64i
+// CIR: %{{[^ ]+}} = cir.call_llvm_intrinsic "fshl" {{.*}} : (!u64i, !u64i, 
!u64i) -> !u64i
+// CIR: cir.return
+
+// LLVM-LABEL: define dso_local i64 @test_shiftleft128(i64 %0, i64 %1, i8 %2)
+// LLVM-NEXT: [[TMP1:%.*]] = zext i8 %2 to i64
+// LLVM-NEXT: [[TMP2:%.*]] = tail call i64 @llvm.fshl.i64(i64 %1, i64 %0, i64 
[[TMP1]])
+// LLVM-NEXT: ret i64 [[TMP2]]
----------------
andykaylor wrote:

```suggestion
// LLVM-LABEL: define {{.*}} i64 @test_shiftleft128(i64 %[[ARG0:.*]], i64 
%[[ARG1:.*]], i8 %[[ARG2:.*]])
// LLVM-NEXT: [[TMP1:%.*]] = zext i8 %[[ARG2]] to i64
// LLVM-NEXT: [[TMP2:%.*]] = tail call i64 @llvm.fshl.i64(i64 %[[ARG1]], i64 
%[[ARG0]], i64 [[TMP1]])
```

https://github.com/llvm/llvm-project/pull/175049
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to