278 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i386-pc-win32 -mcpu=nehalem | FileCheck -check-prefix=WIN32 %s3; RUN: llc < %s -mtriple=x86_64-win32 -mcpu=nehalem | FileCheck -check-prefix=WIN64 %s4; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=nehalem | FileCheck -check-prefix=NOT_WIN %s5 6declare <16 x float> @func_float16_ptr(<16 x float>, ptr)7declare <16 x float> @func_float16(<16 x float>, <16 x float>)8 9;test calling conventions - input parameters10define <16 x float> @testf16_inp(<16 x float> %a, <16 x float> %b) nounwind {11; WIN32-LABEL: testf16_inp:12; WIN32: # %bb.0:13; WIN32-NEXT: pushl %ebp14; WIN32-NEXT: movl %esp, %ebp15; WIN32-NEXT: andl $-16, %esp16; WIN32-NEXT: subl $80, %esp17; WIN32-NEXT: movups 72(%ebp), %xmm418; WIN32-NEXT: movups 8(%ebp), %xmm319; WIN32-NEXT: addps %xmm4, %xmm320; WIN32-NEXT: movups 56(%ebp), %xmm421; WIN32-NEXT: movups 40(%ebp), %xmm522; WIN32-NEXT: movups 24(%ebp), %xmm623; WIN32-NEXT: movl %esp, %eax24; WIN32-NEXT: addps %xmm6, %xmm025; WIN32-NEXT: addps %xmm5, %xmm126; WIN32-NEXT: addps %xmm4, %xmm227; WIN32-NEXT: pushl %eax28; WIN32-NEXT: calll _func_float16_ptr29; WIN32-NEXT: addl $4, %esp30; WIN32-NEXT: addps (%esp), %xmm031; WIN32-NEXT: addps {{[0-9]+}}(%esp), %xmm132; WIN32-NEXT: addps {{[0-9]+}}(%esp), %xmm233; WIN32-NEXT: addps {{[0-9]+}}(%esp), %xmm334; WIN32-NEXT: movl %ebp, %esp35; WIN32-NEXT: popl %ebp36; WIN32-NEXT: retl37;38; WIN64-LABEL: testf16_inp:39; WIN64: # %bb.0:40; WIN64-NEXT: subq $104, %rsp41; WIN64-NEXT: movaps (%r9), %xmm342; WIN64-NEXT: movaps (%r8), %xmm243; WIN64-NEXT: movaps (%rdx), %xmm144; WIN64-NEXT: movaps (%rcx), %xmm045; WIN64-NEXT: movq {{[0-9]+}}(%rsp), %rax46; WIN64-NEXT: movq {{[0-9]+}}(%rsp), %rcx47; WIN64-NEXT: movq {{[0-9]+}}(%rsp), %rdx48; WIN64-NEXT: movq {{[0-9]+}}(%rsp), %r849; WIN64-NEXT: addps (%r8), %xmm050; WIN64-NEXT: addps (%rdx), %xmm151; WIN64-NEXT: addps (%rcx), %xmm252; WIN64-NEXT: addps (%rax), %xmm353; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rcx54; WIN64-NEXT: callq func_float16_ptr55; WIN64-NEXT: addps {{[0-9]+}}(%rsp), %xmm056; WIN64-NEXT: addps {{[0-9]+}}(%rsp), %xmm157; WIN64-NEXT: addps {{[0-9]+}}(%rsp), %xmm258; WIN64-NEXT: addps {{[0-9]+}}(%rsp), %xmm359; WIN64-NEXT: addq $104, %rsp60; WIN64-NEXT: retq61;62; NOT_WIN-LABEL: testf16_inp:63; NOT_WIN: ## %bb.0:64; NOT_WIN-NEXT: subq $72, %rsp65; NOT_WIN-NEXT: addps %xmm4, %xmm066; NOT_WIN-NEXT: addps %xmm5, %xmm167; NOT_WIN-NEXT: addps %xmm6, %xmm268; NOT_WIN-NEXT: addps %xmm7, %xmm369; NOT_WIN-NEXT: movq %rsp, %rdi70; NOT_WIN-NEXT: callq _func_float16_ptr71; NOT_WIN-NEXT: addps (%rsp), %xmm072; NOT_WIN-NEXT: addps {{[0-9]+}}(%rsp), %xmm173; NOT_WIN-NEXT: addps {{[0-9]+}}(%rsp), %xmm274; NOT_WIN-NEXT: addps {{[0-9]+}}(%rsp), %xmm375; NOT_WIN-NEXT: addq $72, %rsp76; NOT_WIN-NEXT: retq77 %y = alloca <16 x float>, align 1678 %x = fadd <16 x float> %a, %b79 %1 = call intel_ocl_bicc <16 x float> @func_float16_ptr(<16 x float> %x, ptr %y)80 %2 = load <16 x float>, ptr %y, align 1681 %3 = fadd <16 x float> %2, %182 ret <16 x float> %383}84 85; test calling conventions - preserved registers86 87; preserves xmm6-xmm15 on windows, xmm8-xmm15 on other plateforms.88define <16 x float> @testf16_regs(<16 x float> %a, <16 x float> %b) nounwind {89; WIN32-LABEL: testf16_regs:90; WIN32: # %bb.0:91; WIN32-NEXT: pushl %ebp92; WIN32-NEXT: movl %esp, %ebp93; WIN32-NEXT: andl $-16, %esp94; WIN32-NEXT: subl $80, %esp95; WIN32-NEXT: movups 72(%ebp), %xmm696; WIN32-NEXT: movups 8(%ebp), %xmm397; WIN32-NEXT: movups 56(%ebp), %xmm798; WIN32-NEXT: movups 40(%ebp), %xmm599; WIN32-NEXT: movups 24(%ebp), %xmm4100; WIN32-NEXT: movl %esp, %eax101; WIN32-NEXT: addps %xmm4, %xmm0102; WIN32-NEXT: addps %xmm5, %xmm1103; WIN32-NEXT: addps %xmm7, %xmm2104; WIN32-NEXT: addps %xmm6, %xmm3105; WIN32-NEXT: pushl %eax106; WIN32-NEXT: calll _func_float16_ptr107; WIN32-NEXT: addl $4, %esp108; WIN32-NEXT: movups 72(%ebp), %xmm4109; WIN32-NEXT: addps %xmm4, %xmm3110; WIN32-NEXT: movups 56(%ebp), %xmm4111; WIN32-NEXT: addps %xmm4, %xmm2112; WIN32-NEXT: movups 40(%ebp), %xmm4113; WIN32-NEXT: addps %xmm4, %xmm1114; WIN32-NEXT: movups 24(%ebp), %xmm4115; WIN32-NEXT: addps %xmm4, %xmm0116; WIN32-NEXT: addps (%esp), %xmm0117; WIN32-NEXT: addps {{[0-9]+}}(%esp), %xmm1118; WIN32-NEXT: addps {{[0-9]+}}(%esp), %xmm2119; WIN32-NEXT: addps {{[0-9]+}}(%esp), %xmm3120; WIN32-NEXT: movl %ebp, %esp121; WIN32-NEXT: popl %ebp122; WIN32-NEXT: retl123;124; WIN64-LABEL: testf16_regs:125; WIN64: # %bb.0:126; WIN64-NEXT: subq $168, %rsp127; WIN64-NEXT: movaps %xmm9, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill128; WIN64-NEXT: movaps %xmm8, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill129; WIN64-NEXT: movaps %xmm7, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill130; WIN64-NEXT: movaps %xmm6, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill131; WIN64-NEXT: movq {{[0-9]+}}(%rsp), %rax132; WIN64-NEXT: movaps (%rax), %xmm6133; WIN64-NEXT: movq {{[0-9]+}}(%rsp), %rax134; WIN64-NEXT: movaps (%rax), %xmm7135; WIN64-NEXT: movq {{[0-9]+}}(%rsp), %rax136; WIN64-NEXT: movaps (%rax), %xmm8137; WIN64-NEXT: movq {{[0-9]+}}(%rsp), %rax138; WIN64-NEXT: movaps (%rax), %xmm9139; WIN64-NEXT: movaps (%rcx), %xmm0140; WIN64-NEXT: addps %xmm9, %xmm0141; WIN64-NEXT: movaps (%rdx), %xmm1142; WIN64-NEXT: addps %xmm8, %xmm1143; WIN64-NEXT: movaps (%r8), %xmm2144; WIN64-NEXT: addps %xmm7, %xmm2145; WIN64-NEXT: movaps (%r9), %xmm3146; WIN64-NEXT: addps %xmm6, %xmm3147; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rcx148; WIN64-NEXT: callq func_float16_ptr149; WIN64-NEXT: addps %xmm6, %xmm3150; WIN64-NEXT: addps %xmm7, %xmm2151; WIN64-NEXT: addps %xmm8, %xmm1152; WIN64-NEXT: addps %xmm9, %xmm0153; WIN64-NEXT: addps {{[0-9]+}}(%rsp), %xmm0154; WIN64-NEXT: addps {{[0-9]+}}(%rsp), %xmm1155; WIN64-NEXT: addps {{[0-9]+}}(%rsp), %xmm2156; WIN64-NEXT: addps {{[0-9]+}}(%rsp), %xmm3157; WIN64-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm6 # 16-byte Reload158; WIN64-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm7 # 16-byte Reload159; WIN64-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm8 # 16-byte Reload160; WIN64-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm9 # 16-byte Reload161; WIN64-NEXT: addq $168, %rsp162; WIN64-NEXT: retq163;164; NOT_WIN-LABEL: testf16_regs:165; NOT_WIN: ## %bb.0:166; NOT_WIN-NEXT: subq $72, %rsp167; NOT_WIN-NEXT: movaps %xmm7, %xmm9168; NOT_WIN-NEXT: movaps %xmm6, %xmm10169; NOT_WIN-NEXT: movaps %xmm5, %xmm11170; NOT_WIN-NEXT: movaps %xmm4, %xmm8171; NOT_WIN-NEXT: addps %xmm4, %xmm0172; NOT_WIN-NEXT: addps %xmm5, %xmm1173; NOT_WIN-NEXT: addps %xmm6, %xmm2174; NOT_WIN-NEXT: addps %xmm7, %xmm3175; NOT_WIN-NEXT: movq %rsp, %rdi176; NOT_WIN-NEXT: callq _func_float16_ptr177; NOT_WIN-NEXT: addps %xmm9, %xmm3178; NOT_WIN-NEXT: addps %xmm10, %xmm2179; NOT_WIN-NEXT: addps %xmm11, %xmm1180; NOT_WIN-NEXT: addps %xmm8, %xmm0181; NOT_WIN-NEXT: addps (%rsp), %xmm0182; NOT_WIN-NEXT: addps {{[0-9]+}}(%rsp), %xmm1183; NOT_WIN-NEXT: addps {{[0-9]+}}(%rsp), %xmm2184; NOT_WIN-NEXT: addps {{[0-9]+}}(%rsp), %xmm3185; NOT_WIN-NEXT: addq $72, %rsp186; NOT_WIN-NEXT: retq187 %y = alloca <16 x float>, align 16188 %x = fadd <16 x float> %a, %b189 %1 = call intel_ocl_bicc <16 x float> @func_float16_ptr(<16 x float> %x, ptr %y)190 %2 = load <16 x float>, ptr %y, align 16191 %3 = fadd <16 x float> %1, %b192 %4 = fadd <16 x float> %2, %3193 ret <16 x float> %4194}195 196; test calling conventions - prolog and epilog197define intel_ocl_bicc <16 x float> @test_prolog_epilog(<16 x float> %a, <16 x float> %b) nounwind {198; WIN32-LABEL: test_prolog_epilog:199; WIN32: # %bb.0:200; WIN32-NEXT: pushl %ebp201; WIN32-NEXT: movl %esp, %ebp202; WIN32-NEXT: andl $-16, %esp203; WIN32-NEXT: subl $96, %esp204; WIN32-NEXT: movups 8(%ebp), %xmm4205; WIN32-NEXT: movups 24(%ebp), %xmm5206; WIN32-NEXT: movups 40(%ebp), %xmm6207; WIN32-NEXT: movups 56(%ebp), %xmm7208; WIN32-NEXT: movups %xmm7, {{[0-9]+}}(%esp)209; WIN32-NEXT: movups %xmm6, {{[0-9]+}}(%esp)210; WIN32-NEXT: movups %xmm5, {{[0-9]+}}(%esp)211; WIN32-NEXT: movups %xmm4, {{[0-9]+}}(%esp)212; WIN32-NEXT: movups %xmm3, (%esp)213; WIN32-NEXT: calll _func_float16214; WIN32-NEXT: movl %ebp, %esp215; WIN32-NEXT: popl %ebp216; WIN32-NEXT: retl217;218; WIN64-LABEL: test_prolog_epilog:219; WIN64: # %bb.0:220; WIN64-NEXT: subq $232, %rsp221; WIN64-NEXT: movaps %xmm7, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill222; WIN64-NEXT: movaps %xmm6, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill223; WIN64-NEXT: movaps (%r9), %xmm4224; WIN64-NEXT: movaps (%rdx), %xmm5225; WIN64-NEXT: movaps (%r8), %xmm6226; WIN64-NEXT: movaps (%rcx), %xmm7227; WIN64-NEXT: movaps %xmm1, {{[0-9]+}}(%rsp)228; WIN64-NEXT: movaps %xmm0, {{[0-9]+}}(%rsp)229; WIN64-NEXT: movaps %xmm2, {{[0-9]+}}(%rsp)230; WIN64-NEXT: movaps %xmm3, {{[0-9]+}}(%rsp)231; WIN64-NEXT: movaps %xmm7, {{[0-9]+}}(%rsp)232; WIN64-NEXT: movaps %xmm6, {{[0-9]+}}(%rsp)233; WIN64-NEXT: movaps %xmm5, {{[0-9]+}}(%rsp)234; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rax235; WIN64-NEXT: movq %rax, {{[0-9]+}}(%rsp)236; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rax237; WIN64-NEXT: movq %rax, {{[0-9]+}}(%rsp)238; WIN64-NEXT: movaps %xmm4, {{[0-9]+}}(%rsp)239; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rax240; WIN64-NEXT: movq %rax, {{[0-9]+}}(%rsp)241; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rax242; WIN64-NEXT: movq %rax, {{[0-9]+}}(%rsp)243; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rcx244; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rdx245; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %r8246; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %r9247; WIN64-NEXT: callq func_float16248; WIN64-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm6 # 16-byte Reload249; WIN64-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm7 # 16-byte Reload250; WIN64-NEXT: addq $232, %rsp251; WIN64-NEXT: retq252;253; NOT_WIN-LABEL: test_prolog_epilog:254; NOT_WIN: ## %bb.0:255; NOT_WIN-NEXT: subq $136, %rsp256; NOT_WIN-NEXT: movaps %xmm15, {{[-0-9]+}}(%r{{[sb]}}p) ## 16-byte Spill257; NOT_WIN-NEXT: movaps %xmm14, {{[-0-9]+}}(%r{{[sb]}}p) ## 16-byte Spill258; NOT_WIN-NEXT: movaps %xmm13, {{[-0-9]+}}(%r{{[sb]}}p) ## 16-byte Spill259; NOT_WIN-NEXT: movaps %xmm12, {{[-0-9]+}}(%r{{[sb]}}p) ## 16-byte Spill260; NOT_WIN-NEXT: movaps %xmm11, {{[-0-9]+}}(%r{{[sb]}}p) ## 16-byte Spill261; NOT_WIN-NEXT: movaps %xmm10, {{[-0-9]+}}(%r{{[sb]}}p) ## 16-byte Spill262; NOT_WIN-NEXT: movaps %xmm9, {{[-0-9]+}}(%r{{[sb]}}p) ## 16-byte Spill263; NOT_WIN-NEXT: movaps %xmm8, (%rsp) ## 16-byte Spill264; NOT_WIN-NEXT: callq _func_float16265; NOT_WIN-NEXT: movaps (%rsp), %xmm8 ## 16-byte Reload266; NOT_WIN-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm9 ## 16-byte Reload267; NOT_WIN-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm10 ## 16-byte Reload268; NOT_WIN-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm11 ## 16-byte Reload269; NOT_WIN-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm12 ## 16-byte Reload270; NOT_WIN-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm13 ## 16-byte Reload271; NOT_WIN-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm14 ## 16-byte Reload272; NOT_WIN-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm15 ## 16-byte Reload273; NOT_WIN-NEXT: addq $136, %rsp274; NOT_WIN-NEXT: retq275 %c = call <16 x float> @func_float16(<16 x float> %a, <16 x float> %b)276 ret <16 x float> %c277}278