aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r--gcc/ada/gcc-interface/trans.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 39d4d28..9be1295 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -439,6 +439,19 @@ gigi (Node_Id gnat_root,
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));
@@ -9388,6 +9401,15 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left,
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)