logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>

libgcc-xfmode.patch (3985B)


  1. SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
  2. SPDX-FileCopyrightText: 2022 Christophe Lyon <christophe.lyon@arm.com>
  3. SPDX-License-Identifier: GPL-3.0-or-later
  4. In our context, some construct has decided that we don't support
  5. XF mode (which is not true for the architecture, in general, as
  6. this patch supports, but is sufficient for our strange environment).
  7. Backport of commit 43ccb7e445329dd9557b42e7289a87a8071ab0f7.
  8. [PATCH] libgcc: Enable XF mode conversions to/from DFP modes only if
  9. supported
  10. Some targets do not support XF mode (eg AArch64), so don't build the
  11. corresponding to/from DFP modes convertion routines if
  12. __LIBGCC_HAS_XF_MODE__ is not defined.
  13. diff --git libgcc/config/libbid/_dd_to_xf.c libgcc/config/libbid/_dd_to_xf.c
  14. index 5a2abbbb1f4..e4b12e8ac4f 100644
  15. --- gcc-10.4.0/libgcc/config/libbid/_dd_to_xf.c
  16. +++ gcc-10.4.0/libgcc/config/libbid/_dd_to_xf.c
  17. @@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  18. #include "bid_functions.h"
  19. #include "bid_gcc_intrinsics.h"
  20. +#ifdef __LIBGCC_HAS_XF_MODE__
  21. XFtype
  22. __bid_extendddxf (_Decimal64 x) {
  23. XFtype res;
  24. @@ -34,3 +35,4 @@ __bid_extendddxf (_Decimal64 x) {
  25. res = __bid64_to_binary80 (ux.i);
  26. return (res);
  27. }
  28. +#endif
  29. diff --git libgcc/config/libbid/_sd_to_xf.c libgcc/config/libbid/_sd_to_xf.c
  30. index 9af09913684..288ccb25075 100644
  31. --- gcc-10.4.0/libgcc/config/libbid/_sd_to_xf.c
  32. +++ gcc-10.4.0/libgcc/config/libbid/_sd_to_xf.c
  33. @@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  34. #include "bid_functions.h"
  35. #include "bid_gcc_intrinsics.h"
  36. +#ifdef __LIBGCC_HAS_XF_MODE__
  37. XFtype
  38. __bid_extendsdxf (_Decimal32 x) {
  39. XFtype res;
  40. @@ -34,3 +35,4 @@ __bid_extendsdxf (_Decimal32 x) {
  41. res = __bid32_to_binary80 (ux.i);
  42. return (res);
  43. }
  44. +#endif
  45. diff --git libgcc/config/libbid/_td_to_xf.c libgcc/config/libbid/_td_to_xf.c
  46. index b0c76a71497..e990282162d 100644
  47. --- gcc-10.4.0/libgcc/config/libbid/_td_to_xf.c
  48. +++ gcc-10.4.0/libgcc/config/libbid/_td_to_xf.c
  49. @@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  50. #include "bid_functions.h"
  51. #include "bid_gcc_intrinsics.h"
  52. +#ifdef __LIBGCC_HAS_XF_MODE__
  53. XFtype
  54. __bid_trunctdxf (_Decimal128 x) {
  55. XFtype res;
  56. @@ -34,3 +35,4 @@ __bid_trunctdxf (_Decimal128 x) {
  57. res = __bid128_to_binary80 (ux.i);
  58. return (res);
  59. }
  60. +#endif
  61. diff --git libgcc/config/libbid/_xf_to_dd.c libgcc/config/libbid/_xf_to_dd.c
  62. index 9feb0f2c3d6..e3246a1c2e1 100644
  63. --- gcc-10.4.0/libgcc/config/libbid/_xf_to_dd.c
  64. +++ gcc-10.4.0/libgcc/config/libbid/_xf_to_dd.c
  65. @@ -25,9 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  66. #include "bid_functions.h"
  67. #include "bid_gcc_intrinsics.h"
  68. +#ifdef __LIBGCC_HAS_XF_MODE__
  69. _Decimal64
  70. __bid_truncxfdd (XFtype x) {
  71. union decimal64 res;
  72. res.i = __binary80_to_bid64 (x);
  73. return (res.d);
  74. }
  75. +#endif
  76. diff --git libgcc/config/libbid/_xf_to_sd.c libgcc/config/libbid/_xf_to_sd.c
  77. index 7d46548af6c..9147e979182 100644
  78. --- gcc-10.4.0/libgcc/config/libbid/_xf_to_sd.c
  79. +++ gcc-10.4.0/libgcc/config/libbid/_xf_to_sd.c
  80. @@ -25,9 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  81. #include "bid_functions.h"
  82. #include "bid_gcc_intrinsics.h"
  83. +#ifdef __LIBGCC_HAS_XF_MODE__
  84. _Decimal32
  85. __bid_truncxfsd (XFtype x) {
  86. union decimal32 res;
  87. res.i = __binary80_to_bid32 (x);
  88. return (res.d);
  89. }
  90. +#endif
  91. diff --git libgcc/config/libbid/_xf_to_td.c libgcc/config/libbid/_xf_to_td.c
  92. index 07987fdcc3a..c8d102b0b7f 100644
  93. --- gcc-10.4.0/libgcc/config/libbid/_xf_to_td.c
  94. +++ gcc-10.4.0/libgcc/config/libbid/_xf_to_td.c
  95. @@ -25,9 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  96. #include "bid_functions.h"
  97. #include "bid_gcc_intrinsics.h"
  98. +#ifdef __LIBGCC_HAS_XF_MODE__
  99. _Decimal128
  100. __bid_extendxftd (XFtype x) {
  101. union decimal128 res;
  102. res.i = __binary80_to_bid128 (x);
  103. return (res.d);
  104. }
  105. +#endif
  106. --
  107. 2.31.1