| 1 |
; RUN: not llc -O0 -mtriple=spirv64-unknown-unknown %s -o %t.spvt 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR |
| 2 |
|
| 3 |
; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_ALTERA_arbitrary_precision_integers %s -o - | FileCheck %s |
| 4 |
; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_ALTERA_arbitrary_precision_integers %s -o - -filetype=obj | spirv-val %} |
| 5 |
|
| 6 |
; CHECK-ERROR: LLVM ERROR: OpTypeInt type with a width other than 8, 16, 32 or 64 bits requires the following SPIR-V extension: SPV_ALTERA_arbitrary_precision_integers |
| 7 |
|
| 8 |
; CHECK: OpCapability ArbitraryPrecisionIntegersALTERA |
| 9 |
; CHECK: OpExtension "SPV_ALTERA_arbitrary_precision_integers" |
| 10 |
; CHECK: OpName %[[#Foo:]] "foo" |
| 11 |
; CHECK: %[[#Int128Ty:]] = OpTypeInt 128 0 |
| 12 |
|
| 13 |
; CHECK: %[[#Foo]] = OpFunction |
| 14 |
define i64 @foo(i64 %x, i64 %y, i32 %amt) { |
| 15 |
; CHECK: {{.*}} = OpUConvert %[[#Int128Ty]] |
| 16 |
; CHECK: {{.*}} = OpSConvert %[[#Int128Ty]] |
| 17 |
; CHECK: {{.*}} = OpBitwiseOr %[[#Int128Ty]] |
| 18 |
; CHECK: {{.*}} = OpUConvert %[[#Int128Ty]] |
| 19 |
; CHECK: {{.*}} = OpShiftRightLogical %[[#Int128Ty]] |
| 20 |
%tmp0 = zext i64 %x to i128 |
| 21 |
%tmp1 = sext i64 %y to i128 |
| 22 |
%tmp2 = or i128 %tmp0, %tmp1 |
| 23 |
%tmp7 = zext i32 13 to i128 |
| 24 |
%tmp3 = lshr i128 %tmp2, %tmp7 |
| 25 |
%tmp4 = trunc i128 %tmp3 to i64 |
| 26 |
ret i64 %tmp4 |
| 27 |
} |