Guest User

Untitled

a guest
Feb 17th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.31 KB | None | 0 0
  1. diff -ur gcc-8-20171210.old/gcc/config/aarch64/aarch64.c gcc-8-20171210.new/gcc/config/aarch64/aarch64.c
  2. --- gcc-8-20171210.old/gcc/config/aarch64/aarch64.c 2017-12-07 19:43:40.000000000 +0100
  3. +++ gcc-8-20171210.new/gcc/config/aarch64/aarch64.c 2018-02-04 21:02:13.337405884 +0100
  4. @@ -132,8 +132,8 @@
  5. #define TARGET_HAVE_TLS 1
  6. #endif
  7.  
  8. -static bool aarch64_composite_type_p (const_tree, machine_mode);
  9. -static bool aarch64_vfp_is_call_or_return_candidate (machine_mode,
  10. +bool aarch64_composite_type_p (const_tree, machine_mode);
  11. +bool aarch64_vfp_is_call_or_return_candidate (machine_mode,
  12. const_tree,
  13. machine_mode *, int *,
  14. bool *);
  15. @@ -11176,7 +11176,7 @@
  16. (i.e. BLKmode) in certain circumstances. In other words, MODE cannot be
  17. solely relied on. */
  18.  
  19. -static bool
  20. +bool
  21. aarch64_composite_type_p (const_tree type,
  22. machine_mode mode)
  23. {
  24. @@ -11203,7 +11203,7 @@
  25. is not NULL, *IS_HA indicates whether or not the argument is a homogeneous
  26. floating-point aggregate or a homogeneous short-vector aggregate. */
  27.  
  28. -static bool
  29. +bool
  30. aarch64_vfp_is_call_or_return_candidate (machine_mode mode,
  31. const_tree type,
  32. machine_mode *base_mode,
  33. diff -ur gcc-8-20171210.old/gcc/config/aarch64/aarch64-d.c gcc-8-20171210.new/gcc/config/aarch64/aarch64-d.c
  34. --- gcc-8-20171210.old/gcc/config/aarch64/aarch64-d.c 2018-02-04 21:10:55.408792889 +0100
  35. +++ gcc-8-20171210.new/gcc/config/aarch64/aarch64-d.c 2018-02-04 21:02:13.349406238 +0100
  36. @@ -20,6 +20,28 @@
  37. #include "coretypes.h"
  38. #include "d/d-target.h"
  39. #include "d/d-target-def.h"
  40. +#if __LP64__
  41. +// Be careful not to care about sign when using dinteger_t
  42. +// use this instead of integer_t to
  43. +// avoid conflicts with system #include's
  44. +typedef unsigned long dinteger_t;
  45. +// Signed and unsigned variants
  46. +typedef long sinteger_t;
  47. +typedef unsigned long uinteger_t;
  48. +#else
  49. +typedef unsigned long long dinteger_t;
  50. +typedef long long sinteger_t;
  51. +typedef unsigned long long uinteger_t;
  52. +#endif
  53. +// Hack
  54. +typedef void* real_t;
  55. +#include "d/d-tree.h"
  56. +
  57. +extern bool aarch64_composite_type_p (const_tree, machine_mode);
  58. +extern bool aarch64_vfp_is_call_or_return_candidate (machine_mode,
  59. + const_tree,
  60. + machine_mode *, int *,
  61. + bool *);
  62.  
  63. /* Implement TARGET_D_CPU_VERSIONS for AArch64 targets. */
  64.  
  65. @@ -29,3 +51,66 @@
  66. d_add_builtin_version ("AArch64");
  67. d_add_builtin_version ("D_HardFloat");
  68. }
  69. +
  70. +/* This is needed in aarch64-d.c. Defined in aarch64.c. */
  71. +extern bool aarch64_composite_type_p (const_tree, machine_mode);
  72. +extern bool aarch64_vfp_is_call_or_return_candidate (machine_mode,
  73. + const_tree,
  74. + machine_mode *, int *,
  75. + bool *);
  76. +
  77. +tree
  78. +aarch64_d_vaarg_ti_types (d_tinfo_kind ti)
  79. +{
  80. + tree result = build_tree_list(0, ubyte_type_node);
  81. + result = chainon (result, build_tree_list(0, ubyte_type_node));
  82. + result = chainon (result, build_tree_list(0, ubyte_type_node));
  83. +
  84. + switch (ti)
  85. + {
  86. + case D_TK_STRUCT_TYPE:
  87. + case D_TK_STATICARRAY_TYPE:
  88. + case D_TK_VECTOR_TYPE:
  89. + return result;
  90. +
  91. + default:
  92. + return build_tree_list(0, void_type_node);
  93. + }
  94. +}
  95. +
  96. +tree
  97. +aarch64_d_vaarg_ti_values (d_tinfo_kind ti, tree type)
  98. +{
  99. + if (ti == D_TK_STRUCT_TYPE || ti == D_TK_STATICARRAY_TYPE ||
  100. + ti == D_TK_VECTOR_TYPE)
  101. + {
  102. + bool is_ha;
  103. + int nregs;
  104. + machine_mode ag_mode = VOIDmode;
  105. + bool is_composite;
  106. +
  107. + bool is_freg = aarch64_vfp_is_call_or_return_candidate(TYPE_MODE (type), type,
  108. + &ag_mode, &nregs, &is_ha);
  109. + is_composite = aarch64_composite_type_p(type, TYPE_MODE(type));
  110. +
  111. + u_int8_t flags = 0;
  112. + if (is_composite)
  113. + flags |= 0x1;
  114. +
  115. + if (is_freg)
  116. + flags |= 0x2;
  117. +
  118. + u_int8_t ha_elem = (u_int8_t)GET_MODE_SIZE (ag_mode);
  119. + u_int8_t ha_num = (u_int8_t)nregs;
  120. +
  121. + tree result = build_tree_list(0, build_integer_cst(flags, ubyte_type_node));
  122. + result = chainon (result, build_tree_list(0, build_integer_cst(ha_elem, ubyte_type_node)));
  123. + result = chainon (result, build_tree_list(0, build_integer_cst(ha_num, ubyte_type_node)));
  124. +
  125. + return result;
  126. + }
  127. + else
  128. + {
  129. + return NULL_TREE;
  130. + }
  131. +}
  132. diff -ur gcc-8-20171210.old/gcc/config/aarch64/aarch64.h gcc-8-20171210.new/gcc/config/aarch64/aarch64.h
  133. --- gcc-8-20171210.old/gcc/config/aarch64/aarch64.h 2018-02-04 21:10:55.412793007 +0100
  134. +++ gcc-8-20171210.new/gcc/config/aarch64/aarch64.h 2018-02-04 21:02:13.321405413 +0100
  135. @@ -29,6 +29,9 @@
  136. /* Target CPU versions for D. */
  137. #define TARGET_D_CPU_VERSIONS aarch64_d_target_versions
  138.  
  139. +#define TARGET_D_VAARG_TI_TYPES aarch64_d_vaarg_ti_types
  140. +#define TARGET_D_VAARG_TI_VALUES aarch64_d_vaarg_ti_values
  141. +
  142.  
  143. #define REGISTER_TARGET_PRAGMAS() aarch64_register_pragmas ()
  144. diff -ur gcc-8-20171210.old/gcc/config/aarch64/aarch64-protos.h gcc-8-20171210.new/gcc/config/aarch64/aarch64-protos.h
  145. --- gcc-8-20171210.old/gcc/config/aarch64/aarch64-protos.h 2018-02-04 21:10:55.412793007 +0100
  146. +++ gcc-8-20171210.new/gcc/config/aarch64/aarch64-protos.h 2018-02-04 21:02:13.349406238 +0100
  147. @@ -23,6 +23,7 @@
  148. #define GCC_AARCH64_PROTOS_H
  149.  
  150. #include "input.h"
  151. +#include "d/d-target.h"
  152.  
  153. /* SYMBOL_SMALL_ABSOLUTE: Generate symbol accesses through
  154. high and lo relocs that calculate the base address using a PC
  155. @@ -497,6 +498,8 @@
  156.  
  157. /* Defined in aarch64-d.c */
  158. extern void aarch64_d_target_versions (void);
  159. +extern tree aarch64_d_vaarg_ti_types (d_tinfo_kind);
  160. +extern tree aarch64_d_vaarg_ti_values (d_tinfo_kind, tree);
  161.  
  162. rtl_opt_pass *make_pass_fma_steering (gcc::context *ctxt);
  163.  
  164. Nur in gcc-8-20171210.new/gcc/config/aarch64: .goutputstream-FHWPDZ.
  165. diff -ur gcc-8-20171210.old/gcc/config/default-d.c gcc-8-20171210.new/gcc/config/default-d.c
  166. --- gcc-8-20171210.old/gcc/config/default-d.c 2018-02-04 21:10:55.484795129 +0100
  167. +++ gcc-8-20171210.new/gcc/config/default-d.c 2018-02-04 21:02:13.449409186 +0100
  168. @@ -23,3 +23,19 @@
  169. #include "d/d-target-def.h"
  170.  
  171. struct gcc_targetdm targetdm = TARGETDM_INITIALIZER;
  172. +
  173. +/* Default target specific typeinfo fields: none. */
  174. +
  175. +tree
  176. +d_default_vaarg_ti_types (d_tinfo_kind ti)
  177. +{
  178. + return build_tree_list(0, void_type_node);
  179. +}
  180. +
  181. +/* Default target specific typeinfo fields: none. */
  182. +
  183. +tree
  184. +d_default_vaarg_ti_values (d_tinfo_kind ti, tree type)
  185. +{
  186. + return NULL_TREE;
  187. +}
  188. diff -ur gcc-8-20171210.old/gcc/doc/tm.texi gcc-8-20171210.new/gcc/doc/tm.texi
  189. --- gcc-8-20171210.old/gcc/doc/tm.texi 2018-02-04 21:10:55.680800905 +0100
  190. +++ gcc-8-20171210.new/gcc/doc/tm.texi 2018-02-04 21:02:33.842010280 +0100
  191. @@ -10523,6 +10523,14 @@
  192. Returns the size of the data structure used by the targeted operating system for critical sections and monitors. For example, on Microsoft Windows this would return the @code{sizeof(CRITICAL_SECTION)}, while other platforms that implement pthreads would return @code{sizeof(pthread_mutex_t)}.
  193. @end deftypefn
  194.  
  195. +@deftypefn {D Target Hook} tree TARGET_D_VAARG_TI_TYPES (d_tinfo_kind)
  196. +Returns types of target-specific fields which need to be inserted into TypeInfo to support the va_arg variant taking a TypeInfo argument. The va_arg imlementation can be found in core/stdc/stdarg.d. This function's first parameter is a @code{tinfo_kind} as fields can be differnt depending on the kind of TypeInfo. Returns a @code{TREE_LIST} of types and void_zero_node if no extra fields are needed.
  197. +@end deftypefn
  198. +
  199. +@deftypefn {D Target Hook} tree TARGET_D_VAARG_TI_VALUES (d_tinfo_kind, @var{tree})
  200. +Returns initial values for target-specific fields which need to be inserted into TypeInfo to support the va_arg variant taking a TypeInfo argument. The va_arg imlementation can be found in core/stdc/stdarg.d. This function's first parameter is a @code{tree} for the type described by the TypeInfo instance. Returns a @code{TREE_LIST} of initial values and NULL_TREE if no extra fields are needed.
  201. +@end deftypefn
  202. +
  203. @node Named Address Spaces
  204. @section Adding support for named address spaces
  205. @cindex named address spaces
  206. diff -ur gcc-8-20171210.old/gcc/doc/tm.texi.in gcc-8-20171210.new/gcc/doc/tm.texi.in
  207. --- gcc-8-20171210.old/gcc/doc/tm.texi.in 2018-02-04 21:10:55.684801023 +0100
  208. +++ gcc-8-20171210.new/gcc/doc/tm.texi.in 2018-02-04 21:02:33.958013700 +0100
  209. @@ -7257,6 +7257,10 @@
  210.  
  211. @hook TARGET_D_CRITSEC_SIZE
  212.  
  213. +@hook TARGET_D_VAARG_TI_TYPES
  214. +
  215. +@hook TARGET_D_VAARG_TI_VALUES
  216. +
  217. @node Named Address Spaces
  218. @section Adding support for named address spaces
  219. @cindex named address spaces
Add Comment
Please, Sign In to add comment