Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/LoongArch/lasx/extract-binop.ll
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

101 lines
3.5 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
; RUN: llc --mtriple=loongarch32 --mattr=+32s,+lasx < %s | FileCheck %s --check-prefixes=CHECK,LA32
; RUN: llc --mtriple=loongarch64 --mattr=+lasx < %s | FileCheck %s --check-prefixes=CHECK,LA64
define i8 @extractelt_add_v32i8(ptr %p) {
; CHECK-LABEL: extractelt_add_v32i8:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: xvld $xr0, $a0, 0
; CHECK-NEXT: xvaddi.bu $xr0, $xr0, 13
; CHECK-NEXT: vpickve2gr.b $a0, $vr0, 2
; CHECK-NEXT: ret
entry:
%x = load <32 x i8>, ptr %p
%add = add <32 x i8> %x, <i8 11, i8 12, i8 13, i8 14, i8 11, i8 12, i8 13, i8 14, i8 11, i8 12, i8 13, i8 14, i8 11, i8 12, i8 13, i8 14, i8 11, i8 12, i8 13, i8 14, i8 11, i8 12, i8 13, i8 14, i8 11, i8 12, i8 13, i8 14, i8 11, i8 12, i8 13, i8 14>
%ext = extractelement <32 x i8> %add, i32 2
ret i8 %ext
}
define i16 @extractelt_add_v16i16(ptr %p) {
; CHECK-LABEL: extractelt_add_v16i16:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: xvld $xr0, $a0, 0
; CHECK-NEXT: xvaddi.hu $xr0, $xr0, 13
; CHECK-NEXT: vpickve2gr.h $a0, $vr0, 2
; CHECK-NEXT: ret
entry:
%x = load <16 x i16>, ptr %p
%add = add <16 x i16> %x, <i16 11, i16 12, i16 13, i16 14, i16 11, i16 12, i16 13, i16 14, i16 11, i16 12, i16 13, i16 14, i16 11, i16 12, i16 13, i16 14>
%ext = extractelement <16 x i16> %add, i32 2
ret i16 %ext
}
define i32 @extractelt_add_v8i32(ptr %p) {
; LA32-LABEL: extractelt_add_v8i32:
; LA32: # %bb.0: # %entry
; LA32-NEXT: ld.w $a0, $a0, 8
; LA32-NEXT: addi.w $a0, $a0, 13
; LA32-NEXT: ret
;
; LA64-LABEL: extractelt_add_v8i32:
; LA64: # %bb.0: # %entry
; LA64-NEXT: xvld $xr0, $a0, 0
; LA64-NEXT: xvaddi.wu $xr0, $xr0, 13
; LA64-NEXT: xvpickve2gr.w $a0, $xr0, 2
; LA64-NEXT: ret
entry:
%x = load <8 x i32>, ptr %p
%add = add <8 x i32> %x, <i32 11, i32 12, i32 13, i32 14, i32 11, i32 12, i32 13, i32 14>
%ext = extractelement <8 x i32> %add, i32 2
ret i32 %ext
}
define i64 @extractelt_add_v4i64(ptr %p) {
; LA32-LABEL: extractelt_add_v4i64:
; LA32: # %bb.0: # %entry
; LA32-NEXT: xvld $xr0, $a0, 0
; LA32-NEXT: xvaddi.du $xr0, $xr0, 12
; LA32-NEXT: xvpickve2gr.w $a0, $xr0, 2
; LA32-NEXT: xvpickve2gr.w $a1, $xr0, 3
; LA32-NEXT: ret
;
; LA64-LABEL: extractelt_add_v4i64:
; LA64: # %bb.0: # %entry
; LA64-NEXT: ld.d $a0, $a0, 8
; LA64-NEXT: addi.d $a0, $a0, 12
; LA64-NEXT: ret
entry:
%x = load <4 x i64>, ptr %p
%add = add <4 x i64> %x, <i64 11, i64 12, i64 13, i64 14>
%ext = extractelement <4 x i64> %add, i32 1
ret i64 %ext
}
define float @extractelt_fadd_v8f32(ptr %p) {
; CHECK-LABEL: extractelt_fadd_v8f32:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: fld.s $fa0, $a0, 8
; CHECK-NEXT: vldi $vr1, -1238
; CHECK-NEXT: fadd.s $fa0, $fa0, $fa1
; CHECK-NEXT: ret
entry:
%x = load <8 x float>, ptr %p
%add = fadd <8 x float> %x, <float 11.0, float 12.0, float 13.0, float 14.0, float 11.0, float 12.0, float 13.0, float 14.0>
%ext = extractelement <8 x float> %add, i32 2
ret float %ext
}
define double @extractelt_fadd_v4f64(ptr %p) {
; CHECK-LABEL: extractelt_fadd_v4f64:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: fld.d $fa0, $a0, 8
; CHECK-NEXT: vldi $vr1, -984
; CHECK-NEXT: fadd.d $fa0, $fa0, $fa1
; CHECK-NEXT: ret
entry:
%x = load <4 x double>, ptr %p
%add = fadd <4 x double> %x, <double 11.0, double 12.0, double 13.0, double 14.0>
%ext = extractelement <4 x double> %add, i32 1
ret double %ext
}