Skip to content

Commit

Permalink
[H2BLB][ISel] Add extractelement test
Browse files Browse the repository at this point in the history
NFC
  • Loading branch information
qcolombet committed Nov 16, 2024
1 parent 216ec6f commit 93d48e1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
20 changes: 20 additions & 0 deletions llvm/test/CodeGen/H2BLB/GISel/select-extract-vector-elt.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc -mtriple h2blb -o - %s -global-isel=1 -global-isel-abort=1 -verify-machineinstrs | FileCheck %s

define i16 @extractVecEltLow(<2 x i16> %a) {
; CHECK-LABEL: extractVecEltLow:
; CHECK: # %bb.0:
; CHECK-NEXT: mov16 r1, r2
; CHECK-NEXT: ret
%res = extractelement <2 x i16> %a, i16 0
ret i16 %res
}

define i16 @extractVecEltHigh(<2 x i16> %a) {
; CHECK-LABEL: extractVecEltHigh:
; CHECK: # %bb.0:
; CHECK-NEXT: mov16 r1, r3
; CHECK-NEXT: ret
%res = extractelement <2 x i16> %a, i16 1
ret i16 %res
}
20 changes: 20 additions & 0 deletions llvm/test/CodeGen/H2BLB/SDISel/select-extract-vector-elt.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc -mtriple h2blb -o - %s -fast-isel=0 -verify-machineinstrs | FileCheck %s

define i16 @extractVecEltLow(<2 x i16> %a) {
; CHECK-LABEL: extractVecEltLow:
; CHECK: # %bb.0:
; CHECK-NEXT: mov16 r1, r2
; CHECK-NEXT: ret
%res = extractelement <2 x i16> %a, i16 0
ret i16 %res
}

define i16 @extractVecEltHigh(<2 x i16> %a) {
; CHECK-LABEL: extractVecEltHigh:
; CHECK: # %bb.0:
; CHECK-NEXT: mov16 r1, r3
; CHECK-NEXT: ret
%res = extractelement <2 x i16> %a, i16 1
ret i16 %res
}

0 comments on commit 93d48e1

Please sign in to comment.