604 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -verify-machineinstrs -mtriple=x86_64-unkown-unknown -mattr=+kl,widekl | FileCheck %s --check-prefix=X643; RUN: llc < %s -verify-machineinstrs -mtriple=i386-unkown-unknown -mattr=+kl,widekl -mattr=+avx2 | FileCheck %s --check-prefix=X864; RUN: llc < %s -verify-machineinstrs -mtriple=x86_64-unkown-unknown -mattr=+widekl | FileCheck %s --check-prefix=X645; RUN: llc < %s -verify-machineinstrs -mtriple=i386-unkown-unknown -mattr=+widekl -mattr=+avx2 | FileCheck %s --check-prefix=X866 7declare void @llvm.x86.loadiwkey(<2 x i64>, <2 x i64>, <2 x i64>, i32)8declare { i32, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @llvm.x86.encodekey128(i32, <2 x i64>)9declare { i32, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @llvm.x86.encodekey256(i32, <2 x i64>, <2 x i64>)10declare { i8, <2 x i64> } @llvm.x86.aesenc128kl(<2 x i64>, ptr)11declare { i8, <2 x i64> } @llvm.x86.aesdec128kl(<2 x i64>, ptr)12declare { i8, <2 x i64> } @llvm.x86.aesenc256kl(<2 x i64>, ptr)13declare { i8, <2 x i64> } @llvm.x86.aesdec256kl(<2 x i64>, ptr)14declare { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @llvm.x86.aesencwide128kl(ptr, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>)15declare { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @llvm.x86.aesdecwide128kl(ptr, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>)16declare { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @llvm.x86.aesencwide256kl(ptr, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>)17declare { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @llvm.x86.aesdecwide256kl(ptr, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>)18 19define void @test_loadiwkey(i32 %ctl, <2 x i64> %intkey, <2 x i64> %enkey_lo, <2 x i64> %enkey_hi) {20; X64-LABEL: test_loadiwkey:21; X64: # %bb.0: # %entry22; X64-NEXT: movl %edi, %eax23; X64-NEXT: loadiwkey %xmm2, %xmm124; X64-NEXT: retq25;26; X86-LABEL: test_loadiwkey:27; X86: # %bb.0: # %entry28; X86-NEXT: movl {{[0-9]+}}(%esp), %eax29; X86-NEXT: loadiwkey %xmm2, %xmm130; X86-NEXT: retl31entry:32 tail call void @llvm.x86.loadiwkey(<2 x i64> %intkey, <2 x i64> %enkey_lo, <2 x i64> %enkey_hi, i32 %ctl)33 ret void34}35 36define i32 @test_encodekey128_u32(i32 %htype, <2 x i64> %key, ptr nocapture %h0, ptr nocapture %h1, ptr nocapture %h2, ptr nocapture %h3, ptr nocapture %h4, ptr nocapture %h5) nounwind {37; X64-LABEL: test_encodekey128_u32:38; X64: # %bb.0: # %entry39; X64-NEXT: encodekey128 %edi, %eax40; X64-NEXT: movaps %xmm0, (%rsi)41; X64-NEXT: movaps %xmm1, (%rdx)42; X64-NEXT: movaps %xmm2, (%rcx)43; X64-NEXT: retq44;45; X86-LABEL: test_encodekey128_u32:46; X86: # %bb.0: # %entry47; X86-NEXT: pushl %esi48; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx49; X86-NEXT: movl {{[0-9]+}}(%esp), %edx50; X86-NEXT: movl {{[0-9]+}}(%esp), %esi51; X86-NEXT: movl {{[0-9]+}}(%esp), %eax52; X86-NEXT: encodekey128 %eax, %eax53; X86-NEXT: vmovaps %xmm0, (%esi)54; X86-NEXT: vmovaps %xmm1, (%edx)55; X86-NEXT: vmovaps %xmm2, (%ecx)56; X86-NEXT: popl %esi57; X86-NEXT: retl58entry:59 %0 = tail call { i32, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @llvm.x86.encodekey128(i32 %htype, <2 x i64> %key)60 %1 = extractvalue { i32, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 161 store <2 x i64> %1, ptr %h0, align 1662 %2 = extractvalue { i32, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 263 store <2 x i64> %2, ptr %h1, align 1664 %3 = extractvalue { i32, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 365 store <2 x i64> %3, ptr %h2, align 1666 %4 = extractvalue { i32, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 067 ret i32 %468}69 70define i32 @test_encodekey256_u32(i32 %htype, <2 x i64> %key_lo, <2 x i64> %key_hi, ptr nocapture %h0, ptr nocapture %h1, ptr nocapture %h2, ptr nocapture %h3, ptr nocapture %h4, ptr nocapture %h5, ptr nocapture readnone %h6) nounwind {71; X64-LABEL: test_encodekey256_u32:72; X64: # %bb.0: # %entry73; X64-NEXT: encodekey256 %edi, %eax74; X64-NEXT: movaps %xmm0, (%rsi)75; X64-NEXT: movaps %xmm1, (%rdx)76; X64-NEXT: movaps %xmm2, (%rcx)77; X64-NEXT: movaps %xmm3, (%r8)78; X64-NEXT: retq79;80; X86-LABEL: test_encodekey256_u32:81; X86: # %bb.0: # %entry82; X86-NEXT: pushl %edi83; X86-NEXT: pushl %esi84; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx85; X86-NEXT: movl {{[0-9]+}}(%esp), %edx86; X86-NEXT: movl {{[0-9]+}}(%esp), %esi87; X86-NEXT: movl {{[0-9]+}}(%esp), %edi88; X86-NEXT: movl {{[0-9]+}}(%esp), %eax89; X86-NEXT: encodekey256 %eax, %eax90; X86-NEXT: vmovaps %xmm0, (%edi)91; X86-NEXT: vmovaps %xmm1, (%esi)92; X86-NEXT: vmovaps %xmm2, (%edx)93; X86-NEXT: vmovaps %xmm3, (%ecx)94; X86-NEXT: popl %esi95; X86-NEXT: popl %edi96; X86-NEXT: retl97entry:98 %0 = tail call { i32, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @llvm.x86.encodekey256(i32 %htype, <2 x i64> %key_lo, <2 x i64> %key_hi)99 %1 = extractvalue { i32, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 1100 store <2 x i64> %1, ptr %h0, align 16101 %2 = extractvalue { i32, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 2102 store <2 x i64> %2, ptr %h1, align 16103 %3 = extractvalue { i32, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 3104 store <2 x i64> %3, ptr %h2, align 16105 %4 = extractvalue { i32, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 4106 store <2 x i64> %4, ptr %h3, align 16107 %5 = extractvalue { i32, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 0108 ret i32 %5109}110 111define i8 @test_mm_aesenc128kl_u8(<2 x i64> %data, ptr %h, ptr %out) {112; X64-LABEL: test_mm_aesenc128kl_u8:113; X64: # %bb.0: # %entry114; X64-NEXT: aesenc128kl (%rdi), %xmm0115; X64-NEXT: sete %al116; X64-NEXT: movaps %xmm0, (%rsi)117; X64-NEXT: retq118;119; X86-LABEL: test_mm_aesenc128kl_u8:120; X86: # %bb.0: # %entry121; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx122; X86-NEXT: movl {{[0-9]+}}(%esp), %eax123; X86-NEXT: aesenc128kl (%eax), %xmm0124; X86-NEXT: sete %al125; X86-NEXT: vmovaps %xmm0, (%ecx)126; X86-NEXT: retl127entry:128 %0 = tail call { i8, <2 x i64> } @llvm.x86.aesenc128kl(<2 x i64> %data, ptr %h)129 %1 = extractvalue { i8, <2 x i64> } %0, 1130 store <2 x i64> %1, ptr %out131 %2 = extractvalue { i8, <2 x i64> } %0, 0132 ret i8 %2133}134 135define i8 @test_mm_aesdec128kl_u8(<2 x i64> %data, ptr %h, ptr %out) {136; X64-LABEL: test_mm_aesdec128kl_u8:137; X64: # %bb.0: # %entry138; X64-NEXT: aesdec128kl (%rdi), %xmm0139; X64-NEXT: sete %al140; X64-NEXT: movaps %xmm0, (%rsi)141; X64-NEXT: retq142;143; X86-LABEL: test_mm_aesdec128kl_u8:144; X86: # %bb.0: # %entry145; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx146; X86-NEXT: movl {{[0-9]+}}(%esp), %eax147; X86-NEXT: aesdec128kl (%eax), %xmm0148; X86-NEXT: sete %al149; X86-NEXT: vmovaps %xmm0, (%ecx)150; X86-NEXT: retl151entry:152 %0 = tail call { i8, <2 x i64> } @llvm.x86.aesdec128kl(<2 x i64> %data, ptr %h)153 %1 = extractvalue { i8, <2 x i64> } %0, 1154 store <2 x i64> %1, ptr %out155 %2 = extractvalue { i8, <2 x i64> } %0, 0156 ret i8 %2157}158 159define i8 @test_mm_aesenc256kl_u8(<2 x i64> %data, ptr %h, ptr %out) {160; X64-LABEL: test_mm_aesenc256kl_u8:161; X64: # %bb.0: # %entry162; X64-NEXT: aesenc256kl (%rdi), %xmm0163; X64-NEXT: sete %al164; X64-NEXT: movaps %xmm0, (%rsi)165; X64-NEXT: retq166;167; X86-LABEL: test_mm_aesenc256kl_u8:168; X86: # %bb.0: # %entry169; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx170; X86-NEXT: movl {{[0-9]+}}(%esp), %eax171; X86-NEXT: aesenc256kl (%eax), %xmm0172; X86-NEXT: sete %al173; X86-NEXT: vmovaps %xmm0, (%ecx)174; X86-NEXT: retl175entry:176 %0 = tail call { i8, <2 x i64> } @llvm.x86.aesenc256kl(<2 x i64> %data, ptr %h)177 %1 = extractvalue { i8, <2 x i64> } %0, 1178 store <2 x i64> %1, ptr %out179 %2 = extractvalue { i8, <2 x i64> } %0, 0180 ret i8 %2181}182 183define i8 @test_mm_aesdec256kl_u8(<2 x i64> %data, ptr %h, ptr %out) {184; X64-LABEL: test_mm_aesdec256kl_u8:185; X64: # %bb.0: # %entry186; X64-NEXT: aesdec256kl (%rdi), %xmm0187; X64-NEXT: sete %al188; X64-NEXT: movaps %xmm0, (%rsi)189; X64-NEXT: retq190;191; X86-LABEL: test_mm_aesdec256kl_u8:192; X86: # %bb.0: # %entry193; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx194; X86-NEXT: movl {{[0-9]+}}(%esp), %eax195; X86-NEXT: aesdec256kl (%eax), %xmm0196; X86-NEXT: sete %al197; X86-NEXT: vmovaps %xmm0, (%ecx)198; X86-NEXT: retl199entry:200 %0 = tail call { i8, <2 x i64> } @llvm.x86.aesdec256kl(<2 x i64> %data, ptr %h)201 %1 = extractvalue { i8, <2 x i64> } %0, 1202 store <2 x i64> %1, ptr %out203 %2 = extractvalue { i8, <2 x i64> } %0, 0204 ret i8 %2205}206 207define i8 @test_mm_aesencwide128kl_u8(ptr %p, <2 x i64> %v0, <2 x i64> %v1, <2 x i64> %v2, <2 x i64> %v3, <2 x i64> %v4, <2 x i64> %v5, <2 x i64> %v6, <2 x i64> %v7, ptr %out0, ptr %out1, ptr %out2, ptr %out3, ptr %out4, ptr %out5, ptr %out6, ptr %out7) nounwind {208; X64-LABEL: test_mm_aesencwide128kl_u8:209; X64: # %bb.0: # %entry210; X64-NEXT: pushq %rbx211; X64-NEXT: movq {{[0-9]+}}(%rsp), %r10212; X64-NEXT: movq {{[0-9]+}}(%rsp), %r11213; X64-NEXT: movq {{[0-9]+}}(%rsp), %rbx214; X64-NEXT: aesencwide128kl (%rdi)215; X64-NEXT: sete %al216; X64-NEXT: movaps %xmm0, (%rsi)217; X64-NEXT: movaps %xmm1, (%rdx)218; X64-NEXT: movaps %xmm1, (%rcx)219; X64-NEXT: movaps %xmm1, (%r8)220; X64-NEXT: movaps %xmm1, (%r9)221; X64-NEXT: movaps %xmm1, (%rbx)222; X64-NEXT: movaps %xmm1, (%r11)223; X64-NEXT: movaps %xmm1, (%r10)224; X64-NEXT: popq %rbx225; X64-NEXT: retq226;227; X86-LABEL: test_mm_aesencwide128kl_u8:228; X86: # %bb.0: # %entry229; X86-NEXT: pushl %ebp230; X86-NEXT: movl %esp, %ebp231; X86-NEXT: andl $-16, %esp232; X86-NEXT: subl $16, %esp233; X86-NEXT: vmovaps 24(%ebp), %xmm3234; X86-NEXT: vmovaps 40(%ebp), %xmm4235; X86-NEXT: vmovaps 56(%ebp), %xmm5236; X86-NEXT: vmovaps 72(%ebp), %xmm6237; X86-NEXT: vmovaps 88(%ebp), %xmm7238; X86-NEXT: movl 8(%ebp), %eax239; X86-NEXT: aesencwide128kl (%eax)240; X86-NEXT: movl 104(%ebp), %eax241; X86-NEXT: vmovaps %xmm0, (%eax)242; X86-NEXT: movl 108(%ebp), %eax243; X86-NEXT: vmovaps %xmm1, (%eax)244; X86-NEXT: movl 112(%ebp), %eax245; X86-NEXT: vmovaps %xmm1, (%eax)246; X86-NEXT: movl 116(%ebp), %eax247; X86-NEXT: vmovaps %xmm1, (%eax)248; X86-NEXT: movl 120(%ebp), %eax249; X86-NEXT: vmovaps %xmm1, (%eax)250; X86-NEXT: movl 124(%ebp), %eax251; X86-NEXT: vmovaps %xmm1, (%eax)252; X86-NEXT: movl 128(%ebp), %eax253; X86-NEXT: vmovaps %xmm1, (%eax)254; X86-NEXT: movl 132(%ebp), %eax255; X86-NEXT: vmovaps %xmm1, (%eax)256; X86-NEXT: sete %al257; X86-NEXT: movl %ebp, %esp258; X86-NEXT: popl %ebp259; X86-NEXT: retl260entry:261 %0 = call { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @llvm.x86.aesencwide128kl(ptr %p, <2 x i64> %v0, <2 x i64> %v1, <2 x i64> %v2, <2 x i64> %v3, <2 x i64> %v4, <2 x i64> %v5, <2 x i64> %v6, <2 x i64> %v7)262 %1 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 1263 store <2 x i64> %1, ptr %out0264 %2 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 2265 store <2 x i64> %2, ptr %out1266 %3 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 3267 store <2 x i64> %2, ptr %out2268 %4 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 4269 store <2 x i64> %2, ptr %out3270 %5 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 5271 store <2 x i64> %2, ptr %out4272 %6 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 6273 store <2 x i64> %2, ptr %out5274 %7 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 7275 store <2 x i64> %2, ptr %out6276 %8 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 8277 store <2 x i64> %2, ptr %out7278 %9 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 0279 ret i8 %9280}281 282define i8 @test_mm_aesdecwide128kl_u8(ptr %p, <2 x i64> %v0, <2 x i64> %v1, <2 x i64> %v2, <2 x i64> %v3, <2 x i64> %v4, <2 x i64> %v5, <2 x i64> %v6, <2 x i64> %v7, ptr %out0, ptr %out1, ptr %out2, ptr %out3, ptr %out4, ptr %out5, ptr %out6, ptr %out7) nounwind {283; X64-LABEL: test_mm_aesdecwide128kl_u8:284; X64: # %bb.0: # %entry285; X64-NEXT: pushq %rbx286; X64-NEXT: movq {{[0-9]+}}(%rsp), %r10287; X64-NEXT: movq {{[0-9]+}}(%rsp), %r11288; X64-NEXT: movq {{[0-9]+}}(%rsp), %rbx289; X64-NEXT: aesdecwide128kl (%rdi)290; X64-NEXT: sete %al291; X64-NEXT: movaps %xmm0, (%rsi)292; X64-NEXT: movaps %xmm1, (%rdx)293; X64-NEXT: movaps %xmm1, (%rcx)294; X64-NEXT: movaps %xmm1, (%r8)295; X64-NEXT: movaps %xmm1, (%r9)296; X64-NEXT: movaps %xmm1, (%rbx)297; X64-NEXT: movaps %xmm1, (%r11)298; X64-NEXT: movaps %xmm1, (%r10)299; X64-NEXT: popq %rbx300; X64-NEXT: retq301;302; X86-LABEL: test_mm_aesdecwide128kl_u8:303; X86: # %bb.0: # %entry304; X86-NEXT: pushl %ebp305; X86-NEXT: movl %esp, %ebp306; X86-NEXT: andl $-16, %esp307; X86-NEXT: subl $16, %esp308; X86-NEXT: vmovaps 24(%ebp), %xmm3309; X86-NEXT: vmovaps 40(%ebp), %xmm4310; X86-NEXT: vmovaps 56(%ebp), %xmm5311; X86-NEXT: vmovaps 72(%ebp), %xmm6312; X86-NEXT: vmovaps 88(%ebp), %xmm7313; X86-NEXT: movl 8(%ebp), %eax314; X86-NEXT: aesdecwide128kl (%eax)315; X86-NEXT: movl 104(%ebp), %eax316; X86-NEXT: vmovaps %xmm0, (%eax)317; X86-NEXT: movl 108(%ebp), %eax318; X86-NEXT: vmovaps %xmm1, (%eax)319; X86-NEXT: movl 112(%ebp), %eax320; X86-NEXT: vmovaps %xmm1, (%eax)321; X86-NEXT: movl 116(%ebp), %eax322; X86-NEXT: vmovaps %xmm1, (%eax)323; X86-NEXT: movl 120(%ebp), %eax324; X86-NEXT: vmovaps %xmm1, (%eax)325; X86-NEXT: movl 124(%ebp), %eax326; X86-NEXT: vmovaps %xmm1, (%eax)327; X86-NEXT: movl 128(%ebp), %eax328; X86-NEXT: vmovaps %xmm1, (%eax)329; X86-NEXT: movl 132(%ebp), %eax330; X86-NEXT: vmovaps %xmm1, (%eax)331; X86-NEXT: sete %al332; X86-NEXT: movl %ebp, %esp333; X86-NEXT: popl %ebp334; X86-NEXT: retl335entry:336 %0 = call { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @llvm.x86.aesdecwide128kl(ptr %p, <2 x i64> %v0, <2 x i64> %v1, <2 x i64> %v2, <2 x i64> %v3, <2 x i64> %v4, <2 x i64> %v5, <2 x i64> %v6, <2 x i64> %v7)337 %1 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 1338 store <2 x i64> %1, ptr %out0339 %2 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 2340 store <2 x i64> %2, ptr %out1341 %3 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 3342 store <2 x i64> %2, ptr %out2343 %4 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 4344 store <2 x i64> %2, ptr %out3345 %5 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 5346 store <2 x i64> %2, ptr %out4347 %6 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 6348 store <2 x i64> %2, ptr %out5349 %7 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 7350 store <2 x i64> %2, ptr %out6351 %8 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 8352 store <2 x i64> %2, ptr %out7353 %9 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 0354 ret i8 %9355}356 357define i8 @test_mm_aesencwide256kl_u8(ptr %p, <2 x i64> %v0, <2 x i64> %v1, <2 x i64> %v2, <2 x i64> %v3, <2 x i64> %v4, <2 x i64> %v5, <2 x i64> %v6, <2 x i64> %v7, ptr %out0, ptr %out1, ptr %out2, ptr %out3, ptr %out4, ptr %out5, ptr %out6, ptr %out7) nounwind {358; X64-LABEL: test_mm_aesencwide256kl_u8:359; X64: # %bb.0: # %entry360; X64-NEXT: pushq %rbx361; X64-NEXT: movq {{[0-9]+}}(%rsp), %r10362; X64-NEXT: movq {{[0-9]+}}(%rsp), %r11363; X64-NEXT: movq {{[0-9]+}}(%rsp), %rbx364; X64-NEXT: aesencwide256kl (%rdi)365; X64-NEXT: sete %al366; X64-NEXT: movaps %xmm0, (%rsi)367; X64-NEXT: movaps %xmm1, (%rdx)368; X64-NEXT: movaps %xmm1, (%rcx)369; X64-NEXT: movaps %xmm1, (%r8)370; X64-NEXT: movaps %xmm1, (%r9)371; X64-NEXT: movaps %xmm1, (%rbx)372; X64-NEXT: movaps %xmm1, (%r11)373; X64-NEXT: movaps %xmm1, (%r10)374; X64-NEXT: popq %rbx375; X64-NEXT: retq376;377; X86-LABEL: test_mm_aesencwide256kl_u8:378; X86: # %bb.0: # %entry379; X86-NEXT: pushl %ebp380; X86-NEXT: movl %esp, %ebp381; X86-NEXT: andl $-16, %esp382; X86-NEXT: subl $16, %esp383; X86-NEXT: vmovaps 24(%ebp), %xmm3384; X86-NEXT: vmovaps 40(%ebp), %xmm4385; X86-NEXT: vmovaps 56(%ebp), %xmm5386; X86-NEXT: vmovaps 72(%ebp), %xmm6387; X86-NEXT: vmovaps 88(%ebp), %xmm7388; X86-NEXT: movl 8(%ebp), %eax389; X86-NEXT: aesencwide256kl (%eax)390; X86-NEXT: movl 104(%ebp), %eax391; X86-NEXT: vmovaps %xmm0, (%eax)392; X86-NEXT: movl 108(%ebp), %eax393; X86-NEXT: vmovaps %xmm1, (%eax)394; X86-NEXT: movl 112(%ebp), %eax395; X86-NEXT: vmovaps %xmm1, (%eax)396; X86-NEXT: movl 116(%ebp), %eax397; X86-NEXT: vmovaps %xmm1, (%eax)398; X86-NEXT: movl 120(%ebp), %eax399; X86-NEXT: vmovaps %xmm1, (%eax)400; X86-NEXT: movl 124(%ebp), %eax401; X86-NEXT: vmovaps %xmm1, (%eax)402; X86-NEXT: movl 128(%ebp), %eax403; X86-NEXT: vmovaps %xmm1, (%eax)404; X86-NEXT: movl 132(%ebp), %eax405; X86-NEXT: vmovaps %xmm1, (%eax)406; X86-NEXT: sete %al407; X86-NEXT: movl %ebp, %esp408; X86-NEXT: popl %ebp409; X86-NEXT: retl410entry:411 %0 = call { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @llvm.x86.aesencwide256kl(ptr %p, <2 x i64> %v0, <2 x i64> %v1, <2 x i64> %v2, <2 x i64> %v3, <2 x i64> %v4, <2 x i64> %v5, <2 x i64> %v6, <2 x i64> %v7)412 %1 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 1413 store <2 x i64> %1, ptr %out0414 %2 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 2415 store <2 x i64> %2, ptr %out1416 %3 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 3417 store <2 x i64> %2, ptr %out2418 %4 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 4419 store <2 x i64> %2, ptr %out3420 %5 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 5421 store <2 x i64> %2, ptr %out4422 %6 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 6423 store <2 x i64> %2, ptr %out5424 %7 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 7425 store <2 x i64> %2, ptr %out6426 %8 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 8427 store <2 x i64> %2, ptr %out7428 %9 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 0429 ret i8 %9430}431 432define i8 @test_mm_aesdecwide256kl_u8(ptr %p, <2 x i64> %v0, <2 x i64> %v1, <2 x i64> %v2, <2 x i64> %v3, <2 x i64> %v4, <2 x i64> %v5, <2 x i64> %v6, <2 x i64> %v7, ptr %out0, ptr %out1, ptr %out2, ptr %out3, ptr %out4, ptr %out5, ptr %out6, ptr %out7) nounwind {433; X64-LABEL: test_mm_aesdecwide256kl_u8:434; X64: # %bb.0: # %entry435; X64-NEXT: pushq %rbx436; X64-NEXT: movq {{[0-9]+}}(%rsp), %r10437; X64-NEXT: movq {{[0-9]+}}(%rsp), %r11438; X64-NEXT: movq {{[0-9]+}}(%rsp), %rbx439; X64-NEXT: aesdecwide256kl (%rdi)440; X64-NEXT: sete %al441; X64-NEXT: movaps %xmm0, (%rsi)442; X64-NEXT: movaps %xmm1, (%rdx)443; X64-NEXT: movaps %xmm1, (%rcx)444; X64-NEXT: movaps %xmm1, (%r8)445; X64-NEXT: movaps %xmm1, (%r9)446; X64-NEXT: movaps %xmm1, (%rbx)447; X64-NEXT: movaps %xmm1, (%r11)448; X64-NEXT: movaps %xmm1, (%r10)449; X64-NEXT: popq %rbx450; X64-NEXT: retq451;452; X86-LABEL: test_mm_aesdecwide256kl_u8:453; X86: # %bb.0: # %entry454; X86-NEXT: pushl %ebp455; X86-NEXT: movl %esp, %ebp456; X86-NEXT: andl $-16, %esp457; X86-NEXT: subl $16, %esp458; X86-NEXT: vmovaps 24(%ebp), %xmm3459; X86-NEXT: vmovaps 40(%ebp), %xmm4460; X86-NEXT: vmovaps 56(%ebp), %xmm5461; X86-NEXT: vmovaps 72(%ebp), %xmm6462; X86-NEXT: vmovaps 88(%ebp), %xmm7463; X86-NEXT: movl 8(%ebp), %eax464; X86-NEXT: aesdecwide256kl (%eax)465; X86-NEXT: movl 104(%ebp), %eax466; X86-NEXT: vmovaps %xmm0, (%eax)467; X86-NEXT: movl 108(%ebp), %eax468; X86-NEXT: vmovaps %xmm1, (%eax)469; X86-NEXT: movl 112(%ebp), %eax470; X86-NEXT: vmovaps %xmm1, (%eax)471; X86-NEXT: movl 116(%ebp), %eax472; X86-NEXT: vmovaps %xmm1, (%eax)473; X86-NEXT: movl 120(%ebp), %eax474; X86-NEXT: vmovaps %xmm1, (%eax)475; X86-NEXT: movl 124(%ebp), %eax476; X86-NEXT: vmovaps %xmm1, (%eax)477; X86-NEXT: movl 128(%ebp), %eax478; X86-NEXT: vmovaps %xmm1, (%eax)479; X86-NEXT: movl 132(%ebp), %eax480; X86-NEXT: vmovaps %xmm1, (%eax)481; X86-NEXT: sete %al482; X86-NEXT: movl %ebp, %esp483; X86-NEXT: popl %ebp484; X86-NEXT: retl485entry:486 %0 = call { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @llvm.x86.aesdecwide256kl(ptr %p, <2 x i64> %v0, <2 x i64> %v1, <2 x i64> %v2, <2 x i64> %v3, <2 x i64> %v4, <2 x i64> %v5, <2 x i64> %v6, <2 x i64> %v7)487 %1 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 1488 store <2 x i64> %1, ptr %out0489 %2 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 2490 store <2 x i64> %2, ptr %out1491 %3 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 3492 store <2 x i64> %2, ptr %out2493 %4 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 4494 store <2 x i64> %2, ptr %out3495 %5 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 5496 store <2 x i64> %2, ptr %out4497 %6 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 6498 store <2 x i64> %2, ptr %out5499 %7 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 7500 store <2 x i64> %2, ptr %out6501 %8 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 8502 store <2 x i64> %2, ptr %out7503 %9 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 0504 ret i8 %9505}506 507; Tests to make sure we can select an appropriate addressing mode for a global.508 509@foo = external dso_local global [64 x i8]510 511define i8 @test_mm_aesenc256kl_u8_global(<2 x i64> %data, ptr %out) {512; X64-LABEL: test_mm_aesenc256kl_u8_global:513; X64: # %bb.0: # %entry514; X64-NEXT: aesenc256kl foo(%rip), %xmm0515; X64-NEXT: sete %al516; X64-NEXT: movaps %xmm0, (%rdi)517; X64-NEXT: retq518;519; X86-LABEL: test_mm_aesenc256kl_u8_global:520; X86: # %bb.0: # %entry521; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx522; X86-NEXT: aesenc256kl foo, %xmm0523; X86-NEXT: sete %al524; X86-NEXT: vmovaps %xmm0, (%ecx)525; X86-NEXT: retl526entry:527 %0 = tail call { i8, <2 x i64> } @llvm.x86.aesenc256kl(<2 x i64> %data, ptr @foo)528 %1 = extractvalue { i8, <2 x i64> } %0, 1529 store <2 x i64> %1, ptr %out530 %2 = extractvalue { i8, <2 x i64> } %0, 0531 ret i8 %2532}533 534define i8 @test_mm_aesdecwide256kl_u8_global(<2 x i64> %v0, <2 x i64> %v1, <2 x i64> %v2, <2 x i64> %v3, <2 x i64> %v4, <2 x i64> %v5, <2 x i64> %v6, <2 x i64> %v7, ptr %out0, ptr %out1, ptr %out2, ptr %out3, ptr %out4, ptr %out5, ptr %out6, ptr %out7) nounwind {535; X64-LABEL: test_mm_aesdecwide256kl_u8_global:536; X64: # %bb.0: # %entry537; X64-NEXT: movq {{[0-9]+}}(%rsp), %r10538; X64-NEXT: movq {{[0-9]+}}(%rsp), %r11539; X64-NEXT: aesdecwide256kl foo(%rip)540; X64-NEXT: sete %al541; X64-NEXT: movaps %xmm0, (%rdi)542; X64-NEXT: movaps %xmm1, (%rsi)543; X64-NEXT: movaps %xmm1, (%rdx)544; X64-NEXT: movaps %xmm1, (%rcx)545; X64-NEXT: movaps %xmm1, (%r8)546; X64-NEXT: movaps %xmm1, (%r9)547; X64-NEXT: movaps %xmm1, (%r11)548; X64-NEXT: movaps %xmm1, (%r10)549; X64-NEXT: retq550;551; X86-LABEL: test_mm_aesdecwide256kl_u8_global:552; X86: # %bb.0: # %entry553; X86-NEXT: pushl %ebp554; X86-NEXT: movl %esp, %ebp555; X86-NEXT: andl $-16, %esp556; X86-NEXT: subl $16, %esp557; X86-NEXT: movl 88(%ebp), %eax558; X86-NEXT: vmovaps 8(%ebp), %xmm3559; X86-NEXT: vmovaps 24(%ebp), %xmm4560; X86-NEXT: vmovaps 40(%ebp), %xmm5561; X86-NEXT: vmovaps 56(%ebp), %xmm6562; X86-NEXT: vmovaps 72(%ebp), %xmm7563; X86-NEXT: aesdecwide256kl foo564; X86-NEXT: vmovaps %xmm0, (%eax)565; X86-NEXT: movl 92(%ebp), %eax566; X86-NEXT: vmovaps %xmm1, (%eax)567; X86-NEXT: movl 96(%ebp), %eax568; X86-NEXT: vmovaps %xmm1, (%eax)569; X86-NEXT: movl 100(%ebp), %eax570; X86-NEXT: vmovaps %xmm1, (%eax)571; X86-NEXT: movl 104(%ebp), %eax572; X86-NEXT: vmovaps %xmm1, (%eax)573; X86-NEXT: movl 108(%ebp), %eax574; X86-NEXT: vmovaps %xmm1, (%eax)575; X86-NEXT: movl 112(%ebp), %eax576; X86-NEXT: vmovaps %xmm1, (%eax)577; X86-NEXT: movl 116(%ebp), %eax578; X86-NEXT: vmovaps %xmm1, (%eax)579; X86-NEXT: sete %al580; X86-NEXT: movl %ebp, %esp581; X86-NEXT: popl %ebp582; X86-NEXT: retl583entry:584 %0 = call { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @llvm.x86.aesdecwide256kl(ptr @foo, <2 x i64> %v0, <2 x i64> %v1, <2 x i64> %v2, <2 x i64> %v3, <2 x i64> %v4, <2 x i64> %v5, <2 x i64> %v6, <2 x i64> %v7)585 %1 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 1586 store <2 x i64> %1, ptr %out0587 %2 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 2588 store <2 x i64> %2, ptr %out1589 %3 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 3590 store <2 x i64> %2, ptr %out2591 %4 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 4592 store <2 x i64> %2, ptr %out3593 %5 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 5594 store <2 x i64> %2, ptr %out4595 %6 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 6596 store <2 x i64> %2, ptr %out5597 %7 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 7598 store <2 x i64> %2, ptr %out6599 %8 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 8600 store <2 x i64> %2, ptr %out7601 %9 = extractvalue { i8, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } %0, 0602 ret i8 %9603}604