| 1 |
/** |
| 2 |
* This file has no copyright assigned and is placed in the Public Domain. |
| 3 |
* This file is part of the mingw-w64 runtime package. |
| 4 |
* No warranty is given; refer to the file DISCLAIMER.PD within this package. |
| 5 |
* |
| 6 |
* IEEE 854 double-extended-precision format |
| 7 |
* unsigned int mantissa1:32 |
| 8 |
* unsigned int mantissa0:32 |
| 9 |
* unsigned int exponent:15 |
| 10 |
* unsigned int negative:1 |
| 11 |
* unsigned int empty:16 |
| 12 |
* |
| 13 |
* long double _chgsignl(long double x) { |
| 14 |
* ((unsigned int *) &x)[2] ^= 0x00008000; |
| 15 |
* return x; |
| 16 |
* } |
| 17 |
*/ |
| 18 |
|
| 19 |
#include <_mingw_mac.h> |
| 20 |
|
| 21 |
.file "_chgignl.S" |
| 22 |
.text |
| 23 |
#ifdef __x86_64__ |
| 24 |
.align 8 |
| 25 |
#else |
| 26 |
.align 4 |
| 27 |
#endif |
| 28 |
.globl __MINGW_USYMBOL(_chgsignl) |
| 29 |
.def __MINGW_USYMBOL(_chgsignl); .scl 2; .type 32; .endef |
| 30 |
__MINGW_USYMBOL(_chgsignl): |
| 31 |
#if defined(_AMD64_) || defined(__x86_64__) |
| 32 |
movq (%rdx), %rax |
| 33 |
movq 8(%rdx), %rdx |
| 34 |
xorq $0x8000, %rdx |
| 35 |
movq %rax, (%rcx) |
| 36 |
movq %rdx, 8(%rcx) |
| 37 |
movq %rcx, %rax |
| 38 |
ret |
| 39 |
#elif defined(_X86_) || defined(__i386__) |
| 40 |
movl 12(%esp),%eax |
| 41 |
xorl $0x8000,%eax |
| 42 |
movl %eax,12(%esp) |
| 43 |
fldt 4(%esp) |
| 44 |
ret |
| 45 |
#endif |
| 46 |
|