Skip to content
Snippets Groups Projects
Commit 43ccb7e4 authored by Christophe Lyon's avatar Christophe Lyon
Browse files

libgcc: Enable XF mode conversions to/from DFP modes only if supported

Some targets do not support XF mode (eg AArch64), so don't build the
corresponding to/from DFP modes convertion routines if
__LIBGCC_HAS_XF_MODE__ is not defined.

2022-03-31  Christophe Lyon  <christophe.lyon@arm.com>

	libgcc/config/libbid/
	* _dd_to_xf.c: Check __LIBGCC_HAS_XF_MODE__.
	* _sd_to_xf.c: Likewise.
	* _td_to_xf.c: Likewise.
	* _xf_to_dd.c: Likewise.
	* _xf_to_sd.c: Likewise.
	* _xf_to_td.c: Likewise.
parent 0dc8e1e7
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bid_functions.h" #include "bid_functions.h"
#include "bid_gcc_intrinsics.h" #include "bid_gcc_intrinsics.h"
#ifdef __LIBGCC_HAS_XF_MODE__
XFtype XFtype
__bid_extendddxf (_Decimal64 x) { __bid_extendddxf (_Decimal64 x) {
XFtype res; XFtype res;
...@@ -34,3 +35,4 @@ __bid_extendddxf (_Decimal64 x) { ...@@ -34,3 +35,4 @@ __bid_extendddxf (_Decimal64 x) {
res = __bid64_to_binary80 (ux.i); res = __bid64_to_binary80 (ux.i);
return (res); return (res);
} }
#endif
...@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bid_functions.h" #include "bid_functions.h"
#include "bid_gcc_intrinsics.h" #include "bid_gcc_intrinsics.h"
#ifdef __LIBGCC_HAS_XF_MODE__
XFtype XFtype
__bid_extendsdxf (_Decimal32 x) { __bid_extendsdxf (_Decimal32 x) {
XFtype res; XFtype res;
...@@ -34,3 +35,4 @@ __bid_extendsdxf (_Decimal32 x) { ...@@ -34,3 +35,4 @@ __bid_extendsdxf (_Decimal32 x) {
res = __bid32_to_binary80 (ux.i); res = __bid32_to_binary80 (ux.i);
return (res); return (res);
} }
#endif
...@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bid_functions.h" #include "bid_functions.h"
#include "bid_gcc_intrinsics.h" #include "bid_gcc_intrinsics.h"
#ifdef __LIBGCC_HAS_XF_MODE__
XFtype XFtype
__bid_trunctdxf (_Decimal128 x) { __bid_trunctdxf (_Decimal128 x) {
XFtype res; XFtype res;
...@@ -34,3 +35,4 @@ __bid_trunctdxf (_Decimal128 x) { ...@@ -34,3 +35,4 @@ __bid_trunctdxf (_Decimal128 x) {
res = __bid128_to_binary80 (ux.i); res = __bid128_to_binary80 (ux.i);
return (res); return (res);
} }
#endif
...@@ -25,9 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -25,9 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bid_functions.h" #include "bid_functions.h"
#include "bid_gcc_intrinsics.h" #include "bid_gcc_intrinsics.h"
#ifdef __LIBGCC_HAS_XF_MODE__
_Decimal64 _Decimal64
__bid_truncxfdd (XFtype x) { __bid_truncxfdd (XFtype x) {
union decimal64 res; union decimal64 res;
res.i = __binary80_to_bid64 (x); res.i = __binary80_to_bid64 (x);
return (res.d); return (res.d);
} }
#endif
...@@ -25,9 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -25,9 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bid_functions.h" #include "bid_functions.h"
#include "bid_gcc_intrinsics.h" #include "bid_gcc_intrinsics.h"
#ifdef __LIBGCC_HAS_XF_MODE__
_Decimal32 _Decimal32
__bid_truncxfsd (XFtype x) { __bid_truncxfsd (XFtype x) {
union decimal32 res; union decimal32 res;
res.i = __binary80_to_bid32 (x); res.i = __binary80_to_bid32 (x);
return (res.d); return (res.d);
} }
#endif
...@@ -25,9 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -25,9 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "bid_functions.h" #include "bid_functions.h"
#include "bid_gcc_intrinsics.h" #include "bid_gcc_intrinsics.h"
#ifdef __LIBGCC_HAS_XF_MODE__
_Decimal128 _Decimal128
__bid_extendxftd (XFtype x) { __bid_extendxftd (XFtype x) {
union decimal128 res; union decimal128 res;
res.i = __binary80_to_bid128 (x); res.i = __binary80_to_bid128 (x);
return (res.d); return (res.d);
} }
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment