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
144 lines
5.6 KiB
LLVM
144 lines
5.6 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
|
|
; RUN: llc < %s -mattr=+simd128 | FileCheck %s
|
|
|
|
target triple = "wasm32-unknown-unknown"
|
|
|
|
define <4 x i32> @dot_sext_1(<8 x i16> %a, <8 x i16> %b) {
|
|
; CHECK-LABEL: dot_sext_1:
|
|
; CHECK: .functype dot_sext_1 (v128, v128) -> (v128)
|
|
; CHECK-NEXT: # %bb.0:
|
|
; CHECK-NEXT: local.get 0
|
|
; CHECK-NEXT: local.get 1
|
|
; CHECK-NEXT: i32x4.dot_i16x8_s
|
|
; CHECK-NEXT: # fallthrough-return
|
|
%sext1 = sext <8 x i16> %a to <8 x i32>
|
|
%sext2 = sext <8 x i16> %b to <8 x i32>
|
|
%mul = mul <8 x i32> %sext1, %sext2
|
|
%shuffle1 = shufflevector <8 x i32> %mul, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
|
|
%shuffle2 = shufflevector <8 x i32> %mul, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
|
|
%res = add <4 x i32> %shuffle1, %shuffle2
|
|
ret <4 x i32> %res
|
|
}
|
|
|
|
|
|
define <4 x i32> @dot_sext_2(<8 x i16> %a, <8 x i16> %b) {
|
|
; CHECK-LABEL: dot_sext_2:
|
|
; CHECK: .functype dot_sext_2 (v128, v128) -> (v128)
|
|
; CHECK-NEXT: # %bb.0:
|
|
; CHECK-NEXT: local.get 0
|
|
; CHECK-NEXT: local.get 1
|
|
; CHECK-NEXT: i32x4.dot_i16x8_s
|
|
; CHECK-NEXT: # fallthrough-return
|
|
%sext1 = sext <8 x i16> %a to <8 x i32>
|
|
%sext2 = sext <8 x i16> %b to <8 x i32>
|
|
%mul = mul <8 x i32> %sext1, %sext2
|
|
%shuffle1 = shufflevector <8 x i32> %mul, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
|
|
%shuffle2 = shufflevector <8 x i32> %mul, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
|
|
%res = add <4 x i32> %shuffle2, %shuffle1
|
|
ret <4 x i32> %res
|
|
}
|
|
|
|
define <4 x i32> @dot_sext_self(<8 x i16> %v) {
|
|
; CHECK-LABEL: dot_sext_self:
|
|
; CHECK: .functype dot_sext_self (v128) -> (v128)
|
|
; CHECK-NEXT: # %bb.0:
|
|
; CHECK-NEXT: local.get 0
|
|
; CHECK-NEXT: local.get 0
|
|
; CHECK-NEXT: i32x4.dot_i16x8_s
|
|
; CHECK-NEXT: # fallthrough-return
|
|
%sext = sext <8 x i16> %v to <8 x i32>
|
|
%mul = mul <8 x i32> %sext, %sext
|
|
%shuffle1 = shufflevector <8 x i32> %mul, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
|
|
%shuffle2 = shufflevector <8 x i32> %mul, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
|
|
%res = add <4 x i32> %shuffle1, %shuffle2
|
|
ret <4 x i32> %res
|
|
}
|
|
|
|
; INFO: Negative test
|
|
define <4 x i32> @dot_zext(<8 x i16> %a, <8 x i16> %b) {
|
|
; CHECK-LABEL: dot_zext:
|
|
; CHECK: .functype dot_zext (v128, v128) -> (v128)
|
|
; CHECK-NEXT: .local v128
|
|
; CHECK-NEXT: # %bb.0:
|
|
; CHECK-NEXT: local.get 0
|
|
; CHECK-NEXT: local.get 1
|
|
; CHECK-NEXT: i32x4.extmul_low_i16x8_u
|
|
; CHECK-NEXT: local.tee 2
|
|
; CHECK-NEXT: local.get 0
|
|
; CHECK-NEXT: local.get 1
|
|
; CHECK-NEXT: i32x4.extmul_high_i16x8_u
|
|
; CHECK-NEXT: local.tee 1
|
|
; CHECK-NEXT: i8x16.shuffle 0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27
|
|
; CHECK-NEXT: local.get 2
|
|
; CHECK-NEXT: local.get 1
|
|
; CHECK-NEXT: i8x16.shuffle 4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31
|
|
; CHECK-NEXT: i32x4.add
|
|
; CHECK-NEXT: # fallthrough-return
|
|
%zext1 = zext <8 x i16> %a to <8 x i32>
|
|
%zext2 = zext <8 x i16> %b to <8 x i32>
|
|
%mul = mul <8 x i32> %zext1, %zext2
|
|
%shuffle1 = shufflevector <8 x i32> %mul, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
|
|
%shuffle2 = shufflevector <8 x i32> %mul, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
|
|
%res = add <4 x i32> %shuffle1, %shuffle2
|
|
ret <4 x i32> %res
|
|
}
|
|
|
|
; INFO: Negative test
|
|
define <4 x i32> @dot_wrong_shuffle(<8 x i16> %a, <8 x i16> %b) {
|
|
; CHECK-LABEL: dot_wrong_shuffle:
|
|
; CHECK: .functype dot_wrong_shuffle (v128, v128) -> (v128)
|
|
; CHECK-NEXT: # %bb.0:
|
|
; CHECK-NEXT: local.get 0
|
|
; CHECK-NEXT: local.get 1
|
|
; CHECK-NEXT: i32x4.extmul_low_i16x8_s
|
|
; CHECK-NEXT: local.get 0
|
|
; CHECK-NEXT: local.get 1
|
|
; CHECK-NEXT: i32x4.extmul_high_i16x8_s
|
|
; CHECK-NEXT: i32x4.add
|
|
; CHECK-NEXT: # fallthrough-return
|
|
%sext1 = sext <8 x i16> %a to <8 x i32>
|
|
%sext2 = sext <8 x i16> %b to <8 x i32>
|
|
%mul = mul <8 x i32> %sext1, %sext2
|
|
%shuffle1 = shufflevector <8 x i32> %mul, <8 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
|
|
%shuffle2 = shufflevector <8 x i32> %mul, <8 x i32> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
|
|
%res = add <4 x i32> %shuffle1, %shuffle2
|
|
ret <4 x i32> %res
|
|
}
|
|
|
|
define dso_local <4 x i32> @dot_with_bitcast_both(<4 x i32> %a, <4 x i32> %b) unnamed_addr {
|
|
; CHECK-LABEL: dot_with_bitcast_both:
|
|
; CHECK: .functype dot_with_bitcast_both (v128, v128) -> (v128)
|
|
; CHECK-NEXT: # %bb.0: # %start
|
|
; CHECK-NEXT: local.get 1
|
|
; CHECK-NEXT: local.get 0
|
|
; CHECK-NEXT: i32x4.dot_i16x8_s
|
|
; CHECK-NEXT: # fallthrough-return
|
|
start:
|
|
%_4 = bitcast <4 x i32> %a to <8 x i16>
|
|
%_5 = bitcast <4 x i32> %b to <8 x i16>
|
|
%0 = sext <8 x i16> %_4 to <8 x i32>
|
|
%1 = sext <8 x i16> %_5 to <8 x i32>
|
|
%2 = mul nsw <8 x i32> %1, %0
|
|
%3 = shufflevector <8 x i32> %2, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
|
|
%4 = shufflevector <8 x i32> %2, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
|
|
%5 = add <4 x i32> %3, %4
|
|
ret <4 x i32> %5
|
|
}
|
|
|
|
define <4 x i32> @dot_with_bitcast_one(<4 x i32> %a) {
|
|
; CHECK-LABEL: dot_with_bitcast_one:
|
|
; CHECK: .functype dot_with_bitcast_one (v128) -> (v128)
|
|
; CHECK-NEXT: # %bb.0: # %start
|
|
; CHECK-NEXT: local.get 0
|
|
; CHECK-NEXT: i32x4.extadd_pairwise_i16x8_s
|
|
; CHECK-NEXT: # fallthrough-return
|
|
start:
|
|
%a1 = bitcast <4 x i32> %a to <8 x i16>
|
|
%0 = shufflevector <8 x i16> %a1, <8 x i16> %a1, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
|
|
%1 = shufflevector <8 x i16> %a1, <8 x i16> %a1, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
|
|
%2 = sext <4 x i16> %0 to <4 x i32>
|
|
%3 = sext <4 x i16> %1 to <4 x i32>
|
|
%4 = add nsw <4 x i32> %2, %3
|
|
ret <4 x i32> %4
|
|
}
|