brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · d60fe80 Raw
62 lines · plain
1;Check 5.5 Parameter Passing --> Stage C --> C.5 statement, when NSAA is not2;equal to SP.3;4; Our purpose: make NSAA != SP, and only after start to use GPRs, then pass5;              byval parameter and check that it goes to stack only.6;7;Co-Processor register candidates may be either in VFP or in stack, so after8;all VFP are allocated, stack is used. We can use stack without GPR allocation9;in that case, passing 9 f64 params, for example.10;First eight params goes to d0-d7, ninth one goes to the stack.11;Now, as 10th parameter, we pass i32, and it must go to R0.12;13;For more information,14;please, read 5.5 Parameter Passing, Stage C, stages C.2.cp, C.4 and C.515;16;17;RUN: llc -mtriple=thumbv7-linux-gnueabihf -float-abi=hard < %s | FileCheck %s18 19%struct_t = type { i32, i32, i32, i32 }20@static_val = constant %struct_t { i32 777, i32 888, i32 999, i32 1000 }21declare void @fooUseStruct(ptr)22 23define void @foo2(double %p0, ; --> D024                  double %p1, ; --> D125		  double %p2, ; --> D226		  double %p3, ; --> D327		  double %p4, ; --> D428		  double %p5, ; --> D529		  double %p6, ; --> D630		  double %p7, ; --> D731		  double %p8, ; --> Stack32		  i32 %p9,    ; --> R033                  ptr byval(%struct_t) %p10) ; --> Stack+834{35entry:36;CHECK:     push {r7, lr}37;CHECK-NOT: stm38;CHECK:     add r0, sp, #1639;CHECK:     bl fooUseStruct40  call void @fooUseStruct(ptr %p10)41 42  ret void43}44 45define void @doFoo2() {46entry:47;CHECK-NOT: ldm48  tail call void @foo2(double 23.0, ; --> D049                       double 23.1, ; --> D150		       double 23.2, ; --> D251                       double 23.3, ; --> D352                       double 23.4, ; --> D453                       double 23.5, ; --> D554                       double 23.6, ; --> D655                       double 23.7, ; --> D756                       double 23.8, ; --> Stack57                       i32 43,      ; --> R0, not Stack+858                       ptr byval(%struct_t) @static_val) ; --> Stack+8, not R159  ret void60}61 62