1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -O2 -mtriple mipsel--linux-android -mattr=+dsp -verify-machineinstrs | FileCheck %s
4 ; Function below generates a v2i16 to f32 bitcast.
5 ; Test that we are able to match it.
7 define float @f(ptr %a) {
9 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: addiu $sp, $sp, -32
11 ; CHECK-NEXT: .cfi_def_cfa_offset 32
12 ; CHECK-NEXT: sw $ra, 28($sp) # 4-byte Folded Spill
13 ; CHECK-NEXT: sw $fp, 24($sp) # 4-byte Folded Spill
14 ; CHECK-NEXT: .cfi_offset 31, -4
15 ; CHECK-NEXT: .cfi_offset 30, -8
16 ; CHECK-NEXT: move $fp, $sp
17 ; CHECK-NEXT: .cfi_def_cfa_register 30
18 ; CHECK-NEXT: addiu $1, $zero, -16
19 ; CHECK-NEXT: and $sp, $sp, $1
20 ; CHECK-NEXT: lw $1, 12($4)
21 ; CHECK-NEXT: lw $2, 0($4)
22 ; CHECK-NEXT: lw $3, 8($4)
23 ; CHECK-NEXT: sw $3, 8($sp)
24 ; CHECK-NEXT: sw $1, 12($sp)
25 ; CHECK-NEXT: sw $2, 0($sp)
26 ; CHECK-NEXT: lw $1, 4($4)
27 ; CHECK-NEXT: sw $1, 4($sp)
28 ; CHECK-NEXT: mtc1 $2, $f0
29 ; CHECK-NEXT: move $sp, $fp
30 ; CHECK-NEXT: lw $fp, 24($sp) # 4-byte Folded Reload
31 ; CHECK-NEXT: lw $ra, 28($sp) # 4-byte Folded Reload
33 ; CHECK-NEXT: addiu $sp, $sp, 32
36 %0 = load <8 x i16>, ptr %a
37 store <8 x i16> %0, ptr %m
38 %1 = bitcast <8 x i16> %0 to <4 x float>
39 %2 = shufflevector <4 x float> %1, <4 x float> undef, <8 x i32> <i32 0, i32 3, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef>
40 %3 = shufflevector <8 x float> zeroinitializer, <8 x float> %2, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 4, i32 5, i32 6, i32 7>
41 %4 = bitcast <8 x float> %3 to <8 x i32>
42 %5 = extractelement <8 x i32> %4, i32 0
43 %6 = bitcast i32 %5 to float