1/*
2 * This file is part of the LibreOffice project.
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 *
8 * This file incorporates work covered by the following license notice:
9 *
10 *   Licensed to the Apache Software Foundation (ASF) under one or more
11 *   contributor license agreements. See the NOTICE file distributed
12 *   with this work for additional information regarding copyright
13 *   ownership. The ASF licenses this file to you under the Apache
14 *   License, Version 2.0 (the "License"); you may not use this file
15 *   except in compliance with the License. You may obtain a copy of
16 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
17 */
18
19	.text
20	.align 2
21.globl privateSnippetExecutor
22	.type	privateSnippetExecutor, @function
23privateSnippetExecutor:
24.LFB3:
25	pushq	%rbp
26.LCFI0:
27	movq	%rsp, %rbp
28.LCFI1:
29	subq	$160, %rsp
30.LCFI2:
31	movq	%r10, -152(%rbp)		# Save (nVtableOffset << 32) + nFunctionIndex
32
33	movq	%rdi, -112(%rbp)		# Save GP registers
34	movq	%rsi, -104(%rbp)
35	movq	%rdx, -96(%rbp)
36	movq	%rcx, -88(%rbp)
37	movq	%r8 , -80(%rbp)
38	movq	%r9 , -72(%rbp)
39
40	movsd	%xmm0, -64(%rbp)		# Save FP registers
41	movsd	%xmm1, -56(%rbp)
42	movsd	%xmm2, -48(%rbp)
43	movsd	%xmm3, -40(%rbp)
44	movsd	%xmm4, -32(%rbp)
45	movsd	%xmm5, -24(%rbp)
46	movsd	%xmm6, -16(%rbp)
47	movsd	%xmm7, -8(%rbp)
48
49	leaq	-144(%rbp), %r9			# 6th param: sal_uInt64 * pRegisterReturn
50	leaq	16(%rbp), %r8			# 5rd param: void ** ovrflw
51	leaq	-64(%rbp), %rcx			# 4th param: void ** fpreg
52	leaq	-112(%rbp), %rdx		# 3rd param: void ** gpreg
53	movl	-148(%rbp), %esi		# 2nd param: sal_int32 nVtableOffset
54	movl	-152(%rbp), %edi		# 1st param: sal_int32 nFunctionIndex
55
56	call	cpp_vtable_call
57
58	cmp	$10, %rax					# typelib_TypeClass_FLOAT
59	je	.Lfloat
60	cmp	$11, %rax					# typelib_TypeClass_DOUBLE
61	je	.Lfloat
62
63	movq	-144(%rbp), %rax		# Return value (int case)
64	movq	-136(%rbp), %rdx		# Return value (int case)
65	movq	-144(%rbp), %xmm0		# Return value (int case)
66	movq	-136(%rbp), %xmm1		# Return value (int case)
67	jmp	.Lfinish
68.Lfloat:
69	movlpd	-144(%rbp), %xmm0		# Return value (float/double case)
70
71.Lfinish:
72	leave
73	ret
74.LFE3:
75	.size	privateSnippetExecutor, .-privateSnippetExecutor
76	# see http://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html
77	# for details of the .eh_frame, the "Common Information Entry" and "Frame Description Entry" formats
78	# and http://mentorembedded.github.io/cxx-abi/exceptions.pdf for more info
79	.section	.eh_frame,"a",@unwind
80.Lframe1:
81	.long	.LECIE1-.LSCIE1
82.LSCIE1:
83	.long	0x0
84	.byte	0x1
85	.string	"zR"
86	.uleb128 0x1
87	.sleb128 -8
88	.byte	0x10
89	.uleb128 0x1
90	.byte	0x1b
91	.byte	0xc
92	.uleb128 0x7
93	.uleb128 0x8
94	.byte	0x90
95	.uleb128 0x1
96	.align 8
97.LECIE1:
98.LSFDE1:
99	.long	.LEFDE1-.LASFDE1
100.LASFDE1:
101	.long	.LASFDE1-.Lframe1
102	.long	.LFB3-.
103	.long	.LFE3-.LFB3
104	.uleb128 0x0
105	.byte	0x4
106	.long	.LCFI0-.LFB3
107	.byte	0xe
108	.uleb128 0x10
109	.byte	0x86
110	.uleb128 0x2
111	.byte	0x4
112	.long	.LCFI1-.LCFI0
113	.byte	0xd
114	.uleb128 0x6
115	.align 8
116.LEFDE1:
117	.section	.note.GNU-stack,"",@progbits
118