1 # RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=AVX
2 # RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx512f,+avx512vl -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=AVX512VL
5 define void @test_extract_128_idx0() {
9 define void @test_extract_128_idx1() {
15 name: test_extract_128_idx0
16 # ALL-LABEL: name: test_extract_128_idx0
21 # AVX-NEXT: - { id: 0, class: vr256, preferred-register: '' }
22 # AVX-NEXT: - { id: 1, class: vr128, preferred-register: '' }
24 # AVX512VL: registers:
25 # AVX512VL-NEXT: - { id: 0, class: vr256x, preferred-register: '' }
26 # AVX512VL-NEXT: - { id: 1, class: vr128x, preferred-register: '' }
28 - { id: 0, class: vecr }
29 - { id: 1, class: vecr }
30 # AVX: %0:vr256 = COPY $ymm1
31 # AVX-NEXT: %1:vr128 = COPY %0.sub_xmm
32 # AVX512VL: %0:vr256x = COPY $ymm1
33 # AVX512VL-NEXT: %1:vr128x = COPY %0.sub_xmm
34 # ALL-NEXT: $xmm0 = COPY %1
35 # ALL-NEXT: RET 0, implicit $xmm0
40 %0(<8 x s32>) = COPY $ymm1
41 %1(<4 x s32>) = G_EXTRACT %0(<8 x s32>), 0
42 $xmm0 = COPY %1(<4 x s32>)
47 name: test_extract_128_idx1
48 # ALL-LABEL: name: test_extract_128_idx1
53 # AVX-NEXT: - { id: 0, class: vr256, preferred-register: '' }
54 # AVX-NEXT: - { id: 1, class: vr128, preferred-register: '' }
56 # AVX512VL: registers:
57 # AVX512VL-NEXT: - { id: 0, class: vr256x, preferred-register: '' }
58 # AVX512VL-NEXT: - { id: 1, class: vr128x, preferred-register: '' }
60 - { id: 0, class: vecr }
61 - { id: 1, class: vecr }
62 # AVX: %0:vr256 = COPY $ymm1
63 # AVX-NEXT: %1:vr128 = VEXTRACTF128rr %0, 1
64 # AVX-NEXT: $xmm0 = COPY %1
65 # AVX-NEXT: RET 0, implicit $xmm0
67 # AVX512VL: %0:vr256x = COPY $ymm1
68 # AVX512VL-NEXT: %1:vr128x = VEXTRACTF32x4Z256rr %0, 1
69 # AVX512VL-NEXT: $xmm0 = COPY %1
70 # AVX512VL-NEXT: RET 0, implicit $xmm0
75 %0(<8 x s32>) = COPY $ymm1
76 %1(<4 x s32>) = G_EXTRACT %0(<8 x s32>), 128
77 $xmm0 = COPY %1(<4 x s32>)