308 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i686-unknown -mattr=+sse4.2 | FileCheck %s --check-prefix=X863; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse4.2 | FileCheck %s --check-prefix=X644 5;6; AND/XOR/OR i24 as v3i87;8 9define i24 @and_i24_as_v3i8(i24 %a, i24 %b) nounwind {10; X86-LABEL: and_i24_as_v3i8:11; X86: # %bb.0:12; X86-NEXT: movl {{[0-9]+}}(%esp), %eax13; X86-NEXT: andl {{[0-9]+}}(%esp), %eax14; X86-NEXT: retl15;16; X64-LABEL: and_i24_as_v3i8:17; X64: # %bb.0:18; X64-NEXT: movl %edi, %eax19; X64-NEXT: andl %esi, %eax20; X64-NEXT: retq21 %1 = bitcast i24 %a to <3 x i8>22 %2 = bitcast i24 %b to <3 x i8>23 %3 = and <3 x i8> %1, %224 %4 = bitcast <3 x i8> %3 to i2425 ret i24 %426}27 28define i24 @xor_i24_as_v3i8(i24 %a, i24 %b) nounwind {29; X86-LABEL: xor_i24_as_v3i8:30; X86: # %bb.0:31; X86-NEXT: movl {{[0-9]+}}(%esp), %eax32; X86-NEXT: xorl {{[0-9]+}}(%esp), %eax33; X86-NEXT: retl34;35; X64-LABEL: xor_i24_as_v3i8:36; X64: # %bb.0:37; X64-NEXT: movl %edi, %eax38; X64-NEXT: xorl %esi, %eax39; X64-NEXT: retq40 %1 = bitcast i24 %a to <3 x i8>41 %2 = bitcast i24 %b to <3 x i8>42 %3 = xor <3 x i8> %1, %243 %4 = bitcast <3 x i8> %3 to i2444 ret i24 %445}46 47define i24 @or_i24_as_v3i8(i24 %a, i24 %b) nounwind {48; X86-LABEL: or_i24_as_v3i8:49; X86: # %bb.0:50; X86-NEXT: movl {{[0-9]+}}(%esp), %eax51; X86-NEXT: orl {{[0-9]+}}(%esp), %eax52; X86-NEXT: retl53;54; X64-LABEL: or_i24_as_v3i8:55; X64: # %bb.0:56; X64-NEXT: movl %edi, %eax57; X64-NEXT: orl %esi, %eax58; X64-NEXT: retq59 %1 = bitcast i24 %a to <3 x i8>60 %2 = bitcast i24 %b to <3 x i8>61 %3 = or <3 x i8> %1, %262 %4 = bitcast <3 x i8> %3 to i2463 ret i24 %464}65 66;67; AND/XOR/OR i24 as v8i368;69 70define i24 @and_i24_as_v8i3(i24 %a, i24 %b) nounwind {71; X86-LABEL: and_i24_as_v8i3:72; X86: # %bb.0:73; X86-NEXT: movl {{[0-9]+}}(%esp), %eax74; X86-NEXT: andl {{[0-9]+}}(%esp), %eax75; X86-NEXT: retl76;77; X64-LABEL: and_i24_as_v8i3:78; X64: # %bb.0:79; X64-NEXT: movl %edi, %eax80; X64-NEXT: andl %esi, %eax81; X64-NEXT: retq82 %1 = bitcast i24 %a to <8 x i3>83 %2 = bitcast i24 %b to <8 x i3>84 %3 = and <8 x i3> %1, %285 %4 = bitcast <8 x i3> %3 to i2486 ret i24 %487}88 89define i24 @xor_i24_as_v8i3(i24 %a, i24 %b) nounwind {90; X86-LABEL: xor_i24_as_v8i3:91; X86: # %bb.0:92; X86-NEXT: movl {{[0-9]+}}(%esp), %eax93; X86-NEXT: xorl {{[0-9]+}}(%esp), %eax94; X86-NEXT: retl95;96; X64-LABEL: xor_i24_as_v8i3:97; X64: # %bb.0:98; X64-NEXT: movl %edi, %eax99; X64-NEXT: xorl %esi, %eax100; X64-NEXT: retq101 %1 = bitcast i24 %a to <8 x i3>102 %2 = bitcast i24 %b to <8 x i3>103 %3 = xor <8 x i3> %1, %2104 %4 = bitcast <8 x i3> %3 to i24105 ret i24 %4106}107 108define i24 @or_i24_as_v8i3(i24 %a, i24 %b) nounwind {109; X86-LABEL: or_i24_as_v8i3:110; X86: # %bb.0:111; X86-NEXT: movl {{[0-9]+}}(%esp), %eax112; X86-NEXT: orl {{[0-9]+}}(%esp), %eax113; X86-NEXT: retl114;115; X64-LABEL: or_i24_as_v8i3:116; X64: # %bb.0:117; X64-NEXT: movl %edi, %eax118; X64-NEXT: orl %esi, %eax119; X64-NEXT: retq120 %1 = bitcast i24 %a to <8 x i3>121 %2 = bitcast i24 %b to <8 x i3>122 %3 = or <8 x i3> %1, %2123 %4 = bitcast <8 x i3> %3 to i24124 ret i24 %4125}126 127;128; AND/XOR/OR v3i8 as i24129;130 131define <3 x i8> @and_v3i8_as_i24(<3 x i8> %a, <3 x i8> %b) nounwind {132; X86-LABEL: and_v3i8_as_i24:133; X86: # %bb.0:134; X86-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero135; X86-NEXT: pinsrb $1, {{[0-9]+}}(%esp), %xmm0136; X86-NEXT: pinsrb $2, {{[0-9]+}}(%esp), %xmm0137; X86-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero138; X86-NEXT: pinsrb $1, {{[0-9]+}}(%esp), %xmm1139; X86-NEXT: pinsrb $2, {{[0-9]+}}(%esp), %xmm1140; X86-NEXT: pand %xmm0, %xmm1141; X86-NEXT: movd %xmm1, %eax142; X86-NEXT: pextrb $1, %xmm1, %edx143; X86-NEXT: pextrb $2, %xmm1, %ecx144; X86-NEXT: # kill: def $al killed $al killed $eax145; X86-NEXT: # kill: def $dl killed $dl killed $edx146; X86-NEXT: # kill: def $cl killed $cl killed $ecx147; X86-NEXT: retl148;149; X64-LABEL: and_v3i8_as_i24:150; X64: # %bb.0:151; X64-NEXT: movd %ecx, %xmm0152; X64-NEXT: pinsrb $1, %r8d, %xmm0153; X64-NEXT: pinsrb $2, %r9d, %xmm0154; X64-NEXT: movd %edi, %xmm1155; X64-NEXT: pinsrb $1, %esi, %xmm1156; X64-NEXT: pinsrb $2, %edx, %xmm1157; X64-NEXT: pand %xmm0, %xmm1158; X64-NEXT: movd %xmm1, %eax159; X64-NEXT: pextrb $1, %xmm1, %edx160; X64-NEXT: pextrb $2, %xmm1, %ecx161; X64-NEXT: # kill: def $al killed $al killed $eax162; X64-NEXT: # kill: def $dl killed $dl killed $edx163; X64-NEXT: # kill: def $cl killed $cl killed $ecx164; X64-NEXT: retq165 %1 = bitcast <3 x i8> %a to i24166 %2 = bitcast <3 x i8> %b to i24167 %3 = and i24 %1, %2168 %4 = bitcast i24 %3 to <3 x i8>169 ret <3 x i8> %4170}171 172define <3 x i8> @xor_v3i8_as_i24(<3 x i8> %a, <3 x i8> %b) nounwind {173; X86-LABEL: xor_v3i8_as_i24:174; X86: # %bb.0:175; X86-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero176; X86-NEXT: pinsrb $1, {{[0-9]+}}(%esp), %xmm0177; X86-NEXT: pinsrb $2, {{[0-9]+}}(%esp), %xmm0178; X86-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero179; X86-NEXT: pinsrb $1, {{[0-9]+}}(%esp), %xmm1180; X86-NEXT: pinsrb $2, {{[0-9]+}}(%esp), %xmm1181; X86-NEXT: pxor %xmm0, %xmm1182; X86-NEXT: movd %xmm1, %eax183; X86-NEXT: pextrb $1, %xmm1, %edx184; X86-NEXT: pextrb $2, %xmm1, %ecx185; X86-NEXT: # kill: def $al killed $al killed $eax186; X86-NEXT: # kill: def $dl killed $dl killed $edx187; X86-NEXT: # kill: def $cl killed $cl killed $ecx188; X86-NEXT: retl189;190; X64-LABEL: xor_v3i8_as_i24:191; X64: # %bb.0:192; X64-NEXT: movd %ecx, %xmm0193; X64-NEXT: pinsrb $1, %r8d, %xmm0194; X64-NEXT: pinsrb $2, %r9d, %xmm0195; X64-NEXT: movd %edi, %xmm1196; X64-NEXT: pinsrb $1, %esi, %xmm1197; X64-NEXT: pinsrb $2, %edx, %xmm1198; X64-NEXT: pxor %xmm0, %xmm1199; X64-NEXT: movd %xmm1, %eax200; X64-NEXT: pextrb $1, %xmm1, %edx201; X64-NEXT: pextrb $2, %xmm1, %ecx202; X64-NEXT: # kill: def $al killed $al killed $eax203; X64-NEXT: # kill: def $dl killed $dl killed $edx204; X64-NEXT: # kill: def $cl killed $cl killed $ecx205; X64-NEXT: retq206 %1 = bitcast <3 x i8> %a to i24207 %2 = bitcast <3 x i8> %b to i24208 %3 = xor i24 %1, %2209 %4 = bitcast i24 %3 to <3 x i8>210 ret <3 x i8> %4211}212 213define <3 x i8> @or_v3i8_as_i24(<3 x i8> %a, <3 x i8> %b) nounwind {214; X86-LABEL: or_v3i8_as_i24:215; X86: # %bb.0:216; X86-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero217; X86-NEXT: pinsrb $1, {{[0-9]+}}(%esp), %xmm0218; X86-NEXT: pinsrb $2, {{[0-9]+}}(%esp), %xmm0219; X86-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero220; X86-NEXT: pinsrb $1, {{[0-9]+}}(%esp), %xmm1221; X86-NEXT: pinsrb $2, {{[0-9]+}}(%esp), %xmm1222; X86-NEXT: por %xmm0, %xmm1223; X86-NEXT: movd %xmm1, %eax224; X86-NEXT: pextrb $1, %xmm1, %edx225; X86-NEXT: pextrb $2, %xmm1, %ecx226; X86-NEXT: # kill: def $al killed $al killed $eax227; X86-NEXT: # kill: def $dl killed $dl killed $edx228; X86-NEXT: # kill: def $cl killed $cl killed $ecx229; X86-NEXT: retl230;231; X64-LABEL: or_v3i8_as_i24:232; X64: # %bb.0:233; X64-NEXT: movd %ecx, %xmm0234; X64-NEXT: pinsrb $1, %r8d, %xmm0235; X64-NEXT: pinsrb $2, %r9d, %xmm0236; X64-NEXT: movd %edi, %xmm1237; X64-NEXT: pinsrb $1, %esi, %xmm1238; X64-NEXT: pinsrb $2, %edx, %xmm1239; X64-NEXT: por %xmm0, %xmm1240; X64-NEXT: movd %xmm1, %eax241; X64-NEXT: pextrb $1, %xmm1, %edx242; X64-NEXT: pextrb $2, %xmm1, %ecx243; X64-NEXT: # kill: def $al killed $al killed $eax244; X64-NEXT: # kill: def $dl killed $dl killed $edx245; X64-NEXT: # kill: def $cl killed $cl killed $ecx246; X64-NEXT: retq247 %1 = bitcast <3 x i8> %a to i24248 %2 = bitcast <3 x i8> %b to i24249 %3 = or i24 %1, %2250 %4 = bitcast i24 %3 to <3 x i8>251 ret <3 x i8> %4252}253 254;255; AND/XOR/OR v8i3 as i24256;257 258define <8 x i3> @and_v8i3_as_i24(<8 x i3> %a, <8 x i3> %b) nounwind {259; X86-LABEL: and_v8i3_as_i24:260; X86: # %bb.0:261; X86-NEXT: andps %xmm1, %xmm0262; X86-NEXT: retl263;264; X64-LABEL: and_v8i3_as_i24:265; X64: # %bb.0:266; X64-NEXT: andps %xmm1, %xmm0267; X64-NEXT: retq268 %1 = bitcast <8 x i3> %a to i24269 %2 = bitcast <8 x i3> %b to i24270 %3 = and i24 %1, %2271 %4 = bitcast i24 %3 to <8 x i3>272 ret <8 x i3> %4273}274 275define <8 x i3> @xor_v8i3_as_i24(<8 x i3> %a, <8 x i3> %b) nounwind {276; X86-LABEL: xor_v8i3_as_i24:277; X86: # %bb.0:278; X86-NEXT: xorps %xmm1, %xmm0279; X86-NEXT: retl280;281; X64-LABEL: xor_v8i3_as_i24:282; X64: # %bb.0:283; X64-NEXT: xorps %xmm1, %xmm0284; X64-NEXT: retq285 %1 = bitcast <8 x i3> %a to i24286 %2 = bitcast <8 x i3> %b to i24287 %3 = xor i24 %1, %2288 %4 = bitcast i24 %3 to <8 x i3>289 ret <8 x i3> %4290}291 292define <8 x i3> @or_v8i3_as_i24(<8 x i3> %a, <8 x i3> %b) nounwind {293; X86-LABEL: or_v8i3_as_i24:294; X86: # %bb.0:295; X86-NEXT: orps %xmm1, %xmm0296; X86-NEXT: retl297;298; X64-LABEL: or_v8i3_as_i24:299; X64: # %bb.0:300; X64-NEXT: orps %xmm1, %xmm0301; X64-NEXT: retq302 %1 = bitcast <8 x i3> %a to i24303 %2 = bitcast <8 x i3> %b to i24304 %3 = or i24 %1, %2305 %4 = bitcast i24 %3 to <8 x i3>306 ret <8 x i3> %4307}308