This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[testsuite][ARM target attributes] Fix effective_target tests


Hi,

After the recent commits from Christian adding target attributes
support for ARM FPU settings,  I've noticed that some of the tests
were failing because of incorrect assumptions wrt to the default
cpu/fpu/float-abi of the compiler.

This patch fixes the problems I've noticed in the following way:
- do not force -mfloat-abi=softfp in dg-options, to avoid conflicts
when gcc is configured --with-float=hard

- change arm_vfp_ok such that it tries several -mfpu/-mfloat-abi
flags, checks that __ARM_FP is defined and __ARM_NEON_FP is not
defined

- introduce arm_fp_ok, which is similar but does not enforce fpu setting

- add a new effective_target: arm_crypto_pragma_ok to check that
setting this fpu via a pragma is actually supported by the current
"multilib". This is different from checking the command-line option
because the pragma might conflict with the command-line options in
use.

The updates in the testcases are as follows:
- attr-crypto.c, we have to make sure that the defaut fpu does not
conflict with the one forced by pragma. That's why I use the arm_vfp
options/effective_target. This is needed if gcc has been configured
--with-fpu=neon-fp16, as the pragma fpu=crypto-neon-fp-armv8 would
conflict.

- attr-neon-builtin-fail.c: use arm_fp to force the appropriate
float-abi setting. Enforcing fpu is not needed here.

- attr-neon-fp16.c: similar, I also removed arm_neon_ok since it was
not necessary to make the test pass in my testing. On second thought,
I'm wondering whether I should leave it and make the test unsupported
in more cases (such as when forcing -march=armv5t, although it does
pass with this patch)

- attr-neon2.c: use arm_vfp to force the appropriate float-abi
setting. Enforcing mfpu=vfp is needed to avoid conflict with the
pragma target fpu=neon (for instance if the toolchain default is
neon-fp16)

- attr-neon3.c: similar

Tested on a variety of configurations, see:
http://people.linaro.org/~christophe.lyon/cross-validation/gcc-test-patches/230929-target-attr/report-build-info.html

Note that the regressions reported fall into 3 categories:
- when forcing march=armv5t: tests are now unsupported because I
modified arm_crypto_ok to require arm_v8_neon_ok instead of arm32.

- the warning reported by attr-neon-builtin-fail.c moved from line 12
to 14 and is thus seen as a regression + one improvement

- finally, attr-neon-fp16.c causes an ICE on armeb compilers, for
which I need to post a bugzilla.


TBH, I'm a bit concerned by the complexity of all these multilib-like
conditions. I'm confident that I'm still missing some combinations :-)

And with new target attributes coming, new architectures etc... all
this logic is likely to become even more complex.

That being said, OK for trunk?

Christophe


2015-11-27  Christophe Lyon  <christophe.lyon@linaro.org>

    * lib/target-supports.exp
    (check_effective_target_arm_vfp_ok_nocache): New.
    (check_effective_target_arm_vfp_ok): Call the new
    check_effective_target_arm_vfp_ok_nocache function.
    (check_effective_target_arm_fp_ok_nocache): New.
    (check_effective_target_arm_fp_ok): New.
    (add_options_for_arm_fp): New.
    (check_effective_target_arm_crypto_ok_nocache): Require
    target_arm_v8_neon_ok instead of arm32.
    (check_effective_target_arm_crypto_pragma_ok_nocache): New.
    (check_effective_target_arm_crypto_pragma_ok): New.
    (add_options_for_arm_vfp): New.
    * gcc.target/arm/attr-crypto.c: Use arm_crypto_pragma_ok effective
    target. Do not force -mfloat-abi=softfp, use arm_vfp effective
    target instead.
    * gcc.target/arm/attr-neon-builtin-fail.c: Do not force
    -mfloat-abi=softfp, use arm_fp effective target instead.
    * gcc.target/arm/attr-neon-fp16.c: Likewise. Remove arm_neon_ok
    dependency.
    * gcc.target/arm/attr-neon2.c: Do not force -mfloat-abi=softfp,
    use arm_vfp effective target instead.
    * gcc.target/arm/attr-neon3.c: Likewise.

Attachment: target-attr.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]