brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 778c3dc Raw
48 lines · plain
1// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.2// See https://llvm.org/LICENSE.txt for license information.3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception4 5#include "../assembly.h"6 7// xf_float __floatundixf(du_int a);168 9#ifdef __i386__10 11CONST_SECTION12 13	.balign 1614twop52:15	.quad 0x433000000000000016 17	.balign 1618twop84_plus_twop52_neg:19	.quad 0xc53000000010000020 21	.balign 1622twop84:23	.quad 0x453000000000000024 25#define REL_ADDR(_a)	(_a)-0b(%eax)26 27.text28.balign 429DEFINE_COMPILERRT_FUNCTION(__floatundixf)30	calll	0f310:	popl	%eax32	movss	8(%esp),			%xmm0	// hi 32 bits of input33	movss	4(%esp),			%xmm1	// lo 32 bits of input34	orpd	REL_ADDR(twop84),	%xmm0	// 2^84 + hi (as a double)35	orpd	REL_ADDR(twop52),	%xmm1	// 2^52 + lo (as a double)36	addsd	REL_ADDR(twop84_plus_twop52_neg),	%xmm0	// hi - 2^52 (no rounding occurs)37	movsd	%xmm1,				4(%esp)38	fldl	4(%esp)39	movsd	%xmm0,				4(%esp)40	faddl	4(%esp)41	ret42END_COMPILERRT_FUNCTION(__floatundixf)43 44#endif // __i386__45 46NO_EXEC_STACK_DIRECTIVE47 48