Commit 3c898e1a by Ilya Tocar Committed by Kirill Yukhin

re PR target/60204 (struct with __m512i is mishandled in function parameter passing and return)

gcc/
	PR target/60204
	* config/i386/i386.c (classify_argument): Pass structures of size
	64 bytes or less in register.

tessuite/gcc/
	PR target/60204
	* gcc.target/x86_64/abi/avx512f/test_passing_structs.c: Update to
	reflect abi fix.
	* gcc.target/x86_64/abi/avx512f/test_passing_unions.c: Ditto.

From-SVN: r207933
parent df62b4af
2014-02-20 Ilya Tocar <ilya.tocar@intel.com>
PR target/60204
* config/i386/i386.c (classify_argument): Pass structures of size
64 bytes or less in register.
2014-02-20 Ilya Tocar <ilya.tocar@intel.com>
Kirill Yukhin <kirill.yukhin@intel.com>
* config/i386/avx512erintrin.h (_mm_rcp28_round_sd): Swap operands.
......
......@@ -6421,8 +6421,8 @@ classify_argument (enum machine_mode mode, const_tree type,
tree field;
enum x86_64_reg_class subclasses[MAX_CLASSES];
/* On x86-64 we pass structures larger than 32 bytes on the stack. */
if (bytes > 32)
/* On x86-64 we pass structures larger than 64 bytes on the stack. */
if (bytes > 64)
return 0;
for (i = 0; i < words; i++)
2014-02-20 Ilya Tocar <ilya.tocar@intel.com>
PR target/60204
* gcc.target/x86_64/abi/avx512f/test_passing_structs.c: Update to
reflect abi fix.
* gcc.target/x86_64/abi/avx512f/test_passing_unions.c: Ditto.
2014-02-20 Ilya Tocar <ilya.tocar@intel.com>
Kirill Yukhin <kirill.yukhin@intel.com>
* gcc.target/i386/avx512er-vrcp28sd-2.c: Distinguish src1 and src2.
......
......@@ -26,16 +26,8 @@ check_struct_passing1 (struct m512_struct ms1 ATTRIBUTE_UNUSED,
struct m512_struct ms7 ATTRIBUTE_UNUSED,
struct m512_struct ms8 ATTRIBUTE_UNUSED)
{
/* Check the passing on the stack by comparing the address of the
stack elements to the expected place on the stack. */
assert ((unsigned long)&ms1.x == rsp+8);
assert ((unsigned long)&ms2.x == rsp+72);
assert ((unsigned long)&ms3.x == rsp+136);
assert ((unsigned long)&ms4.x == rsp+200);
assert ((unsigned long)&ms5.x == rsp+264);
assert ((unsigned long)&ms6.x == rsp+328);
assert ((unsigned long)&ms7.x == rsp+392);
assert ((unsigned long)&ms8.x == rsp+456);
/* Check register contents. */
check_m512_arguments;
}
void
......
......@@ -52,24 +52,8 @@ check_union_passing1(union un1 u1 ATTRIBUTE_UNUSED,
union un1 u7 ATTRIBUTE_UNUSED,
union un1 u8 ATTRIBUTE_UNUSED)
{
/* Check the passing on the stack by comparing the address of the
stack elements to the expected place on the stack. */
assert ((unsigned long)&u1.x == rsp+8);
assert ((unsigned long)&u1.f == rsp+8);
assert ((unsigned long)&u2.x == rsp+72);
assert ((unsigned long)&u2.f == rsp+72);
assert ((unsigned long)&u3.x == rsp+136);
assert ((unsigned long)&u3.f == rsp+136);
assert ((unsigned long)&u4.x == rsp+200);
assert ((unsigned long)&u4.f == rsp+200);
assert ((unsigned long)&u5.x == rsp+264);
assert ((unsigned long)&u5.f == rsp+264);
assert ((unsigned long)&u6.x == rsp+328);
assert ((unsigned long)&u6.f == rsp+328);
assert ((unsigned long)&u7.x == rsp+392);
assert ((unsigned long)&u7.f == rsp+392);
assert ((unsigned long)&u8.x == rsp+456);
assert ((unsigned long)&u8.f == rsp+456);
/* Check register contents. */
check_m512_arguments;
}
void
......@@ -82,24 +66,8 @@ check_union_passing2(union un2 u1 ATTRIBUTE_UNUSED,
union un2 u7 ATTRIBUTE_UNUSED,
union un2 u8 ATTRIBUTE_UNUSED)
{
/* Check the passing on the stack by comparing the address of the
stack elements to the expected place on the stack. */
assert ((unsigned long)&u1.x == rsp+8);
assert ((unsigned long)&u1.d == rsp+8);
assert ((unsigned long)&u2.x == rsp+72);
assert ((unsigned long)&u2.d == rsp+72);
assert ((unsigned long)&u3.x == rsp+136);
assert ((unsigned long)&u3.d == rsp+136);
assert ((unsigned long)&u4.x == rsp+200);
assert ((unsigned long)&u4.d == rsp+200);
assert ((unsigned long)&u5.x == rsp+264);
assert ((unsigned long)&u5.d == rsp+264);
assert ((unsigned long)&u6.x == rsp+328);
assert ((unsigned long)&u6.d == rsp+328);
assert ((unsigned long)&u7.x == rsp+392);
assert ((unsigned long)&u7.d == rsp+392);
assert ((unsigned long)&u8.x == rsp+456);
assert ((unsigned long)&u8.d == rsp+456);
/* Check register contents. */
check_m512_arguments;
}
void
......@@ -112,24 +80,8 @@ check_union_passing3(union un3 u1 ATTRIBUTE_UNUSED,
union un3 u7 ATTRIBUTE_UNUSED,
union un3 u8 ATTRIBUTE_UNUSED)
{
/* Check the passing on the stack by comparing the address of the
stack elements to the expected place on the stack. */
assert ((unsigned long)&u1.x == rsp+8);
assert ((unsigned long)&u1.v == rsp+8);
assert ((unsigned long)&u2.x == rsp+72);
assert ((unsigned long)&u2.v == rsp+72);
assert ((unsigned long)&u3.x == rsp+136);
assert ((unsigned long)&u3.v == rsp+136);
assert ((unsigned long)&u4.x == rsp+200);
assert ((unsigned long)&u4.v == rsp+200);
assert ((unsigned long)&u5.x == rsp+264);
assert ((unsigned long)&u5.v == rsp+264);
assert ((unsigned long)&u6.x == rsp+328);
assert ((unsigned long)&u6.v == rsp+328);
assert ((unsigned long)&u7.x == rsp+392);
assert ((unsigned long)&u7.v == rsp+392);
assert ((unsigned long)&u8.x == rsp+456);
assert ((unsigned long)&u8.v == rsp+456);
/* Check register contents. */
check_m512_arguments;
}
void
......@@ -160,22 +112,8 @@ check_union_passing6(union un6 u1 ATTRIBUTE_UNUSED,
union un6 u7 ATTRIBUTE_UNUSED,
union un6 u8 ATTRIBUTE_UNUSED)
{
assert ((unsigned long)&u1.x == rsp+8);
assert ((unsigned long)&u1.v == rsp+8);
assert ((unsigned long)&u2.x == rsp+72);
assert ((unsigned long)&u2.v == rsp+72);
assert ((unsigned long)&u3.x == rsp+136);
assert ((unsigned long)&u3.v == rsp+136);
assert ((unsigned long)&u4.x == rsp+200);
assert ((unsigned long)&u4.v == rsp+200);
assert ((unsigned long)&u5.x == rsp+264);
assert ((unsigned long)&u5.v == rsp+264);
assert ((unsigned long)&u6.x == rsp+328);
assert ((unsigned long)&u6.v == rsp+328);
assert ((unsigned long)&u7.x == rsp+392);
assert ((unsigned long)&u7.v == rsp+392);
assert ((unsigned long)&u8.x == rsp+456);
assert ((unsigned long)&u8.v == rsp+456);
/* Check register contents. */
check_m512_arguments;
}
#define check_union_passing1 WRAP_CALL(check_union_passing1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment