+2015-06-17 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (ix86_function_arg): Nest TARGET_64BIT code.
+ (ix86_function_arg_advance): Ditto.
+ (ix86_pass_by_reference): Ditto. Rewrite MS_ABI part.
+
2015-06-17 Andrew MacLeod <amacleod@redhat.com>
* function.h (struct rtl_data): Remove struct and accessor macros.
2017-06-17 Andrew MacLeod <amacleod@redhat.com>
- * tree-core.h (tree_target_option): Make opts field a pointer to a
+ * tree-core.h (tree_target_option): Make opts field a pointer to a
cl_target_option instead of an instance of the struct.
* tree.h (TREE_TARGET_OPTION): Return the pointer, not an address of
the structure.
- * tree.c (make_node_stat ): Allocate a cl_target_option struct for
+ * tree.c (make_node_stat ): Allocate a cl_target_option struct for
TARGET_OPTION_NODE.
(copy_node_stat): Allocate and copy struct cl_target_option.
cum->force_bnd_pass = 0;
}
- if (TARGET_64BIT && (cum ? cum->call_abi : ix86_abi) == MS_ABI)
- nregs = function_arg_advance_ms_64 (cum, bytes, words);
- else if (TARGET_64BIT)
- nregs = function_arg_advance_64 (cum, mode, type, words, named);
+ if (TARGET_64BIT)
+ {
+ enum calling_abi call_abi = cum ? cum->call_abi : ix86_abi;
+
+ if (call_abi == MS_ABI)
+ nregs = function_arg_advance_ms_64 (cum, bytes, words);
+ else
+ nregs = function_arg_advance_64 (cum, mode, type, words, named);
+ }
else
nregs = function_arg_advance_32 (cum, mode, type, bytes, words);
if (type && TREE_CODE (type) == VECTOR_TYPE)
mode = type_natural_mode (type, cum, false);
- if (TARGET_64BIT && (cum ? cum->call_abi : ix86_abi) == MS_ABI)
- arg = function_arg_ms_64 (cum, mode, omode, named, bytes);
- else if (TARGET_64BIT)
- arg = function_arg_64 (cum, mode, omode, type, named);
+ if (TARGET_64BIT)
+ {
+ enum calling_abi call_abi = cum ? cum->call_abi : ix86_abi;
+
+ if (call_abi == MS_ABI)
+ arg = function_arg_ms_64 (cum, mode, omode, named, bytes);
+ else
+ arg = function_arg_64 (cum, mode, omode, type, named);
+ }
else
arg = function_arg_32 (cum, mode, omode, type, bytes, words);
|| POINTER_BOUNDS_MODE_P (mode))
return false;
- /* See Windows x64 Software Convention. */
- if (TARGET_64BIT && (cum ? cum->call_abi : ix86_abi) == MS_ABI)
+ if (TARGET_64BIT)
{
- int msize = (int) GET_MODE_SIZE (mode);
- if (type)
+ enum calling_abi call_abi = cum ? cum->call_abi : ix86_abi;
+
+ /* See Windows x64 Software Convention. */
+ if (call_abi == MS_ABI)
{
- /* Arrays are passed by reference. */
- if (TREE_CODE (type) == ARRAY_TYPE)
- return true;
+ HOST_WIDE_INT msize = GET_MODE_SIZE (mode);
- if (AGGREGATE_TYPE_P (type))
+ if (type)
{
- /* Structs/unions of sizes other than 8, 16, 32, or 64 bits
- are passed by reference. */
- msize = int_size_in_bytes (type);
+ /* Arrays are passed by reference. */
+ if (TREE_CODE (type) == ARRAY_TYPE)
+ return true;
+
+ if (RECORD_OR_UNION_TYPE_P (type))
+ {
+ /* Structs/unions of sizes other than 8, 16, 32, or 64 bits
+ are passed by reference. */
+ msize = int_size_in_bytes (type);
+ }
}
- }
- /* __m128 is passed by reference. */
- switch (msize) {
- case 1: case 2: case 4: case 8:
- break;
- default:
- return true;
- }
+ /* __m128 is passed by reference. */
+ return msize != 1 && msize != 2 && msize != 4 && msize != 8;
+ }
+ else if (type && int_size_in_bytes (type) == -1)
+ return true;
}
- else if (TARGET_64BIT && type && int_size_in_bytes (type) == -1)
- return 1;
- return 0;
+ return false;
}
/* Return true when TYPE should be 128bit aligned for 32bit argument