diff options
author | Zack Weinberg <zackw@panix.com> | 2017-06-08 15:39:03 -0400 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2017-06-08 15:39:03 -0400 |
commit | 5046dbb4a7eba5eccfd258f92f4735c9ffc8d069 (patch) | |
tree | 4470480d904b65cf14ca524f96f79eca818c3eaf /REORG.TODO/sysdeps/alpha/soft-fp/local-soft-fp.h | |
parent | 199fc19d3aaaf57944ef036e15904febe877fc93 (diff) | |
download | glibc-5046dbb4a7eba5eccfd258f92f4735c9ffc8d069.tar glibc-5046dbb4a7eba5eccfd258f92f4735c9ffc8d069.tar.gz glibc-5046dbb4a7eba5eccfd258f92f4735c9ffc8d069.tar.bz2 glibc-5046dbb4a7eba5eccfd258f92f4735c9ffc8d069.zip |
Prepare for radical source tree reorganization.zack/build-layout-experiment
All top-level files and directories are moved into a temporary storage
directory, REORG.TODO, except for files that will certainly still
exist in their current form at top level when we're done (COPYING,
COPYING.LIB, LICENSES, NEWS, README), all old ChangeLog files (which
are moved to the new directory OldChangeLogs, instead), and the
generated file INSTALL (which is just deleted; in the new order, there
will be no generated files checked into version control).
Diffstat (limited to 'REORG.TODO/sysdeps/alpha/soft-fp/local-soft-fp.h')
-rw-r--r-- | REORG.TODO/sysdeps/alpha/soft-fp/local-soft-fp.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/REORG.TODO/sysdeps/alpha/soft-fp/local-soft-fp.h b/REORG.TODO/sysdeps/alpha/soft-fp/local-soft-fp.h new file mode 100644 index 0000000000..d562e0829e --- /dev/null +++ b/REORG.TODO/sysdeps/alpha/soft-fp/local-soft-fp.h @@ -0,0 +1,55 @@ +#include <stdlib.h> +#include <soft-fp.h> +#include <quad.h> + +/* Helpers for the Ots functions which receive long double arguments + in two integer registers, and return values in $16+$17. */ + +#define AXP_UNPACK_RAW_Q(X, val) \ + do { \ + union _FP_UNION_Q _flo; \ + _flo.longs.a = val##l; \ + _flo.longs.b = val##h; \ + FP_UNPACK_RAW_QP(X, &_flo); \ + } while (0) + +#define AXP_UNPACK_SEMIRAW_Q(X, val) \ + do { \ + union _FP_UNION_Q _flo; \ + _flo.longs.a = val##l; \ + _flo.longs.b = val##h; \ + FP_UNPACK_SEMIRAW_QP(X, &_flo); \ + } while (0) + +#define AXP_UNPACK_Q(X, val) \ + do { \ + AXP_UNPACK_RAW_Q(X, val); \ + _FP_UNPACK_CANONICAL(Q, 2, X); \ + } while (0) + +#define AXP_PACK_RAW_Q(val, X) FP_PACK_RAW_QP(&val##_flo, X) + +#define AXP_PACK_SEMIRAW_Q(val, X) \ + do { \ + _FP_PACK_SEMIRAW(Q, 2, X); \ + AXP_PACK_RAW_Q(val, X); \ + } while (0) + +#define AXP_PACK_Q(val, X) \ + do { \ + _FP_PACK_CANONICAL(Q, 2, X); \ + AXP_PACK_RAW_Q(val, X); \ + } while (0) + +#define AXP_DECL_RETURN_Q(X) union _FP_UNION_Q X##_flo + +/* ??? We don't have a real way to tell the compiler that we're wanting + to return values in $16+$17. Instead use a volatile asm to make sure + that the values are live, and just hope that nothing kills the values + in between here and the end of the function. */ +#define AXP_RETURN_Q(X) \ + do { \ + register long r16 __asm__("16") = X##_flo.longs.a; \ + register long r17 __asm__("17") = X##_flo.longs.b; \ + asm volatile ("" : : "r"(r16), "r"(r17)); \ + } while (0) |