brintos

brintos / llvm-project-archived public Read only

0
0
Text · 24.2 KiB · 1db4287 Raw
385 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -mtriple=x86_64-unknown -passes=slp-vectorizer -S | FileCheck %s --check-prefixes=CHECK,SSE23; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=slm -passes=slp-vectorizer -S | FileCheck %s --check-prefixes=CHECK,SLM4; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=corei7-avx -passes=slp-vectorizer -S | FileCheck %s --check-prefixes=CHECK,AVX5; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=core-avx2 -passes=slp-vectorizer -S | FileCheck %s --check-prefixes=CHECK,AVX26; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=knl -passes=slp-vectorizer -S | FileCheck %s --check-prefixes=CHECK,AVX5127; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=skx -passes=slp-vectorizer -S | FileCheck %s --check-prefixes=CHECK,AVX5128 9define <8 x float> @sitofp_uitofp(<8 x i32> %a) {10; SSE2-LABEL: @sitofp_uitofp(11; SSE2-NEXT:    [[TMP1:%.*]] = shufflevector <8 x i32> [[A:%.*]], <8 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>12; SSE2-NEXT:    [[TMP2:%.*]] = sitofp <4 x i32> [[TMP1]] to <4 x float>13; SSE2-NEXT:    [[TMP3:%.*]] = shufflevector <8 x i32> [[A]], <8 x i32> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>14; SSE2-NEXT:    [[TMP4:%.*]] = uitofp <4 x i32> [[TMP3]] to <4 x float>15; SSE2-NEXT:    [[TMP6:%.*]] = shufflevector <4 x float> [[TMP2]], <4 x float> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>16; SSE2-NEXT:    [[TMP7:%.*]] = shufflevector <4 x float> [[TMP4]], <4 x float> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>17; SSE2-NEXT:    [[TMP5:%.*]] = shufflevector <8 x float> [[TMP6]], <8 x float> [[TMP7]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>18; SSE2-NEXT:    ret <8 x float> [[TMP5]]19;20; SLM-LABEL: @sitofp_uitofp(21; SLM-NEXT:    [[TMP1:%.*]] = shufflevector <8 x i32> [[A:%.*]], <8 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>22; SLM-NEXT:    [[TMP2:%.*]] = sitofp <4 x i32> [[TMP1]] to <4 x float>23; SLM-NEXT:    [[TMP3:%.*]] = shufflevector <8 x i32> [[A]], <8 x i32> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>24; SLM-NEXT:    [[TMP4:%.*]] = uitofp <4 x i32> [[TMP3]] to <4 x float>25; SLM-NEXT:    [[TMP6:%.*]] = shufflevector <4 x float> [[TMP2]], <4 x float> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>26; SLM-NEXT:    [[TMP7:%.*]] = shufflevector <4 x float> [[TMP4]], <4 x float> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>27; SLM-NEXT:    [[TMP5:%.*]] = shufflevector <8 x float> [[TMP6]], <8 x float> [[TMP7]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>28; SLM-NEXT:    ret <8 x float> [[TMP5]]29;30; AVX-LABEL: @sitofp_uitofp(31; AVX-NEXT:    [[TMP1:%.*]] = sitofp <8 x i32> [[A:%.*]] to <8 x float>32; AVX-NEXT:    [[TMP2:%.*]] = uitofp <8 x i32> [[A]] to <8 x float>33; AVX-NEXT:    [[TMP3:%.*]] = shufflevector <8 x float> [[TMP1]], <8 x float> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>34; AVX-NEXT:    ret <8 x float> [[TMP3]]35;36; AVX2-LABEL: @sitofp_uitofp(37; AVX2-NEXT:    [[TMP1:%.*]] = sitofp <8 x i32> [[A:%.*]] to <8 x float>38; AVX2-NEXT:    [[TMP2:%.*]] = uitofp <8 x i32> [[A]] to <8 x float>39; AVX2-NEXT:    [[TMP3:%.*]] = shufflevector <8 x float> [[TMP1]], <8 x float> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>40; AVX2-NEXT:    ret <8 x float> [[TMP3]]41;42; AVX512-LABEL: @sitofp_uitofp(43; AVX512-NEXT:    [[TMP1:%.*]] = sitofp <8 x i32> [[A:%.*]] to <8 x float>44; AVX512-NEXT:    [[TMP2:%.*]] = uitofp <8 x i32> [[A]] to <8 x float>45; AVX512-NEXT:    [[TMP3:%.*]] = shufflevector <8 x float> [[TMP1]], <8 x float> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>46; AVX512-NEXT:    ret <8 x float> [[TMP3]]47;48  %a0 = extractelement <8 x i32> %a, i32 049  %a1 = extractelement <8 x i32> %a, i32 150  %a2 = extractelement <8 x i32> %a, i32 251  %a3 = extractelement <8 x i32> %a, i32 352  %a4 = extractelement <8 x i32> %a, i32 453  %a5 = extractelement <8 x i32> %a, i32 554  %a6 = extractelement <8 x i32> %a, i32 655  %a7 = extractelement <8 x i32> %a, i32 756  %ab0 = sitofp i32 %a0 to float57  %ab1 = sitofp i32 %a1 to float58  %ab2 = sitofp i32 %a2 to float59  %ab3 = sitofp i32 %a3 to float60  %ab4 = uitofp i32 %a4 to float61  %ab5 = uitofp i32 %a5 to float62  %ab6 = uitofp i32 %a6 to float63  %ab7 = uitofp i32 %a7 to float64  %r0 = insertelement <8 x float> undef, float %ab0, i32 065  %r1 = insertelement <8 x float>   %r0, float %ab1, i32 166  %r2 = insertelement <8 x float>   %r1, float %ab2, i32 267  %r3 = insertelement <8 x float>   %r2, float %ab3, i32 368  %r4 = insertelement <8 x float>   %r3, float %ab4, i32 469  %r5 = insertelement <8 x float>   %r4, float %ab5, i32 570  %r6 = insertelement <8 x float>   %r5, float %ab6, i32 671  %r7 = insertelement <8 x float>   %r6, float %ab7, i32 772  ret <8 x float> %r773}74 75define <8 x i32> @fptosi_fptoui(<8 x float> %a) {76; SSE2-LABEL: @fptosi_fptoui(77; SSE2-NEXT:    [[TMP1:%.*]] = shufflevector <8 x float> [[A:%.*]], <8 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>78; SSE2-NEXT:    [[TMP2:%.*]] = fptosi <4 x float> [[TMP1]] to <4 x i32>79; SSE2-NEXT:    [[TMP3:%.*]] = shufflevector <8 x float> [[A]], <8 x float> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>80; SSE2-NEXT:    [[TMP4:%.*]] = fptoui <4 x float> [[TMP3]] to <4 x i32>81; SSE2-NEXT:    [[TMP6:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>82; SSE2-NEXT:    [[TMP7:%.*]] = shufflevector <4 x i32> [[TMP4]], <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>83; SSE2-NEXT:    [[TMP5:%.*]] = shufflevector <8 x i32> [[TMP6]], <8 x i32> [[TMP7]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>84; SSE2-NEXT:    ret <8 x i32> [[TMP5]]85;86; SLM-LABEL: @fptosi_fptoui(87; SLM-NEXT:    [[TMP1:%.*]] = shufflevector <8 x float> [[A:%.*]], <8 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>88; SLM-NEXT:    [[TMP2:%.*]] = fptosi <4 x float> [[TMP1]] to <4 x i32>89; SLM-NEXT:    [[TMP3:%.*]] = shufflevector <8 x float> [[A]], <8 x float> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>90; SLM-NEXT:    [[TMP4:%.*]] = fptoui <4 x float> [[TMP3]] to <4 x i32>91; SLM-NEXT:    [[TMP6:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>92; SLM-NEXT:    [[TMP7:%.*]] = shufflevector <4 x i32> [[TMP4]], <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>93; SLM-NEXT:    [[TMP5:%.*]] = shufflevector <8 x i32> [[TMP6]], <8 x i32> [[TMP7]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>94; SLM-NEXT:    ret <8 x i32> [[TMP5]]95;96; AVX-LABEL: @fptosi_fptoui(97; AVX-NEXT:    [[TMP1:%.*]] = fptosi <8 x float> [[A:%.*]] to <8 x i32>98; AVX-NEXT:    [[TMP2:%.*]] = fptoui <8 x float> [[A]] to <8 x i32>99; AVX-NEXT:    [[TMP3:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>100; AVX-NEXT:    ret <8 x i32> [[TMP3]]101;102; AVX2-LABEL: @fptosi_fptoui(103; AVX2-NEXT:    [[TMP1:%.*]] = fptosi <8 x float> [[A:%.*]] to <8 x i32>104; AVX2-NEXT:    [[TMP2:%.*]] = fptoui <8 x float> [[A]] to <8 x i32>105; AVX2-NEXT:    [[TMP3:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>106; AVX2-NEXT:    ret <8 x i32> [[TMP3]]107;108; AVX512-LABEL: @fptosi_fptoui(109; AVX512-NEXT:    [[TMP1:%.*]] = fptosi <8 x float> [[A:%.*]] to <8 x i32>110; AVX512-NEXT:    [[TMP2:%.*]] = fptoui <8 x float> [[A]] to <8 x i32>111; AVX512-NEXT:    [[TMP3:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>112; AVX512-NEXT:    ret <8 x i32> [[TMP3]]113;114  %a0 = extractelement <8 x float> %a, i32 0115  %a1 = extractelement <8 x float> %a, i32 1116  %a2 = extractelement <8 x float> %a, i32 2117  %a3 = extractelement <8 x float> %a, i32 3118  %a4 = extractelement <8 x float> %a, i32 4119  %a5 = extractelement <8 x float> %a, i32 5120  %a6 = extractelement <8 x float> %a, i32 6121  %a7 = extractelement <8 x float> %a, i32 7122  %ab0 = fptosi float %a0 to i32123  %ab1 = fptosi float %a1 to i32124  %ab2 = fptosi float %a2 to i32125  %ab3 = fptosi float %a3 to i32126  %ab4 = fptoui float %a4 to i32127  %ab5 = fptoui float %a5 to i32128  %ab6 = fptoui float %a6 to i32129  %ab7 = fptoui float %a7 to i32130  %r0 = insertelement <8 x i32> undef, i32 %ab0, i32 0131  %r1 = insertelement <8 x i32>   %r0, i32 %ab1, i32 1132  %r2 = insertelement <8 x i32>   %r1, i32 %ab2, i32 2133  %r3 = insertelement <8 x i32>   %r2, i32 %ab3, i32 3134  %r4 = insertelement <8 x i32>   %r3, i32 %ab4, i32 4135  %r5 = insertelement <8 x i32>   %r4, i32 %ab5, i32 5136  %r6 = insertelement <8 x i32>   %r5, i32 %ab6, i32 6137  %r7 = insertelement <8 x i32>   %r6, i32 %ab7, i32 7138  ret <8 x i32> %r7139}140 141define <8 x float> @fneg_fabs(<8 x float> %a) {142; SSE2-LABEL: @fneg_fabs(143; SSE2-NEXT:    [[TMP1:%.*]] = shufflevector <8 x float> [[A:%.*]], <8 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>144; SSE2-NEXT:    [[TMP3:%.*]] = bitcast <4 x float> [[TMP1]] to <4 x i32>145; SSE2-NEXT:    [[TMP2:%.*]] = shufflevector <8 x float> [[A]], <8 x float> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>146; SSE2-NEXT:    [[TMP4:%.*]] = bitcast <4 x float> [[TMP2]] to <4 x i32>147; SSE2-NEXT:    [[TMP5:%.*]] = xor <4 x i32> [[TMP3]], splat (i32 -2147483648)148; SSE2-NEXT:    [[TMP6:%.*]] = and <4 x i32> [[TMP4]], splat (i32 2147483647)149; SSE2-NEXT:    [[TMP7:%.*]] = shufflevector <4 x i32> [[TMP5]], <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>150; SSE2-NEXT:    [[TMP9:%.*]] = shufflevector <4 x i32> [[TMP6]], <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>151; SSE2-NEXT:    [[TMP8:%.*]] = shufflevector <8 x i32> [[TMP7]], <8 x i32> [[TMP9]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>152; SSE2-NEXT:    [[DOTUNCASTED:%.*]] = bitcast <8 x i32> [[TMP8]] to <8 x float>153; SSE2-NEXT:    ret <8 x float> [[DOTUNCASTED]]154;155; SLM-LABEL: @fneg_fabs(156; SLM-NEXT:    [[TMP1:%.*]] = shufflevector <8 x float> [[A:%.*]], <8 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>157; SLM-NEXT:    [[TMP3:%.*]] = bitcast <4 x float> [[TMP1]] to <4 x i32>158; SLM-NEXT:    [[TMP2:%.*]] = shufflevector <8 x float> [[A]], <8 x float> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>159; SLM-NEXT:    [[TMP4:%.*]] = bitcast <4 x float> [[TMP2]] to <4 x i32>160; SLM-NEXT:    [[TMP5:%.*]] = xor <4 x i32> [[TMP3]], splat (i32 -2147483648)161; SLM-NEXT:    [[TMP6:%.*]] = and <4 x i32> [[TMP4]], splat (i32 2147483647)162; SLM-NEXT:    [[TMP7:%.*]] = shufflevector <4 x i32> [[TMP5]], <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>163; SLM-NEXT:    [[TMP9:%.*]] = shufflevector <4 x i32> [[TMP6]], <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>164; SLM-NEXT:    [[TMP8:%.*]] = shufflevector <8 x i32> [[TMP7]], <8 x i32> [[TMP9]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>165; SLM-NEXT:    [[DOTUNCASTED:%.*]] = bitcast <8 x i32> [[TMP8]] to <8 x float>166; SLM-NEXT:    ret <8 x float> [[DOTUNCASTED]]167;168; AVX-LABEL: @fneg_fabs(169; AVX-NEXT:    [[TMP1:%.*]] = bitcast <8 x float> [[A:%.*]] to <8 x i32>170; AVX-NEXT:    [[TMP2:%.*]] = xor <8 x i32> [[TMP1]], <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>171; AVX-NEXT:    [[TMP3:%.*]] = and <8 x i32> [[TMP1]], <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>172; AVX-NEXT:    [[TMP4:%.*]] = shufflevector <8 x i32> [[TMP2]], <8 x i32> [[TMP3]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>173; AVX-NEXT:    [[DOTUNCASTED:%.*]] = bitcast <8 x i32> [[TMP4]] to <8 x float>174; AVX-NEXT:    ret <8 x float> [[DOTUNCASTED]]175;176; AVX2-LABEL: @fneg_fabs(177; AVX2-NEXT:    [[TMP1:%.*]] = bitcast <8 x float> [[A:%.*]] to <8 x i32>178; AVX2-NEXT:    [[TMP2:%.*]] = xor <8 x i32> [[TMP1]], <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>179; AVX2-NEXT:    [[TMP3:%.*]] = and <8 x i32> [[TMP1]], <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>180; AVX2-NEXT:    [[TMP4:%.*]] = shufflevector <8 x i32> [[TMP2]], <8 x i32> [[TMP3]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>181; AVX2-NEXT:    [[DOTUNCASTED:%.*]] = bitcast <8 x i32> [[TMP4]] to <8 x float>182; AVX2-NEXT:    ret <8 x float> [[DOTUNCASTED]]183;184; AVX512-LABEL: @fneg_fabs(185; AVX512-NEXT:    [[TMP1:%.*]] = bitcast <8 x float> [[A:%.*]] to <8 x i32>186; AVX512-NEXT:    [[TMP2:%.*]] = xor <8 x i32> [[TMP1]], <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>187; AVX512-NEXT:    [[TMP3:%.*]] = and <8 x i32> [[TMP1]], <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>188; AVX512-NEXT:    [[TMP4:%.*]] = shufflevector <8 x i32> [[TMP2]], <8 x i32> [[TMP3]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>189; AVX512-NEXT:    [[DOTUNCASTED:%.*]] = bitcast <8 x i32> [[TMP4]] to <8 x float>190; AVX512-NEXT:    ret <8 x float> [[DOTUNCASTED]]191;192  %a0 = extractelement <8 x float> %a, i32 0193  %a1 = extractelement <8 x float> %a, i32 1194  %a2 = extractelement <8 x float> %a, i32 2195  %a3 = extractelement <8 x float> %a, i32 3196  %a4 = extractelement <8 x float> %a, i32 4197  %a5 = extractelement <8 x float> %a, i32 5198  %a6 = extractelement <8 x float> %a, i32 6199  %a7 = extractelement <8 x float> %a, i32 7200  %aa0 = bitcast float %a0 to i32201  %aa1 = bitcast float %a1 to i32202  %aa2 = bitcast float %a2 to i32203  %aa3 = bitcast float %a3 to i32204  %aa4 = bitcast float %a4 to i32205  %aa5 = bitcast float %a5 to i32206  %aa6 = bitcast float %a6 to i32207  %aa7 = bitcast float %a7 to i32208  %ab0 = xor i32 %aa0, -2147483648209  %ab1 = xor i32 %aa1, -2147483648210  %ab2 = xor i32 %aa2, -2147483648211  %ab3 = xor i32 %aa3, -2147483648212  %ab4 = and i32 %aa4, 2147483647213  %ab5 = and i32 %aa5, 2147483647214  %ab6 = and i32 %aa6, 2147483647215  %ab7 = and i32 %aa7, 2147483647216  %ac0 = bitcast i32 %ab0 to float217  %ac1 = bitcast i32 %ab1 to float218  %ac2 = bitcast i32 %ab2 to float219  %ac3 = bitcast i32 %ab3 to float220  %ac4 = bitcast i32 %ab4 to float221  %ac5 = bitcast i32 %ab5 to float222  %ac6 = bitcast i32 %ab6 to float223  %ac7 = bitcast i32 %ab7 to float224  %r0 = insertelement <8 x float> undef, float %ac0, i32 0225  %r1 = insertelement <8 x float>   %r0, float %ac1, i32 1226  %r2 = insertelement <8 x float>   %r1, float %ac2, i32 2227  %r3 = insertelement <8 x float>   %r2, float %ac3, i32 3228  %r4 = insertelement <8 x float>   %r3, float %ac4, i32 4229  %r5 = insertelement <8 x float>   %r4, float %ac5, i32 5230  %r6 = insertelement <8 x float>   %r5, float %ac6, i32 6231  %r7 = insertelement <8 x float>   %r6, float %ac7, i32 7232  ret <8 x float> %r7233}234 235define <8 x i32> @sext_zext(<8 x i16> %a) {236; SSE2-LABEL: @sext_zext(237; SSE2-NEXT:    [[TMP1:%.*]] = shufflevector <8 x i16> [[A:%.*]], <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>238; SSE2-NEXT:    [[TMP2:%.*]] = sext <4 x i16> [[TMP1]] to <4 x i32>239; SSE2-NEXT:    [[TMP3:%.*]] = shufflevector <8 x i16> [[A]], <8 x i16> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>240; SSE2-NEXT:    [[TMP4:%.*]] = zext <4 x i16> [[TMP3]] to <4 x i32>241; SSE2-NEXT:    [[TMP6:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>242; SSE2-NEXT:    [[TMP7:%.*]] = shufflevector <4 x i32> [[TMP4]], <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>243; SSE2-NEXT:    [[TMP5:%.*]] = shufflevector <8 x i32> [[TMP6]], <8 x i32> [[TMP7]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>244; SSE2-NEXT:    ret <8 x i32> [[TMP5]]245;246; SLM-LABEL: @sext_zext(247; SLM-NEXT:    [[TMP1:%.*]] = shufflevector <8 x i16> [[A:%.*]], <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>248; SLM-NEXT:    [[TMP2:%.*]] = sext <4 x i16> [[TMP1]] to <4 x i32>249; SLM-NEXT:    [[TMP3:%.*]] = shufflevector <8 x i16> [[A]], <8 x i16> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>250; SLM-NEXT:    [[TMP4:%.*]] = zext <4 x i16> [[TMP3]] to <4 x i32>251; SLM-NEXT:    [[TMP6:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>252; SLM-NEXT:    [[TMP7:%.*]] = shufflevector <4 x i32> [[TMP4]], <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>253; SLM-NEXT:    [[TMP5:%.*]] = shufflevector <8 x i32> [[TMP6]], <8 x i32> [[TMP7]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>254; SLM-NEXT:    ret <8 x i32> [[TMP5]]255;256; AVX-LABEL: @sext_zext(257; AVX-NEXT:    [[TMP1:%.*]] = sext <8 x i16> [[A:%.*]] to <8 x i32>258; AVX-NEXT:    [[TMP2:%.*]] = zext <8 x i16> [[A]] to <8 x i32>259; AVX-NEXT:    [[TMP3:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>260; AVX-NEXT:    ret <8 x i32> [[TMP3]]261;262; AVX2-LABEL: @sext_zext(263; AVX2-NEXT:    [[TMP1:%.*]] = sext <8 x i16> [[A:%.*]] to <8 x i32>264; AVX2-NEXT:    [[TMP2:%.*]] = zext <8 x i16> [[A]] to <8 x i32>265; AVX2-NEXT:    [[TMP3:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>266; AVX2-NEXT:    ret <8 x i32> [[TMP3]]267;268; AVX512-LABEL: @sext_zext(269; AVX512-NEXT:    [[TMP1:%.*]] = sext <8 x i16> [[A:%.*]] to <8 x i32>270; AVX512-NEXT:    [[TMP2:%.*]] = zext <8 x i16> [[A]] to <8 x i32>271; AVX512-NEXT:    [[TMP3:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15>272; AVX512-NEXT:    ret <8 x i32> [[TMP3]]273;274  %a0 = extractelement <8 x i16> %a, i32 0275  %a1 = extractelement <8 x i16> %a, i32 1276  %a2 = extractelement <8 x i16> %a, i32 2277  %a3 = extractelement <8 x i16> %a, i32 3278  %a4 = extractelement <8 x i16> %a, i32 4279  %a5 = extractelement <8 x i16> %a, i32 5280  %a6 = extractelement <8 x i16> %a, i32 6281  %a7 = extractelement <8 x i16> %a, i32 7282  %ab0 = sext i16 %a0 to i32283  %ab1 = sext i16 %a1 to i32284  %ab2 = sext i16 %a2 to i32285  %ab3 = sext i16 %a3 to i32286  %ab4 = zext i16 %a4 to i32287  %ab5 = zext i16 %a5 to i32288  %ab6 = zext i16 %a6 to i32289  %ab7 = zext i16 %a7 to i32290  %r0 = insertelement <8 x i32> undef, i32 %ab0, i32 0291  %r1 = insertelement <8 x i32>   %r0, i32 %ab1, i32 1292  %r2 = insertelement <8 x i32>   %r1, i32 %ab2, i32 2293  %r3 = insertelement <8 x i32>   %r2, i32 %ab3, i32 3294  %r4 = insertelement <8 x i32>   %r3, i32 %ab4, i32 4295  %r5 = insertelement <8 x i32>   %r4, i32 %ab5, i32 5296  %r6 = insertelement <8 x i32>   %r5, i32 %ab6, i32 6297  %r7 = insertelement <8 x i32>   %r6, i32 %ab7, i32 7298  ret <8 x i32> %r7299}300 301define <8 x float> @sitofp_4i32_8i16(<4 x i32> %a, <8 x i16> %b) {302; CHECK-LABEL: @sitofp_4i32_8i16(303; CHECK-NEXT:    [[TMP1:%.*]] = sitofp <4 x i32> [[A:%.*]] to <4 x float>304; CHECK-NEXT:    [[TMP2:%.*]] = shufflevector <8 x i16> [[B:%.*]], <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>305; CHECK-NEXT:    [[TMP3:%.*]] = sitofp <4 x i16> [[TMP2]] to <4 x float>306; CHECK-NEXT:    [[TMP4:%.*]] = shufflevector <4 x float> [[TMP1]], <4 x float> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>307; CHECK-NEXT:    [[TMP5:%.*]] = shufflevector <4 x float> [[TMP3]], <4 x float> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>308; CHECK-NEXT:    [[R71:%.*]] = shufflevector <8 x float> [[TMP4]], <8 x float> [[TMP5]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>309; CHECK-NEXT:    ret <8 x float> [[R71]]310;311  %a0 = extractelement <4 x i32> %a, i32 0312  %a1 = extractelement <4 x i32> %a, i32 1313  %a2 = extractelement <4 x i32> %a, i32 2314  %a3 = extractelement <4 x i32> %a, i32 3315  %b0 = extractelement <8 x i16> %b, i32 0316  %b1 = extractelement <8 x i16> %b, i32 1317  %b2 = extractelement <8 x i16> %b, i32 2318  %b3 = extractelement <8 x i16> %b, i32 3319  %ab0 = sitofp i32 %a0 to float320  %ab1 = sitofp i32 %a1 to float321  %ab2 = sitofp i32 %a2 to float322  %ab3 = sitofp i32 %a3 to float323  %ab4 = sitofp i16 %b0 to float324  %ab5 = sitofp i16 %b1 to float325  %ab6 = sitofp i16 %b2 to float326  %ab7 = sitofp i16 %b3 to float327  %r0 = insertelement <8 x float> undef, float %ab0, i32 0328  %r1 = insertelement <8 x float>   %r0, float %ab1, i32 1329  %r2 = insertelement <8 x float>   %r1, float %ab2, i32 2330  %r3 = insertelement <8 x float>   %r2, float %ab3, i32 3331  %r4 = insertelement <8 x float>   %r3, float %ab4, i32 4332  %r5 = insertelement <8 x float>   %r4, float %ab5, i32 5333  %r6 = insertelement <8 x float>   %r5, float %ab6, i32 6334  %r7 = insertelement <8 x float>   %r6, float %ab7, i32 7335  ret <8 x float> %r7336}337 338; Inspired by PR38154339define <8 x float> @sitofp_uitofp_4i32_8i16_16i8(<4 x i32> %a, <8 x i16> %b, <16 x i8> %c) {340; CHECK-LABEL: @sitofp_uitofp_4i32_8i16_16i8(341; CHECK-NEXT:    [[TMP1:%.*]] = sitofp <4 x i32> [[A:%.*]] to <4 x float>342; CHECK-NEXT:    [[TMP2:%.*]] = uitofp <4 x i32> [[A]] to <4 x float>343; CHECK-NEXT:    [[TMP3:%.*]] = shufflevector <4 x float> [[TMP1]], <4 x float> [[TMP2]], <4 x i32> <i32 0, i32 1, i32 6, i32 7>344; CHECK-NEXT:    [[TMP4:%.*]] = shufflevector <8 x i16> [[B:%.*]], <8 x i16> poison, <2 x i32> <i32 0, i32 1>345; CHECK-NEXT:    [[TMP5:%.*]] = sitofp <2 x i16> [[TMP4]] to <2 x float>346; CHECK-NEXT:    [[TMP6:%.*]] = uitofp <2 x i16> [[TMP4]] to <2 x float>347; CHECK-NEXT:    [[TMP7:%.*]] = shufflevector <2 x float> [[TMP5]], <2 x float> [[TMP6]], <2 x i32> <i32 0, i32 3>348; CHECK-NEXT:    [[TMP8:%.*]] = shufflevector <16 x i8> [[C:%.*]], <16 x i8> poison, <2 x i32> <i32 0, i32 1>349; CHECK-NEXT:    [[TMP9:%.*]] = sitofp <2 x i8> [[TMP8]] to <2 x float>350; CHECK-NEXT:    [[TMP10:%.*]] = uitofp <2 x i8> [[TMP8]] to <2 x float>351; CHECK-NEXT:    [[TMP11:%.*]] = shufflevector <2 x float> [[TMP9]], <2 x float> [[TMP10]], <2 x i32> <i32 0, i32 3>352; CHECK-NEXT:    [[TMP12:%.*]] = shufflevector <4 x float> [[TMP3]], <4 x float> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>353; CHECK-NEXT:    [[TMP13:%.*]] = shufflevector <2 x float> [[TMP7]], <2 x float> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>354; CHECK-NEXT:    [[R52:%.*]] = shufflevector <8 x float> [[TMP12]], <8 x float> [[TMP13]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 6, i32 7>355; CHECK-NEXT:    [[TMP14:%.*]] = shufflevector <2 x float> [[TMP11]], <2 x float> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>356; CHECK-NEXT:    [[R71:%.*]] = shufflevector <8 x float> [[R52]], <8 x float> [[TMP14]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 8, i32 9>357; CHECK-NEXT:    ret <8 x float> [[R71]]358;359  %a0 = extractelement <4 x i32> %a, i32 0360  %a1 = extractelement <4 x i32> %a, i32 1361  %a2 = extractelement <4 x i32> %a, i32 2362  %a3 = extractelement <4 x i32> %a, i32 3363  %b0 = extractelement <8 x i16> %b, i32 0364  %b1 = extractelement <8 x i16> %b, i32 1365  %c0 = extractelement <16 x i8> %c, i32 0366  %c1 = extractelement <16 x i8> %c, i32 1367  %ab0 = sitofp i32 %a0 to float368  %ab1 = sitofp i32 %a1 to float369  %ab2 = uitofp i32 %a2 to float370  %ab3 = uitofp i32 %a3 to float371  %ab4 = sitofp i16 %b0 to float372  %ab5 = uitofp i16 %b1 to float373  %ab6 = sitofp  i8 %c0 to float374  %ab7 = uitofp  i8 %c1 to float375  %r0 = insertelement <8 x float> undef, float %ab0, i32 0376  %r1 = insertelement <8 x float>   %r0, float %ab1, i32 1377  %r2 = insertelement <8 x float>   %r1, float %ab2, i32 2378  %r3 = insertelement <8 x float>   %r2, float %ab3, i32 3379  %r4 = insertelement <8 x float>   %r3, float %ab4, i32 4380  %r5 = insertelement <8 x float>   %r4, float %ab5, i32 5381  %r6 = insertelement <8 x float>   %r5, float %ab6, i32 6382  %r7 = insertelement <8 x float>   %r6, float %ab7, i32 7383  ret <8 x float> %r7384}385