Index: lib/Target/Mips/MipsDSPInstrInfo.td =================================================================== --- lib/Target/Mips/MipsDSPInstrInfo.td +++ lib/Target/Mips/MipsDSPInstrInfo.td @@ -1325,6 +1325,10 @@ def : BitconvertPat; def : BitconvertPat; def : BitconvertPat; +def : BitconvertPat; +def : BitconvertPat; +def : BitconvertPat; +def : BitconvertPat; def : DSPPat<(v2i16 (load addr:$a)), (v2i16 (COPY_TO_REGCLASS (LW addr:$a), DSPR))>; Index: test/CodeGen/Mips/v2i16tof32.ll =================================================================== --- test/CodeGen/Mips/v2i16tof32.ll +++ test/CodeGen/Mips/v2i16tof32.ll @@ -0,0 +1,19 @@ +; RUN: llc < %s -O2 -mtriple mipsel--linux-android -mattr=+dsp -verify-machineinstrs + +; Function below generates a v2i16 to f32 bitcast. +; Test that we are able to match it. + +define float @f(<8 x i16>* %a) { +entry: + %m = alloca <8 x i16> + %0 = load <8 x i16>, <8 x i16>* %a + store <8 x i16> %0, <8 x i16>* %m + %1 = bitcast <8 x i16> %0 to <4 x float> + %2 = shufflevector <4 x float> %1, <4 x float> undef, <8 x i32> + %3 = shufflevector <8 x float> zeroinitializer, <8 x float> %2, <8 x i32> + %4 = bitcast <8 x float> %3 to <8 x i32> + %5 = extractelement <8 x i32> %4, i32 0 + %6 = bitcast i32 %5 to float + ret float %6 +} +