extern Ada_Version_Type Ada_Version;
extern Boolean Back_End_Inlining;
extern Boolean Debug_Generated_Code;
+extern Boolean Enable_128bit_Types;
extern Boolean Exception_Extra_Info;
extern Boolean Exception_Locations_Suppressed;
extern Exception_Mechanism_Type Exception_Mechanism;
else if (IN (kind, Access_Kind))
max_esize = POINTER_SIZE * 2;
else
- max_esize = LONG_LONG_TYPE_SIZE;
+ max_esize = Enable_128bit_Types ? 128 : LONG_LONG_TYPE_SIZE;
if (esize > max_esize)
esize = max_esize;
/* Function decl node for 64-bit multiplication with overflow checking. */
ADT_mulv64_decl,
+ /* Function decl node for 128-bit multiplication with overflow checking. */
+ ADT_mulv128_decl,
+
/* Identifier for the name of the _Parent field in tagged record types. */
ADT_parent_name_id,
#define free_decl gnat_std_decls[(int) ADT_free_decl]
#define realloc_decl gnat_std_decls[(int) ADT_realloc_decl]
#define mulv64_decl gnat_std_decls[(int) ADT_mulv64_decl]
+#define mulv128_decl gnat_std_decls[(int) ADT_mulv128_decl]
#define parent_name_id gnat_std_decls[(int) ADT_parent_name_id]
#define exception_data_name_id gnat_std_decls[(int) ADT_exception_data_name_id]
#define jmpbuf_type gnat_std_decls[(int) ADT_jmpbuf_type]
extern Pos get_target_int_size (void);
extern Pos get_target_long_size (void);
extern Pos get_target_long_long_size (void);
+extern Pos get_target_long_long_long_size (void);
extern Pos get_target_pointer_size (void);
extern Pos get_target_maximum_default_alignment (void);
extern Pos get_target_system_allocator_alignment (void);
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "target.h"
#include "tree.h"
#include "ada.h"
return LONG_LONG_TYPE_SIZE;
}
+Pos
+get_target_long_long_long_size (void)
+{
+ if (targetm.scalar_mode_supported_p (TImode))
+ return GET_MODE_BITSIZE (TImode);
+ else
+ return LONG_LONG_TYPE_SIZE;
+}
+
Pos
get_target_pointer_size (void)
{
NULL_TREE, is_default, true, true, true, false,
false, NULL, Empty);
+ if (Enable_128bit_Types)
+ {
+ tree int128_type = gnat_type_for_size (128, 0);
+ mulv128_decl
+ = create_subprog_decl (get_identifier ("__gnat_mulv128"), NULL_TREE,
+ build_function_type_list (int128_type,
+ int128_type,
+ int128_type,
+ NULL_TREE),
+ NULL_TREE, is_default, true, true, true, false,
+ false, NULL, Empty);
+ }
+
/* Name of the _Parent field in tagged record types. */
parent_name_id = get_identifier (Get_Name_String (Name_uParent));
convert (int64, rhs)));
}
+ /* Likewise for a 128-bit mult and a 64-bit target. */
+ else if (code == MULT_EXPR && precision == 128 && BITS_PER_WORD < 128)
+ {
+ tree int128 = gnat_type_for_size (128, 0);
+ return convert (gnu_type, build_call_n_expr (mulv128_decl, 2,
+ convert (int128, lhs),
+ convert (int128, rhs)));
+ }
+
enum internal_fn icode;
switch (code)
not already have the proper size and the size is not too large. */
if (BIT_PACKED_ARRAY_TYPE_P (type)
|| (TYPE_PRECISION (type) == size && biased_p == for_biased)
- || size > LONG_LONG_TYPE_SIZE)
+ || size > (Enable_128bit_Types ? 128 : LONG_LONG_TYPE_SIZE))
break;
biased_p |= for_biased;