Files
acceptance-tests
data
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm
bindings
cmake
docs
examples
include
lib
projects
resources
runtimes
scripts
test
Analysis
Assembler
Bindings
Bitcode
BugPoint
CodeGen
AArch64
AMDGPU
ARC
ARM
AVR
BPF
Generic
Hexagon
Inputs
Lanai
MIR
MSP430
Mips
NVPTX
Nios2
PowerPC
RISCV
SPARC
2006-01-22-BitConvertLegalize.ll
2007-05-09-JumpTables.ll
2007-07-05-LiveIntervalAssert.ll
2008-10-10-InlineAsmMemoryOperand.ll
2008-10-10-InlineAsmRegOperand.ll
2009-08-28-PIC.ll
2009-08-28-WeakLinkage.ll
2011-01-11-CC.ll
2011-01-11-Call.ll
2011-01-11-FrameAddr.ll
2011-01-19-DelaySlot.ll
2011-01-21-ByValArgs.ll
2011-01-22-SRet.ll
2011-12-03-TailDuplication.ll
2012-05-01-LowerArguments.ll
2013-05-17-CallFrame.ll
32abi.ll
64abi.ll
64bit.ll
64cond.ll
64spill.ll
DbgValueOtherTargets.test
LeonCASAInstructionUT.ll
LeonDetectRoundChangePassUT.ll
LeonFixAllFDIVSQRTPassUT.ll
LeonInsertNOPLoadPassUT.ll
LeonItinerariesUT.ll
LeonReplaceSDIVPassUT.ll
LeonSMACUMACInstructionUT.ll
analyze-branch.ll
atomics.ll
basictest.ll
blockaddr.ll
constpool.ll
constructor.ll
ctpop.ll
disable-fsmuld-fmuls.ll
empty-functions.ll
exception.ll
fail-alloca-align.ll
float-constants.ll
float.ll
fp128.ll
func-addr.ll
globals.ll
inlineasm-v9.ll
inlineasm.ll
leafproc.ll
lit.local.cfg
mature-mc-support.ll
missing-sret.ll
missinglabel.ll
mult-alt-generic-sparc.ll
multiple-div.ll
obj-relocs.ll
parts.ll
private.ll
register-clobber.ll
rem.ll
reserved-regs.ll
select-mask.ll
setjmp.ll
sjlj.ll
soft-float.ll
soft-mul-div.ll
spill.ll
spillsize.ll
sret-secondary.ll
stack-align.ll
stack-protector.ll
thread-pointer.ll
tls.ll
trap.ll
varargs.ll
vector-call.ll
vector-extract-elt.ll
zerostructcall.ll
SystemZ
Thumb
Thumb2
WebAssembly
WinEH
X86
XCore
DebugInfo
Examples
ExecutionEngine
Feature
FileCheck
Instrumentation
Integer
JitListener
LTO
Linker
MC
Object
ObjectYAML
Other
SafepointIRVerifier
SymbolRewriter
TableGen
ThinLTO
Transforms
Unit
Verifier
YAMLParser
tools
.clang-format
CMakeLists.txt
TestRunner.sh
lit.cfg.py
lit.site.cfg.py.in
tools
unittests
utils
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
ikvm-native
libgc
llvm
m4
man
mcs
mk
mono
msvc
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
linux-packaging-mono/external/llvm/test/CodeGen/SPARC/varargs.ll

77 lines
2.3 KiB
LLVM
Raw Normal View History

; RUN: llc < %s -disable-block-placement | FileCheck %s
; RUN: llc < %s -disable-block-placement -disable-sparc-leaf-proc=0 | FileCheck %s
target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32:64-S128"
target triple = "sparcv9-sun-solaris"
; CHECK: varargsfunc
; 128 byte save ares + 1 alloca rounded up to 16 bytes alignment.
; CHECK: save %sp, -144, %sp
; Store the ... arguments to the argument array. The order is not important.
; CHECK: stx %i5, [%fp+2215]
; CHECK: stx %i4, [%fp+2207]
; CHECK: stx %i3, [%fp+2199]
; CHECK: stx %i2, [%fp+2191]
; Store the address of the ... args to %ap at %fp+BIAS+128-8
; add %fp, 2191, [[R:[gilo][0-7]]]
; stx [[R]], [%fp+2039]
define double @varargsfunc(i8* nocapture %fmt, double %sum, ...) {
entry:
%ap = alloca i8*, align 4
%ap1 = bitcast i8** %ap to i8*
call void @llvm.va_start(i8* %ap1)
br label %for.cond
for.cond:
%fmt.addr.0 = phi i8* [ %fmt, %entry ], [ %incdec.ptr, %for.cond.backedge ]
%sum.addr.0 = phi double [ %sum, %entry ], [ %sum.addr.0.be, %for.cond.backedge ]
%incdec.ptr = getelementptr inbounds i8, i8* %fmt.addr.0, i64 1
%0 = load i8, i8* %fmt.addr.0, align 1
%conv = sext i8 %0 to i32
switch i32 %conv, label %sw.default [
i32 105, label %sw.bb
i32 102, label %sw.bb3
]
; CHECK: sw.bb
; ldx [%fp+2039], %[[AP:[gilo][0-7]]]
; add %[[AP]], 4, %[[AP2:[gilo][0-7]]]
; stx %[[AP2]], [%fp+2039]
; ld [%[[AP]]]
sw.bb:
%1 = va_arg i8** %ap, i32
%conv2 = sitofp i32 %1 to double
br label %for.cond.backedge
; CHECK: sw.bb3
; ldx [%fp+2039], %[[AP:[gilo][0-7]]]
; add %[[AP]], 8, %[[AP2:[gilo][0-7]]]
; stx %[[AP2]], [%fp+2039]
; ldd [%[[AP]]]
sw.bb3:
%2 = va_arg i8** %ap, double
br label %for.cond.backedge
for.cond.backedge:
%.pn = phi double [ %2, %sw.bb3 ], [ %conv2, %sw.bb ]
%sum.addr.0.be = fadd double %.pn, %sum.addr.0
br label %for.cond
sw.default:
ret double %sum.addr.0
}
declare void @llvm.va_start(i8*)
@.str = private unnamed_addr constant [4 x i8] c"abc\00", align 1
; CHECK: call_1d
; The fixed-arg double goes in %d2, the second goes in %o2.
; CHECK: sethi 1048576
; CHECK: , %f2
; CHECK: , %o2
define i32 @call_1d() #0 {
entry:
%call = call double (i8*, double, ...) @varargsfunc(i8* undef, double 1.000000e+00, double 2.000000e+00)
ret i32 1
}