brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.4 KiB · ecbc7e9 Raw
130 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; When we accept small parameters on Windows, make sure we do not assume they3; are zero or sign extended in memory or in registers.4 5; RUN: llc < %s -mtriple=x86_64-windows-msvc | FileCheck %s --check-prefix=WIN646; RUN: llc < %s -mtriple=x86_64-windows-gnu | FileCheck %s --check-prefix=WIN647; RUN: llc < %s -mtriple=i686-windows-msvc | FileCheck %s --check-prefix=WIN32-MSVC8; RUN: llc < %s -mtriple=i686-windows-gnu | FileCheck %s --check-prefix=WIN32-GNU9 10define void @call() {11; WIN64-LABEL: call:12; WIN64:       # %bb.0: # %entry13; WIN64-NEXT:    subq $56, %rsp14; WIN64-NEXT:    .seh_stackalloc 5615; WIN64-NEXT:    .seh_endprologue16; WIN64-NEXT:    movw $6, {{[0-9]+}}(%rsp)17; WIN64-NEXT:    movb $5, {{[0-9]+}}(%rsp)18; WIN64-NEXT:    movb $1, %cl19; WIN64-NEXT:    movw $2, %dx20; WIN64-NEXT:    movb $3, %r8b21; WIN64-NEXT:    movw $4, %r9w22; WIN64-NEXT:    callq manyargs23; WIN64-NEXT:    nop24; WIN64-NEXT:    .seh_startepilogue25; WIN64-NEXT:    addq $56, %rsp26; WIN64-NEXT:    .seh_endepilogue27; WIN64-NEXT:    retq28; WIN64-NEXT:    .seh_endproc29;30; WIN32-MSVC-LABEL: call:31; WIN32-MSVC:       # %bb.0: # %entry32; WIN32-MSVC-NEXT:    pushl $633; WIN32-MSVC-NEXT:    pushl $534; WIN32-MSVC-NEXT:    pushl $435; WIN32-MSVC-NEXT:    pushl $336; WIN32-MSVC-NEXT:    pushl $237; WIN32-MSVC-NEXT:    pushl $138; WIN32-MSVC-NEXT:    calll _manyargs39; WIN32-MSVC-NEXT:    addl $24, %esp40; WIN32-MSVC-NEXT:    retl41;42; WIN32-GNU-LABEL: call:43; WIN32-GNU:       # %bb.0: # %entry44; WIN32-GNU-NEXT:    pushl $645; WIN32-GNU-NEXT:    .cfi_adjust_cfa_offset 446; WIN32-GNU-NEXT:    pushl $547; WIN32-GNU-NEXT:    .cfi_adjust_cfa_offset 448; WIN32-GNU-NEXT:    pushl $449; WIN32-GNU-NEXT:    .cfi_adjust_cfa_offset 450; WIN32-GNU-NEXT:    pushl $351; WIN32-GNU-NEXT:    .cfi_adjust_cfa_offset 452; WIN32-GNU-NEXT:    pushl $253; WIN32-GNU-NEXT:    .cfi_adjust_cfa_offset 454; WIN32-GNU-NEXT:    pushl $155; WIN32-GNU-NEXT:    .cfi_adjust_cfa_offset 456; WIN32-GNU-NEXT:    calll _manyargs57; WIN32-GNU-NEXT:    addl $24, %esp58; WIN32-GNU-NEXT:    .cfi_adjust_cfa_offset -2459; WIN32-GNU-NEXT:    retl60entry:61  %rv = call i32 @manyargs(i8 1, i16 2, i8 3, i16 4, i8 5, i16 6)62  ret void63}64 65define i32 @manyargs(i8 %a, i16 %b, i8 %c, i16 %d, i8 %e, i16 %f) {66; WIN64-LABEL: manyargs:67; WIN64:       # %bb.0: # %entry68; WIN64-NEXT:    movzwl {{[0-9]+}}(%rsp), %r10d69; WIN64-NEXT:    movzbl {{[0-9]+}}(%rsp), %r11d70; WIN64-NEXT:    movsbl %cl, %eax71; WIN64-NEXT:    movswl %dx, %ecx72; WIN64-NEXT:    addl %eax, %ecx73; WIN64-NEXT:    movzbl %r8b, %edx74; WIN64-NEXT:    movzwl %r9w, %eax75; WIN64-NEXT:    addl %edx, %eax76; WIN64-NEXT:    addl %ecx, %eax77; WIN64-NEXT:    addl %r11d, %eax78; WIN64-NEXT:    addl %r10d, %eax79; WIN64-NEXT:    retq80;81; WIN32-MSVC-LABEL: manyargs:82; WIN32-MSVC:       # %bb.0: # %entry83; WIN32-MSVC-NEXT:    pushl %esi84; WIN32-MSVC-NEXT:    movzwl {{[0-9]+}}(%esp), %eax85; WIN32-MSVC-NEXT:    movzbl {{[0-9]+}}(%esp), %ecx86; WIN32-MSVC-NEXT:    addl %eax, %ecx87; WIN32-MSVC-NEXT:    movzwl {{[0-9]+}}(%esp), %eax88; WIN32-MSVC-NEXT:    movzbl {{[0-9]+}}(%esp), %edx89; WIN32-MSVC-NEXT:    addl %eax, %edx90; WIN32-MSVC-NEXT:    movswl {{[0-9]+}}(%esp), %esi91; WIN32-MSVC-NEXT:    movsbl {{[0-9]+}}(%esp), %eax92; WIN32-MSVC-NEXT:    addl %esi, %eax93; WIN32-MSVC-NEXT:    addl %edx, %eax94; WIN32-MSVC-NEXT:    addl %ecx, %eax95; WIN32-MSVC-NEXT:    popl %esi96; WIN32-MSVC-NEXT:    retl97;98; WIN32-GNU-LABEL: manyargs:99; WIN32-GNU:       # %bb.0: # %entry100; WIN32-GNU-NEXT:    pushl %esi101; WIN32-GNU-NEXT:    .cfi_def_cfa_offset 8102; WIN32-GNU-NEXT:    .cfi_offset %esi, -8103; WIN32-GNU-NEXT:    movzwl {{[0-9]+}}(%esp), %eax104; WIN32-GNU-NEXT:    movzbl {{[0-9]+}}(%esp), %ecx105; WIN32-GNU-NEXT:    addl %eax, %ecx106; WIN32-GNU-NEXT:    movzwl {{[0-9]+}}(%esp), %eax107; WIN32-GNU-NEXT:    movzbl {{[0-9]+}}(%esp), %edx108; WIN32-GNU-NEXT:    addl %eax, %edx109; WIN32-GNU-NEXT:    movswl {{[0-9]+}}(%esp), %esi110; WIN32-GNU-NEXT:    movsbl {{[0-9]+}}(%esp), %eax111; WIN32-GNU-NEXT:    addl %esi, %eax112; WIN32-GNU-NEXT:    addl %edx, %eax113; WIN32-GNU-NEXT:    addl %ecx, %eax114; WIN32-GNU-NEXT:    popl %esi115; WIN32-GNU-NEXT:    retl116entry:117  %aa = sext i8 %a to i32118  %bb = sext i16 %b to i32119  %cc = zext i8 %c to i32120  %dd = zext i16 %d to i32121  %ee = zext i8 %e to i32122  %ff = zext i16 %f to i32123  %t0 = add i32 %aa, %bb124  %t1 = add i32 %t0, %cc125  %t2 = add i32 %t1, %dd126  %t3 = add i32 %t2, %ee127  %t4 = add i32 %t3, %ff128  ret i32 %t4129}130