Files
TheRock/compiler/amd-llvm/mlir/test/Dialect/SPIRV/IR/ocl-ops.mlir
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

828 lines
21 KiB
MLIR

// RUN: mlir-opt -split-input-file -verify-diagnostics %s | FileCheck %s
//===----------------------------------------------------------------------===//
// spirv.CL.exp
//===----------------------------------------------------------------------===//
func.func @exp(%arg0 : f32) -> () {
// CHECK: spirv.CL.exp {{%.*}} : f32
%2 = spirv.CL.exp %arg0 : f32
return
}
func.func @expvec(%arg0 : vector<3xf16>) -> () {
// CHECK: spirv.CL.exp {{%.*}} : vector<3xf16>
%2 = spirv.CL.exp %arg0 : vector<3xf16>
return
}
// -----
func.func @exp(%arg0 : i32) -> () {
// expected-error @+1 {{op operand #0 must be 16/32/64-bit float or fixed-length vector of 16/32/64-bit float values}}
%2 = spirv.CL.exp %arg0 : i32
return
}
// -----
func.func @exp(%arg0 : vector<5xf32>) -> () {
// expected-error @+1 {{op operand #0 must be 16/32/64-bit float or fixed-length vector of 16/32/64-bit float values of length 2/3/4}}
%2 = spirv.CL.exp %arg0 : vector<5xf32>
return
}
// -----
func.func @exp(%arg0 : f32, %arg1 : f32) -> () {
// expected-error @+1 {{expected ':'}}
%2 = spirv.CL.exp %arg0, %arg1 : i32
return
}
// -----
func.func @exp(%arg0 : i32) -> () {
// expected-error @+1 {{expected non-function type}}
%2 = spirv.CL.exp %arg0 :
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.exp2
//===----------------------------------------------------------------------===//
func.func @exp2(%arg0 : f32) -> () {
// CHECK: spirv.CL.exp2 {{%.*}} : f32
%2 = spirv.CL.exp2 %arg0 : f32
return
}
func.func @exp2vec(%arg0 : vector<3xf16>) -> () {
// CHECK: spirv.CL.exp2 {{%.*}} : vector<3xf16>
%2 = spirv.CL.exp2 %arg0 : vector<3xf16>
return
}
// -----
func.func @exp2(%arg0 : i32) -> () {
// expected-error @+1 {{op operand #0 must be 16/32/64-bit float or fixed-length vector of 16/32/64-bit float values}}
%2 = spirv.CL.exp2 %arg0 : i32
return
}
// -----
func.func @exp2(%arg0 : vector<5xf32>) -> () {
// expected-error @+1 {{op operand #0 must be 16/32/64-bit float or fixed-length vector of 16/32/64-bit float values of length 2/3/4}}
%2 = spirv.CL.exp2 %arg0 : vector<5xf32>
return
}
// -----
func.func @exp2(%arg0 : f32, %arg1 : f32) -> () {
// expected-error @+1 {{expected ':'}}
%2 = spirv.CL.exp2 %arg0, %arg1 : i32
return
}
// -----
func.func @exp2(%arg0 : i32) -> () {
// expected-error @+1 {{expected non-function type}}
%2 = spirv.CL.exp2 %arg0 :
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.exp10
//===----------------------------------------------------------------------===//
func.func @exp10(%arg0 : f32) -> () {
// CHECK: spirv.CL.exp10 {{%.*}} : f32
%2 = spirv.CL.exp10 %arg0 : f32
return
}
func.func @exp10vec(%arg0 : vector<3xf16>) -> () {
// CHECK: spirv.CL.exp10 {{%.*}} : vector<3xf16>
%2 = spirv.CL.exp10 %arg0 : vector<3xf16>
return
}
// -----
func.func @exp10(%arg0 : i32) -> () {
// expected-error @+1 {{op operand #0 must be 16/32/64-bit float or fixed-length vector of 16/32/64-bit float values}}
%2 = spirv.CL.exp10 %arg0 : i32
return
}
// -----
func.func @exp10(%arg0 : vector<5xf32>) -> () {
// expected-error @+1 {{op operand #0 must be 16/32/64-bit float or fixed-length vector of 16/32/64-bit float values of length 2/3/4}}
%2 = spirv.CL.exp10 %arg0 : vector<5xf32>
return
}
// -----
func.func @exp10(%arg0 : f32, %arg1 : f32) -> () {
// expected-error @+1 {{expected ':'}}
%2 = spirv.CL.exp10 %arg0, %arg1 : i32
return
}
// -----
func.func @exp10(%arg0 : i32) -> () {
// expected-error @+1 {{expected non-function type}}
%2 = spirv.CL.exp10 %arg0 :
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.log2
//===----------------------------------------------------------------------===//
func.func @log2(%arg0 : f32) -> () {
// CHECK: spirv.CL.log2 {{%.*}} : f32
%2 = spirv.CL.log2 %arg0 : f32
return
}
func.func @log2vec(%arg0 : vector<3xf16>) -> () {
// CHECK: spirv.CL.log2 {{%.*}} : vector<3xf16>
%2 = spirv.CL.log2 %arg0 : vector<3xf16>
return
}
// -----
func.func @log2(%arg0 : i32) -> () {
// expected-error @+1 {{op operand #0 must be 16/32/64-bit float or fixed-length vector of 16/32/64-bit float values}}
%2 = spirv.CL.log2 %arg0 : i32
return
}
// -----
func.func @log2(%arg0 : vector<5xf32>) -> () {
// expected-error @+1 {{op operand #0 must be 16/32/64-bit float or fixed-length vector of 16/32/64-bit float values of length 2/3/4}}
%2 = spirv.CL.log2 %arg0 : vector<5xf32>
return
}
// -----
func.func @log2(%arg0 : f32, %arg1 : f32) -> () {
// expected-error @+1 {{expected ':'}}
%2 = spirv.CL.log2 %arg0, %arg1 : i32
return
}
// -----
func.func @log2(%arg0 : i32) -> () {
// expected-error @+1 {{expected non-function type}}
%2 = spirv.CL.log2 %arg0 :
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.log10
//===----------------------------------------------------------------------===//
func.func @log10(%arg0 : f32) -> () {
// CHECK: spirv.CL.log10 {{%.*}} : f32
%2 = spirv.CL.log10 %arg0 : f32
return
}
func.func @log10vec(%arg0 : vector<3xf16>) -> () {
// CHECK: spirv.CL.log10 {{%.*}} : vector<3xf16>
%2 = spirv.CL.log10 %arg0 : vector<3xf16>
return
}
// -----
func.func @log10(%arg0 : i32) -> () {
// expected-error @+1 {{op operand #0 must be 16/32/64-bit float or fixed-length vector of 16/32/64-bit float values}}
%2 = spirv.CL.log10 %arg0 : i32
return
}
// -----
func.func @log10(%arg0 : vector<5xf32>) -> () {
// expected-error @+1 {{op operand #0 must be 16/32/64-bit float or fixed-length vector of 16/32/64-bit float values of length 2/3/4}}
%2 = spirv.CL.log10 %arg0 : vector<5xf32>
return
}
// -----
func.func @log10(%arg0 : f32, %arg1 : f32) -> () {
// expected-error @+1 {{expected ':'}}
%2 = spirv.CL.log10 %arg0, %arg1 : i32
return
}
// -----
func.func @log10(%arg0 : i32) -> () {
// expected-error @+1 {{expected non-function type}}
%2 = spirv.CL.log10 %arg0 :
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.fabs
//===----------------------------------------------------------------------===//
func.func @fabs(%arg0 : f32) -> () {
// CHECK: spirv.CL.fabs {{%.*}} : f32
%2 = spirv.CL.fabs %arg0 : f32
return
}
func.func @fabsvec(%arg0 : vector<3xf16>) -> () {
// CHECK: spirv.CL.fabs {{%.*}} : vector<3xf16>
%2 = spirv.CL.fabs %arg0 : vector<3xf16>
return
}
func.func @fabsf64(%arg0 : f64) -> () {
// CHECK: spirv.CL.fabs {{%.*}} : f64
%2 = spirv.CL.fabs %arg0 : f64
return
}
// -----
func.func @fabs(%arg0 : i32) -> () {
// expected-error @+1 {{op operand #0 must be 16/32/64-bit float or fixed-length vector of 16/32/64-bit float values}}
%2 = spirv.CL.fabs %arg0 : i32
return
}
// -----
func.func @fabs(%arg0 : vector<5xf32>) -> () {
// expected-error @+1 {{op operand #0 must be 16/32/64-bit float or fixed-length vector of 16/32/64-bit float values of length 2/3/4}}
%2 = spirv.CL.fabs %arg0 : vector<5xf32>
return
}
// -----
func.func @fabs(%arg0 : f32, %arg1 : f32) -> () {
// expected-error @+1 {{expected ':'}}
%2 = spirv.CL.fabs %arg0, %arg1 : i32
return
}
// -----
func.func @fabs(%arg0 : i32) -> () {
// expected-error @+1 {{expected non-function type}}
%2 = spirv.CL.fabs %arg0 :
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.s_abs
//===----------------------------------------------------------------------===//
func.func @sabs(%arg0 : i32) -> () {
// CHECK: spirv.CL.s_abs {{%.*}} : i32
%2 = spirv.CL.s_abs %arg0 : i32
return
}
func.func @sabsvec(%arg0 : vector<3xi16>) -> () {
// CHECK: spirv.CL.s_abs {{%.*}} : vector<3xi16>
%2 = spirv.CL.s_abs %arg0 : vector<3xi16>
return
}
func.func @sabsi64(%arg0 : i64) -> () {
// CHECK: spirv.CL.s_abs {{%.*}} : i64
%2 = spirv.CL.s_abs %arg0 : i64
return
}
func.func @sabsi8(%arg0 : i8) -> () {
// CHECK: spirv.CL.s_abs {{%.*}} : i8
%2 = spirv.CL.s_abs %arg0 : i8
return
}
// -----
func.func @sabs(%arg0 : f32) -> () {
// expected-error @+1 {{op operand #0 must be 8/16/32/64-bit integer or fixed-length vector of 8/16/32/64-bit integer values}}
%2 = spirv.CL.s_abs %arg0 : f32
return
}
// -----
func.func @sabs(%arg0 : vector<5xi32>) -> () {
// expected-error @+1 {{op operand #0 must be 8/16/32/64-bit integer or fixed-length vector of 8/16/32/64-bit integer values of length 2/3/4}}
%2 = spirv.CL.s_abs %arg0 : vector<5xi32>
return
}
// -----
func.func @sabs(%arg0 : i32, %arg1 : i32) -> () {
// expected-error @+1 {{expected ':'}}
%2 = spirv.CL.s_abs %arg0, %arg1 : i32
return
}
// -----
func.func @sabs(%arg0 : i32) -> () {
// expected-error @+1 {{expected non-function type}}
%2 = spirv.CL.s_abs %arg0 :
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.clz
//===----------------------------------------------------------------------===//
func.func @clz(%arg0 : i32) -> () {
// CHECK: spirv.CL.clz {{%.*}} : i32
%2 = spirv.CL.clz %arg0 : i32
return
}
func.func @clzvec(%arg0 : vector<3xi16>) -> () {
// CHECK: spirv.CL.clz {{%.*}} : vector<3xi16>
%2 = spirv.CL.clz %arg0 : vector<3xi16>
return
}
// -----
func.func @clz(%arg0 : f32) -> () {
// expected-error @+1 {{op operand #0 must be 8/16/32/64-bit integer or fixed-length vector of 8/16/32/64-bit integer values}}
%2 = spirv.CL.clz %arg0 : f32
return
}
// -----
func.func @clz(%arg0 : vector<5xi32>) -> () {
// expected-error @+1 {{op operand #0 must be 8/16/32/64-bit integer or fixed-length vector of 8/16/32/64-bit integer values of length 2/3/4}}
%2 = spirv.CL.clz %arg0 : vector<5xi32>
return
}
// -----
func.func @clz(%arg0 : i32, %arg1 : i32) -> () {
// expected-error @+1 {{expected ':'}}
%2 = spirv.CL.clz %arg0, %arg1 : i32
return
}
// -----
func.func @clz(%arg0 : i32) -> () {
// expected-error @+1 {{expected non-function type}}
%2 = spirv.CL.clz %arg0 :
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.fma
//===----------------------------------------------------------------------===//
func.func @fma(%a : f32, %b : f32, %c : f32) -> () {
// CHECK: spirv.CL.fma {{%[^,]*}}, {{%[^,]*}}, {{%[^,]*}} : f32
%2 = spirv.CL.fma %a, %b, %c : f32
return
}
// -----
func.func @fma(%a : vector<3xf32>, %b : vector<3xf32>, %c : vector<3xf32>) -> () {
// CHECK: spirv.CL.fma {{%[^,]*}}, {{%[^,]*}}, {{%[^,]*}} : vector<3xf32>
%2 = spirv.CL.fma %a, %b, %c : vector<3xf32>
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.mix
//===----------------------------------------------------------------------===//
func.func @mix(%a : f32, %b : f32, %c : f32) -> () {
// CHECK: spirv.CL.mix {{%[^,]*}}, {{%[^,]*}}, {{%[^,]*}} : f32
%2 = spirv.CL.mix %a, %b, %c : f32
return
}
// -----
func.func @mix(%a : vector<3xf32>, %b : vector<3xf32>, %c : vector<3xf32>) -> () {
// CHECK: spirv.CL.mix {{%[^,]*}}, {{%[^,]*}}, {{%[^,]*}} : vector<3xf32>
%2 = spirv.CL.mix %a, %b, %c : vector<3xf32>
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.{F|S|U}{Max|Min}
//===----------------------------------------------------------------------===//
func.func @fmaxmin(%arg0 : f32, %arg1 : f32) {
// CHECK: spirv.CL.fmax {{%.*}}, {{%.*}} : f32
%1 = spirv.CL.fmax %arg0, %arg1 : f32
// CHECK: spirv.CL.fmin {{%.*}}, {{%.*}} : f32
%2 = spirv.CL.fmin %arg0, %arg1 : f32
return
}
func.func @fmaxminvec(%arg0 : vector<3xf16>, %arg1 : vector<3xf16>) {
// CHECK: spirv.CL.fmax {{%.*}}, {{%.*}} : vector<3xf16>
%1 = spirv.CL.fmax %arg0, %arg1 : vector<3xf16>
// CHECK: spirv.CL.fmin {{%.*}}, {{%.*}} : vector<3xf16>
%2 = spirv.CL.fmin %arg0, %arg1 : vector<3xf16>
return
}
func.func @fmaxminf64(%arg0 : f64, %arg1 : f64) {
// CHECK: spirv.CL.fmax {{%.*}}, {{%.*}} : f64
%1 = spirv.CL.fmax %arg0, %arg1 : f64
// CHECK: spirv.CL.fmin {{%.*}}, {{%.*}} : f64
%2 = spirv.CL.fmin %arg0, %arg1 : f64
return
}
func.func @iminmax(%arg0: i32, %arg1: i32) {
// CHECK: spirv.CL.s_max {{%.*}}, {{%.*}} : i32
%1 = spirv.CL.s_max %arg0, %arg1 : i32
// CHECK: spirv.CL.u_max {{%.*}}, {{%.*}} : i32
%2 = spirv.CL.u_max %arg0, %arg1 : i32
// CHECK: spirv.CL.s_min {{%.*}}, {{%.*}} : i32
%3 = spirv.CL.s_min %arg0, %arg1 : i32
// CHECK: spirv.CL.u_min {{%.*}}, {{%.*}} : i32
%4 = spirv.CL.u_min %arg0, %arg1 : i32
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.rint
//===----------------------------------------------------------------------===//
// CHECK-LABEL: func.func @rint(
func.func @rint(%arg0 : f32) -> () {
// CHECK: spirv.CL.rint {{%.*}} : f32
%0 = spirv.CL.rint %arg0 : f32
return
}
// CHECK-LABEL: func.func @rintvec(
func.func @rintvec(%arg0 : vector<3xf16>) -> () {
// CHECK: spirv.CL.rint {{%.*}} : vector<3xf16>
%0 = spirv.CL.rint %arg0 : vector<3xf16>
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.trunc
//===----------------------------------------------------------------------===//
// CHECK-LABEL: func.func @trunc(
func.func @trunc(%arg0 : f32) -> () {
// CHECK: spirv.CL.trunc {{%.*}} : f32
%0 = spirv.CL.trunc %arg0 : f32
return
}
// CHECK-LABEL: func.func @truncvec(
func.func @truncvec(%arg0 : vector<3xf16>) -> () {
// CHECK: spirv.CL.trunc {{%.*}} : vector<3xf16>
%0 = spirv.CL.trunc %arg0 : vector<3xf16>
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.printf
//===----------------------------------------------------------------------===//
// CHECK-LABEL: func.func @printf(
func.func @printf(%fmt : !spirv.ptr<i8, UniformConstant>, %arg1 : i32, %arg2 : i32) -> i32 {
// CHECK: spirv.CL.printf {{%.*}} {{%.*}}, {{%.*}} : !spirv.ptr<i8, UniformConstant>, i32, i32 -> i32
%0 = spirv.CL.printf %fmt %arg1, %arg2 : !spirv.ptr<i8, UniformConstant>, i32, i32 -> i32
return %0 : i32
}
// -----
func.func @tan(%arg0 : f32) -> () {
// CHECK: spirv.CL.tan {{%.*}} : f32
%2 = spirv.CL.tan %arg0 : f32
return
}
// -----
func.func @tan(%arg0 : vector<4xf16>) -> () {
// CHECK: spirv.CL.tan {{%.*}} : vector<4xf16>
%2 = spirv.CL.tan %arg0 : vector<4xf16>
return
}
// -----
func.func @atan(%arg0 : f32) -> () {
// CHECK: spirv.CL.atan {{%.*}} : f32
%2 = spirv.CL.atan %arg0 : f32
return
}
// -----
func.func @atan(%arg0 : vector<4xf16>) -> () {
// CHECK: spirv.CL.atan {{%.*}} : vector<4xf16>
%2 = spirv.CL.atan %arg0 : vector<4xf16>
return
}
// -----
func.func @atanh(%arg0 : f32) -> () {
// CHECK: spirv.CL.atanh {{%.*}} : f32
%2 = spirv.CL.atanh %arg0 : f32
return
}
// -----
func.func @atanh(%arg0 : vector<4xf16>) -> () {
// CHECK: spirv.CL.atanh {{%.*}} : vector<4xf16>
%2 = spirv.CL.atanh %arg0 : vector<4xf16>
return
}
// -----
func.func @sinh(%arg0 : f32) -> () {
// CHECK: spirv.CL.sinh {{%.*}} : f32
%2 = spirv.CL.sinh %arg0 : f32
return
}
// -----
func.func @sinh(%arg0 : vector<4xf16>) -> () {
// CHECK: spirv.CL.sinh {{%.*}} : vector<4xf16>
%2 = spirv.CL.sinh %arg0 : vector<4xf16>
return
}
// -----
func.func @cosh(%arg0 : f32) -> () {
// CHECK: spirv.CL.cosh {{%.*}} : f32
%2 = spirv.CL.cosh %arg0 : f32
return
}
// -----
func.func @cosh(%arg0 : vector<4xf16>) -> () {
// CHECK: spirv.CL.cosh {{%.*}} : vector<4xf16>
%2 = spirv.CL.cosh %arg0 : vector<4xf16>
return
}
// -----
func.func @asin(%arg0 : f32) -> () {
// CHECK: spirv.CL.asin {{%.*}} : f32
%2 = spirv.CL.asin %arg0 : f32
return
}
// -----
func.func @asin(%arg0 : vector<4xf16>) -> () {
// CHECK: spirv.CL.asin {{%.*}} : vector<4xf16>
%2 = spirv.CL.asin %arg0 : vector<4xf16>
return
}
// -----
func.func @asinh(%arg0 : f32) -> () {
// CHECK: spirv.CL.asinh {{%.*}} : f32
%2 = spirv.CL.asinh %arg0 : f32
return
}
// -----
func.func @asinh(%arg0 : vector<4xf16>) -> () {
// CHECK: spirv.CL.asinh {{%.*}} : vector<4xf16>
%2 = spirv.CL.asinh %arg0 : vector<4xf16>
return
}
// -----
func.func @acos(%arg0 : f32) -> () {
// CHECK: spirv.CL.acos {{%.*}} : f32
%2 = spirv.CL.acos %arg0 : f32
return
}
// -----
func.func @acos(%arg0 : vector<4xf16>) -> () {
// CHECK: spirv.CL.acos {{%.*}} : vector<4xf16>
%2 = spirv.CL.acos %arg0 : vector<4xf16>
return
}
// -----
func.func @acosh(%arg0 : f32) -> () {
// CHECK: spirv.CL.acosh {{%.*}} : f32
%2 = spirv.CL.acosh %arg0 : f32
return
}
// -----
func.func @acosh(%arg0 : vector<4xf16>) -> () {
// CHECK: spirv.CL.acosh {{%.*}} : vector<4xf16>
%2 = spirv.CL.acosh %arg0 : vector<4xf16>
return
}
// -----
func.func @atan2(%arg0 : f32, %arg1 : f32) -> () {
// CHECK: spirv.CL.atan2 {{%.*}}, {{%.*}} : f32
%2 = spirv.CL.atan2 %arg0, %arg1 : f32
return
}
// -----
func.func @atan2(%arg0 : vector<4xf16>, %arg1 : vector<4xf16>) -> () {
// CHECK: spirv.CL.atan2 {{%.*}}, {{%.*}} : vector<4xf16>
%2 = spirv.CL.atan2 %arg0, %arg1 : vector<4xf16>
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.ldexp
//===----------------------------------------------------------------------===//
func.func @ldexp(%arg0 : f32, %arg1 : i32) -> () {
// CHECK: {{%.*}} = spirv.CL.ldexp {{%.*}}, {{%.*}} : f32, i32 -> f32
%0 = spirv.CL.ldexp %arg0, %arg1 : f32, i32 -> f32
return
}
// -----
func.func @ldexp_vec(%arg0 : vector<3xf32>, %arg1 : vector<3xi32>) -> () {
// CHECK: {{%.*}} = spirv.CL.ldexp {{%.*}}, {{%.*}} : vector<3xf32>, vector<3xi32> -> vector<3xf32>
%0 = spirv.CL.ldexp %arg0, %arg1 : vector<3xf32>, vector<3xi32> -> vector<3xf32>
return
}
// -----
func.func @ldexp_wrong_type_scalar(%arg0 : f32, %arg1 : vector<2xi32>) -> () {
// expected-error @+1 {{operands must both be scalars or vectors}}
%0 = spirv.CL.ldexp %arg0, %arg1 : f32, vector<2xi32> -> f32
return
}
// -----
func.func @ldexp_wrong_type_vec_1(%arg0 : vector<3xf32>, %arg1 : i32) -> () {
// expected-error @+1 {{operands must both be scalars or vectors}}
%0 = spirv.CL.ldexp %arg0, %arg1 : vector<3xf32>, i32 -> vector<3xf32>
return
}
// -----
func.func @ldexp_wrong_type_vec_2(%arg0 : vector<3xf32>, %arg1 : vector<2xi32>) -> () {
// expected-error @+1 {{operands must have the same number of elements}}
%0 = spirv.CL.ldexp %arg0, %arg1 : vector<3xf32>, vector<2xi32> -> vector<3xf32>
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.pown
//===----------------------------------------------------------------------===//
func.func @pown(%arg0 : f32, %arg1 : i32) -> () {
// CHECK: {{%.*}} = spirv.CL.pown {{%.*}}, {{%.*}} : f32, i32 -> f32
%0 = spirv.CL.pown %arg0, %arg1 : f32, i32 -> f32
return
}
// -----
func.func @pown_vec(%arg0 : vector<3xf32>, %arg1 : vector<3xi32>) -> () {
// CHECK: {{%.*}} = spirv.CL.pown {{%.*}}, {{%.*}} : vector<3xf32>, vector<3xi32> -> vector<3xf32>
%0 = spirv.CL.pown %arg0, %arg1 : vector<3xf32>, vector<3xi32> -> vector<3xf32>
return
}
// -----
func.func @pown_wrong_type_scalar(%arg0 : f32, %arg1 : vector<2xi32>) -> () {
// expected-error @+1 {{operands must both be scalars or vectors}}
%0 = spirv.CL.pown %arg0, %arg1 : f32, vector<2xi32> -> f32
return
}
// -----
func.func @pown_wrong_type_vec(%arg0 : vector<3xf32>, %arg1 : vector<2xi32>) -> () {
// expected-error @+1 {{operands must have the same number of elements}}
%0 = spirv.CL.pown %arg0, %arg1 : vector<3xf32>, vector<2xi32> -> vector<3xf32>
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.CL.rootn
//===----------------------------------------------------------------------===//
func.func @rootn(%arg0 : f32, %arg1 : i32) -> () {
// CHECK: {{%.*}} = spirv.CL.rootn {{%.*}}, {{%.*}} : f32, i32 -> f32
%0 = spirv.CL.rootn %arg0, %arg1 : f32, i32 -> f32
return
}
// -----
func.func @rootn_vec(%arg0 : vector<3xf32>, %arg1 : vector<3xi32>) -> () {
// CHECK: {{%.*}} = spirv.CL.rootn {{%.*}}, {{%.*}} : vector<3xf32>, vector<3xi32> -> vector<3xf32>
%0 = spirv.CL.rootn %arg0, %arg1 : vector<3xf32>, vector<3xi32> -> vector<3xf32>
return
}
// -----
func.func @rootn_wrong_type_scalar(%arg0 : f32, %arg1 : vector<2xi32>) -> () {
// expected-error @+1 {{operands must both be scalars or vectors}}
%0 = spirv.CL.rootn %arg0, %arg1 : f32, vector<2xi32> -> f32
return
}
// -----
func.func @rootn_wrong_type_vec(%arg0 : vector<3xf32>, %arg1 : vector<2xi32>) -> () {
// expected-error @+1 {{operands must have the same number of elements}}
%0 = spirv.CL.rootn %arg0, %arg1 : vector<3xf32>, vector<2xi32> -> vector<3xf32>
return
}