50 lines · plain
1; RUN: llc -mtriple armv7 -target-abi aapcs -float-abi soft -O0 -o - < %s \2; RUN: | FileCheck %s -check-prefix CHECK-SOFT -check-prefix CHECK3; RUN: llc -mtriple armv7 -target-abi aapcs -float-abi hard -O0 -o - < %s \4; RUN: | FileCheck %s -check-prefix CHECK-HARD -check-prefix CHECK5 6; Tests for passing floating-point regs. Variadic functions will always use7; general-purpose registers. Standard functions will use the floating-point8; registers if there is hardware FP available.9 10declare i1 @non_variadic(float, float, float, float)11declare i1 @non_variadic_big(float, float, float, float, float, float)12declare i1 @variadic(float, ...)13 14define void @non_variadic_fp(float %x, float %y) {15; CHECK-LABEL: non_variadic_fp:16; CHECK: b non_variadic17entry:18 %call = tail call i1 (float, float, float, float) @non_variadic(float %y, float %x, float %x, float %y)19 ret void20}21 22define void @variadic_fp(float %x, float %y) {23; CHECK-LABEL: variadic_fp:24; CHECK: b variadic25entry:26 %call = tail call i1 (float, ...) @variadic(float %y, float %x, float %x, float %y)27 ret void28}29 30; With soft-float, general-purpose registers are used and there are not enough31; of them to handle the 6 arguments. With hard-float, we have plenty of regs32; (s0-s15) to pass FP arguments.33define void @non_variadic_fp_big(float %x, float %y) {34; CHECK-LABEL: non_variadic_fp_big:35; CHECK-SOFT: bl non_variadic_big36; CHECK-HARD: b non_variadic_big37entry:38 %call = tail call i1 (float, float, float, float, float, float) @non_variadic_big(float %y, float %x, float %x, float %y, float %x, float %y)39 ret void40}41 42; Variadic functions cannot use FP regs to pass arguments; only GP regs.43define void @variadic_fp_big(float %x, float %y) {44; CHECK-LABEL: variadic_fp_big:45; CHECK: bl variadic46entry:47 %call = tail call i1 (float, ...) @variadic(float %y, float %x, float %x, float %y, float %x, float %y)48 ret void49}50