Welcome to mirror list, hosted at ThFree Co, Russian Federation.

nearbyintl.S « math « cygwin « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f4262a2e0f0bbf92e2662161b4eff21024afaf76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
 * This file has no copyright assigned and is placed in the Public Domain.
 * This file is part of the mingw-w64 runtime package.
 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
 */
#include <_mingw_mac.h>

	.file	"nearbyintl.S"
	.text
#ifdef __x86_64__
	.align 8
#else
	.align 4
#endif
	.globl __MINGW_USYMBOL(nearbyintl)
	.def	__MINGW_USYMBOL(nearbyintl);	.scl	2;	.type	32;	.endef
__MINGW_USYMBOL(nearbyintl):
#if defined(_AMD64_) || defined(__x86_64__)
	fldt	(%rdx)
	movq	%rcx,%r8
	pushq	%rax
	pushq	%rcx
	fnstcw	(%rsp)
	movl	(%rsp), %eax
	orl	$0x20, %eax
	movl	%eax, 8(%rsp)
	fldcw	8(%rsp)
	frndint
	fclex
	fldcw	(%rsp)
	popq	%rcx
	popq	%rax
	movq	%r8,%rax
	movq	$0,8(%r8)
	fstpt	(%r8)
	ret
#elif defined(_ARM_) || defined(__arm__)
	vmrs	r1, fpscr
	vcvtr.s32.f64	s0, d0
	vcvt.f64.s32	d0, s0
	vmsr	fpscr, r1
	bx	lr
#elif defined(_X86_) || defined(__i386__)
	fldt	4(%esp)
	pushl	%eax
	pushl	%ecx
	fnstcw	(%esp)
	movl	(%esp), %eax
	orl	$0x20, %eax
	movl	%eax, 4(%esp)
	fldcw	4(%esp)
	frndint
	fclex
	fldcw	(%esp)
	popl	%ecx
	popl	%eax
	ret
#endif