aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2008-05-08 19:11:23 +0000
committerH.J. Lu <hongjiu.lu@intel.com>2008-05-08 19:11:23 +0000
commit709693aca8a157354b27cb0d7e37abede2cb6a6b (patch)
treeb3694b174dfe53960cb70a04aab06d73f57bd6ea
parent7526ac6789c95bf38e805a352bb955d0f7c0e349 (diff)
2008-05-08 H.J. Lu <hongjiu.lu@intel.com>
Backport from mainline: 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. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_3-branch@135089 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/config/i386/i386.c22
2 files changed, 22 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d747e8b4c58..dc518defd1f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2008-05-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backport from mainline:
+ 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-08 Paolo Bonzini <bonzini@gnu.org>
PR target/36090
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index c0e018316f3..789611e6aa6 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4504,12 +4504,12 @@ ix86_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
}
/* 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)
@@ -4530,7 +4530,7 @@ contains_128bit_aligned_vector_p (tree type)
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;
@@ -4538,7 +4538,7 @@ contains_128bit_aligned_vector_p (tree type)
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;
@@ -4562,8 +4562,8 @@ ix86_function_arg_boundary (enum machine_mode mode, tree type)
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
@@ -4572,16 +4572,14 @@ ix86_function_arg_boundary (enum machine_mode mode, tree type)
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;
}
}