RISC-V: Adjust stdint.h to stdint-gcc.h for rvv tests
Checks
Commit Message
From: Pan Li <pan2.li@intel.com>
This patch would like to align the stdint.h to the stdint-gcc.h for all
the RVV test files. Aka:
stdint.h => stdint-gcc.h
Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h:
Replace stdint.h with stdint-gcc.h.
* gcc.target/riscv/rvv/autovec/binop/shift-template.h: Ditto.
* gcc.target/riscv/rvv/autovec/binop/vadd-template.h: Ditto.
* gcc.target/riscv/rvv/autovec/binop/vand-template.h: Ditto.
* gcc.target/riscv/rvv/autovec/binop/vdiv-template.h: Ditto.
* gcc.target/riscv/rvv/autovec/binop/vmax-template.h: Ditto.
* gcc.target/riscv/rvv/autovec/binop/vmin-template.h: Ditto.
* gcc.target/riscv/rvv/autovec/binop/vmul-template.h: Ditto.
* gcc.target/riscv/rvv/autovec/binop/vor-template.h: Ditto.
* gcc.target/riscv/rvv/autovec/binop/vrem-template.h: Ditto.
* gcc.target/riscv/rvv/autovec/binop/vsub-template.h: Ditto.
* gcc.target/riscv/rvv/autovec/binop/vxor-template.h: Ditto.
* gcc.target/riscv/rvv/autovec/series-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/vmv-imm-run.c: Ditto.
* gcc.target/riscv/rvv/autovec/vmv-imm-template.h: Ditto.
---
.../gcc.target/riscv/rvv/autovec/binop/shift-scalar-template.h | 2 +-
.../gcc.target/riscv/rvv/autovec/binop/shift-template.h | 2 +-
.../gcc.target/riscv/rvv/autovec/binop/vadd-template.h | 2 +-
.../gcc.target/riscv/rvv/autovec/binop/vand-template.h | 2 +-
.../gcc.target/riscv/rvv/autovec/binop/vdiv-template.h | 2 +-
.../gcc.target/riscv/rvv/autovec/binop/vmax-template.h | 2 +-
.../gcc.target/riscv/rvv/autovec/binop/vmin-template.h | 2 +-
.../gcc.target/riscv/rvv/autovec/binop/vmul-template.h | 2 +-
gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/vor-template.h | 2 +-
.../gcc.target/riscv/rvv/autovec/binop/vrem-template.h | 2 +-
.../gcc.target/riscv/rvv/autovec/binop/vsub-template.h | 2 +-
.../gcc.target/riscv/rvv/autovec/binop/vxor-template.h | 2 +-
gcc/testsuite/gcc.target/riscv/rvv/autovec/series-1.c | 2 +-
gcc/testsuite/gcc.target/riscv/rvv/autovec/vmv-imm-run.c | 2 +-
gcc/testsuite/gcc.target/riscv/rvv/autovec/vmv-imm-template.h | 2 +-
15 files changed, 15 insertions(+), 15 deletions(-)
Comments
> This patch would like to align the stdint.h to the stdint-gcc.h for all
> the RVV test files. Aka:
>
> stdint.h => stdint-gcc.h
Looks good. Jeff already pre-approved so you can go ahead and install
this on the trunk.
Regards
Robin
Got it, thanks, will commit to trunk after pass the rvv test.
Pan
-----Original Message-----
From: Robin Dapp <rdapp.gcc@gmail.com>
Sent: Tuesday, May 16, 2023 3:11 PM
To: Li, Pan2 <pan2.li@intel.com>; gcc-patches@gcc.gnu.org
Cc: rdapp.gcc@gmail.com; juzhe.zhong@rivai.ai; kito.cheng@sifive.com; Wang, Yanzhang <yanzhang.wang@intel.com>; jeffreyalaw@gmail.com
Subject: Re: [PATCH] RISC-V: Adjust stdint.h to stdint-gcc.h for rvv tests
> This patch would like to align the stdint.h to the stdint-gcc.h for
> all the RVV test files. Aka:
>
> stdint.h => stdint-gcc.h
Looks good. Jeff already pre-approved so you can go ahead and install this on the trunk.
Regards
Robin
Committed, thanks all.
Pan
-----Original Message-----
From: Li, Pan2
Sent: Tuesday, May 16, 2023 3:17 PM
To: Robin Dapp <rdapp.gcc@gmail.com>; gcc-patches@gcc.gnu.org
Cc: juzhe.zhong@rivai.ai; kito.cheng@sifive.com; Wang, Yanzhang <yanzhang.wang@intel.com>; jeffreyalaw@gmail.com
Subject: RE: [PATCH] RISC-V: Adjust stdint.h to stdint-gcc.h for rvv tests
Got it, thanks, will commit to trunk after pass the rvv test.
Pan
-----Original Message-----
From: Robin Dapp <rdapp.gcc@gmail.com>
Sent: Tuesday, May 16, 2023 3:11 PM
To: Li, Pan2 <pan2.li@intel.com>; gcc-patches@gcc.gnu.org
Cc: rdapp.gcc@gmail.com; juzhe.zhong@rivai.ai; kito.cheng@sifive.com; Wang, Yanzhang <yanzhang.wang@intel.com>; jeffreyalaw@gmail.com
Subject: Re: [PATCH] RISC-V: Adjust stdint.h to stdint-gcc.h for rvv tests
> This patch would like to align the stdint.h to the stdint-gcc.h for
> all the RVV test files. Aka:
>
> stdint.h => stdint-gcc.h
Looks good. Jeff already pre-approved so you can go ahead and install this on the trunk.
Regards
Robin
On Tue, May 16, 2023 at 9:11 AM Robin Dapp via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> > This patch would like to align the stdint.h to the stdint-gcc.h for all
> > the RVV test files. Aka:
> >
> > stdint.h => stdint-gcc.h
>
> Looks good. Jeff already pre-approved so you can go ahead and install
> this on the trunk.
Huh, including stdint-gcc.h looks completely wrong. What's the issue you are
trying to solve?
> Regards
> Robin
> Huh, including stdint-gcc.h looks completely wrong. What's the issue you are
> trying to solve?
The way I understood it is that that's a temporary workaround until
all multilib et al. (+testsuite) configurations are in place but I
haven't checked the details myself. Eventually this should be done
properly so we can include the regular headers. Kito might want to
comment as he dealt with it before.
I used #include <stdlib.h> for all those tests and Andreas Schwab reported:
/usr/include/gnu/stubs.h:11:11: fatal error: gnu/stubs-ilp32d.h: No such file or directory
Regards
Robin
RISC-V glibc will require corresponding muilti-lib has built there,
otherwise will report something like:
/usr/include/gnu/stubs.h:11:11: fatal error: gnu/stubs-ilp32d.h: No
such file or directory
But actually we only require those fixed length types to compile and
scan assembly or dump,
So we don't really have those multilib built, that's the reason we
workaround this way.
This way could work even if the multilib build is disabled, and seems
ARM has same issue around that and just disable those tests:
---
# Return 1 if this is an ARM target supporting -mfloat-abi=soft. Some
# multilibs may be incompatible with this option.
proc check_effective_target_arm_soft_ok { } {
return [check_no_compiler_messages arm_soft_ok object {
#include <stdint.h>
int dummy;
int main (void) { return 0; }
} "-mfloat-abi=soft"]
}
# Return 1 if this is an ARM target supporting -mfloat-abi=soft even
# for linking. Some multilibs may be incompatible with this option,
# and some linkers may reject incompatible options.
proc check_effective_target_arm_soft_ok_link { } {
return [check_no_compiler_messages arm_soft_ok_link executable {
#include <stdint.h>
int dummy;
int main (void) { return 0; }
} "-mfloat-abi=soft"]
}
---
On Wed, May 17, 2023 at 2:25 PM Robin Dapp <rdapp.gcc@gmail.com> wrote:
>
> > Huh, including stdint-gcc.h looks completely wrong. What's the issue you are
> > trying to solve?
>
> The way I understood it is that that's a temporary workaround until
> all multilib et al. (+testsuite) configurations are in place but I
> haven't checked the details myself. Eventually this should be done
> properly so we can include the regular headers. Kito might want to
> comment as he dealt with it before.
>
> I used #include <stdlib.h> for all those tests and Andreas Schwab reported:
>
> /usr/include/gnu/stubs.h:11:11: fatal error: gnu/stubs-ilp32d.h: No such file or directory
>
> Regards
> Robin
> Am 17.05.2023 um 08:55 schrieb Kito Cheng <kito.cheng@sifive.com>:
>
> RISC-V glibc will require corresponding muilti-lib has built there,
> otherwise will report something like:
>
> /usr/include/gnu/stubs.h:11:11: fatal error: gnu/stubs-ilp32d.h: No
> such file or directory
>
> But actually we only require those fixed length types to compile and
> scan assembly or dump,
> So we don't really have those multilib built, that's the reason we
> workaround this way.
>
> This way could work even if the multilib build is disabled, and seems
> ARM has same issue around that and just disable those tests:
Then just mimic that or avoid using stdint.h and instead use things like __INT32_TYPE__?
> ---
> # Return 1 if this is an ARM target supporting -mfloat-abi=soft. Some
> # multilibs may be incompatible with this option.
>
> proc check_effective_target_arm_soft_ok { } {
> return [check_no_compiler_messages arm_soft_ok object {
> #include <stdint.h>
> int dummy;
> int main (void) { return 0; }
> } "-mfloat-abi=soft"]
> }
>
> # Return 1 if this is an ARM target supporting -mfloat-abi=soft even
> # for linking. Some multilibs may be incompatible with this option,
> # and some linkers may reject incompatible options.
>
> proc check_effective_target_arm_soft_ok_link { } {
> return [check_no_compiler_messages arm_soft_ok_link executable {
> #include <stdint.h>
> int dummy;
> int main (void) { return 0; }
> } "-mfloat-abi=soft"]
> }
> ---
>
>
>> On Wed, May 17, 2023 at 2:25 PM Robin Dapp <rdapp.gcc@gmail.com> wrote:
>>
>>> Huh, including stdint-gcc.h looks completely wrong. What's the issue you are
>>> trying to solve?
>>
>> The way I understood it is that that's a temporary workaround until
>> all multilib et al. (+testsuite) configurations are in place but I
>> haven't checked the details myself. Eventually this should be done
>> properly so we can include the regular headers. Kito might want to
>> comment as he dealt with it before.
>>
>> I used #include <stdlib.h> for all those tests and Andreas Schwab reported:
>>
>> /usr/include/gnu/stubs.h:11:11: fatal error: gnu/stubs-ilp32d.h: No such file or directory
>>
>> Regards
>> Robin
> > RISC-V glibc will require corresponding muilti-lib has built there,
> > otherwise will report something like:
> >
> > /usr/include/gnu/stubs.h:11:11: fatal error: gnu/stubs-ilp32d.h: No
> > such file or directory
> >
> > But actually we only require those fixed length types to compile and
> > scan assembly or dump,
> > So we don't really have those multilib built, that's the reason we
> > workaround this way.
> >
> > This way could work even if the multilib build is disabled, and seems
> > ARM has same issue around that and just disable those tests:
>
> Then just mimic that or avoid using stdint.h and instead use things like __INT32_TYPE__?
Hmmm, then that seems like we are inline those types definition from
stdint-gcc.h?
I mean what stdint-gcc.h did is just same as that:
#ifdef __INT8_TYPE__
typedef __INT8_TYPE__ int8_t;
#endif
...
#ifdef __UINT64_TYPE__
typedef __UINT64_TYPE__ uint64_t;
#endif
@@ -2,7 +2,7 @@
/* { dg-do run } */
/* { dg-additional-options "-std=c99 --param=riscv-autovec-preference=scalable -fno-vect-cost-model --save-temps" } */
-#include <stdint.h>
+#include <stdint-gcc.h>
#include <assert.h>
#define SHIFTL(TYPE,VAL) \
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <stdint-gcc.h>
#define TEST1_TYPE(TYPE) \
__attribute__((noipa)) \
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <stdint-gcc.h>
#define TEST_TYPE(TYPE) \
__attribute__((noipa)) \
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <stdint-gcc.h>
#define TEST_TYPE(TYPE) \
__attribute__((noipa)) \
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <stdint-gcc.h>
#define TEST_TYPE(TYPE) \
__attribute__((noipa)) \
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <stdint-gcc.h>
#define TEST_TYPE(TYPE) \
__attribute__((noipa)) \
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <stdint-gcc.h>
#define TEST_TYPE(TYPE) \
__attribute__((noipa)) \
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <stdint-gcc.h>
#define TEST_TYPE(TYPE) \
__attribute__((noipa)) \
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <stdint-gcc.h>
#define TEST_TYPE(TYPE) \
__attribute__((noipa)) \
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <stdint-gcc.h>
#define TEST_TYPE(TYPE) \
__attribute__((noipa)) \
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <stdint-gcc.h>
#define TEST_TYPE(TYPE) \
__attribute__((noipa)) \
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <stdint-gcc.h>
#define TEST_TYPE(TYPE) \
__attribute__((noipa)) \
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-march=rv32gcv -mabi=ilp32d --param riscv-autovec-preference=fixed-vlmax --param riscv-autovec-lmul=m4" } */
-#include <stdint.h>
+#include <stdint-gcc.h>
#define NUM_ELEMS(TYPE) (64 / sizeof (TYPE))
@@ -3,7 +3,7 @@
#include "vmv-imm-template.h"
-#include <stdint.h>
+#include <stdint-gcc.h>
#include <assert.h>
#define SZ 512
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <stdint-gcc.h>
#include <assert.h>
#define VMV_POS(TYPE,VAL) \