+2008-05-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/35657
+ * config/i386/i386.c (contains_128bit_aligned_vector_p): Renamed
+ to ...
+ (contains_aligned_value_p): This. Handle _Decimal128.
+ (ix86_function_arg_boundary): Only align _Decimal128 to its
+ natural boundary and handle it properly.
+
2008-05-06 Martin Jambor <mjambor@suse.cz>
- * ipa-cp.c (ipcp_method_orig_node): Renamed to ipcp_get_orig_node.
- (ipcp_method_is_cloned): Renamed to ipcp_node_is_clone
- (ipcp_method_set_orig_node): Removed.
- (ipcp_cval_get_cvalue_type): Removed.
- (ipcp_method_get_scale): Renamed to ipcp_get_node_scale.
- (ipcp_method_set_scale): Renamed to ipcp_set_node_scale.
- (ipcp_cval_set_cvalue_type): Removed.
- (ipcp_cval_get_cvalue): Removed.
- (ipcp_cval_set_cvalue): Removed.
- (ipcp_type_is_const): Renamed to ipcp_lat_is_const.
- (ipcp_cval_equal_cvalues): Renamed to ipcp_lats_are_equal
- (ipcp_lats_are_equal): Changed parameters to two ipcp_lattice's
- (ipcp_cval_meet): Renamed to ipa_lattice_meet
- (ipcp_cval_changed): Changed to use ipcp_lat_is_const
- (ipcp_method_cval): Renamed to ipcp_get_ith_lattice
- (ipcp_get_ith_lattice): Changed parameters.
- (ipcp_cval_compute): Renamed to ipcp_lattice_from_jfunc
- (ipcp_lattice_from_jfunc): Changed parameters.
+ * ipa-cp.c (ipcp_method_orig_node): Renamed to ipcp_get_orig_node.
+ (ipcp_method_is_cloned): Renamed to ipcp_node_is_clone
+ (ipcp_method_set_orig_node): Removed.
+ (ipcp_cval_get_cvalue_type): Removed.
+ (ipcp_method_get_scale): Renamed to ipcp_get_node_scale.
+ (ipcp_method_set_scale): Renamed to ipcp_set_node_scale.
+ (ipcp_cval_set_cvalue_type): Removed.
+ (ipcp_cval_get_cvalue): Removed.
+ (ipcp_cval_set_cvalue): Removed.
+ (ipcp_type_is_const): Renamed to ipcp_lat_is_const.
+ (ipcp_cval_equal_cvalues): Renamed to ipcp_lats_are_equal
+ (ipcp_lats_are_equal): Changed parameters to two ipcp_lattice's
+ (ipcp_cval_meet): Renamed to ipa_lattice_meet
+ (ipcp_cval_changed): Changed to use ipcp_lat_is_const
+ (ipcp_method_cval): Renamed to ipcp_get_ith_lattice
+ (ipcp_get_ith_lattice): Changed parameters.
+ (ipcp_cval_compute): Renamed to ipcp_lattice_from_jfunc
+ (ipcp_lattice_from_jfunc): Changed parameters.
(ipcp_redirect): Local lattice pointer instead of lattice type variable.
(ipcp_method_cval_print): Added temporary variable info.
(ipcp_redirect): Removed already unused local variable caller.
}
/* Return true when TYPE should be 128bit aligned for 32bit argument passing
- ABI. Only called if TARGET_SSE. */
+ ABI. */
static bool
-contains_128bit_aligned_vector_p (tree type)
+contains_aligned_value_p (tree type)
{
enum machine_mode mode = TYPE_MODE (type);
- if (SSE_REG_MODE_P (mode)
+ if (((TARGET_SSE && SSE_REG_MODE_P (mode)) || mode == TDmode)
&& (!TYPE_USER_ALIGN (type) || TYPE_ALIGN (type) > 128))
return true;
if (TYPE_ALIGN (type) < 128)
for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
{
if (TREE_CODE (field) == FIELD_DECL
- && contains_128bit_aligned_vector_p (TREE_TYPE (field)))
+ && contains_aligned_value_p (TREE_TYPE (field)))
return true;
}
break;
case ARRAY_TYPE:
/* Just for use if some languages passes arrays by value. */
- if (contains_128bit_aligned_vector_p (TREE_TYPE (type)))
+ if (contains_aligned_value_p (TREE_TYPE (type)))
return true;
break;
align = GET_MODE_ALIGNMENT (mode);
if (align < PARM_BOUNDARY)
align = PARM_BOUNDARY;
- /* Decimal floating point is aligned to its natural boundary. */
- if (!TARGET_64BIT && !VALID_DFP_MODE_P (mode))
+ /* In 32bit, only _Decimal128 is aligned to its natural boundary. */
+ if (!TARGET_64BIT && mode != TDmode)
{
/* i386 ABI defines all arguments to be 4 byte aligned. We have to
make an exception for SSE modes since these require 128bit
The handling here differs from field_alignment. ICC aligns MMX
arguments to 4 byte boundaries, while structure fields are aligned
to 8 byte boundaries. */
- if (!TARGET_SSE)
- align = PARM_BOUNDARY;
- else if (!type)
+ if (!type)
{
- if (!SSE_REG_MODE_P (mode))
+ if (!(TARGET_SSE && SSE_REG_MODE_P (mode)) && mode != TDmode)
align = PARM_BOUNDARY;
}
else
{
- if (!contains_128bit_aligned_vector_p (type))
+ if (!contains_aligned_value_p (type))
align = PARM_BOUNDARY;
}
}