mips.c (DIRECT_BUILTIN_PURE): New macro.
* config/mips/mips.c (DIRECT_BUILTIN_PURE): New macro. Add a pure qualifier to the built-in. (MSA_BUILTIN_PURE): New macro. Add a pure qualifier to the MSA built-ins. (struct mips_builtin_description): Add is_pure flag. (mips_init_builtins): Mark built-in as pure if the flag in the corresponding mips_builtin_description struct is set. * gcc.target/mips/mips-builtins-pure.c: New test. From-SVN: r277534
This commit is contained in:
parent
18e2ca55d4
commit
ea9d5cc80e
4 changed files with 691 additions and 639 deletions
|
@ -1,5 +1,13 @@
|
|||
2019-10-28 Mihailo Stojanovic <mistojanovic@wavecomp.com>
|
||||
|
||||
* config/mips/mips.c (DIRECT_BUILTIN_PURE): New macro. Add a
|
||||
pure qualifier to the built-in.
|
||||
(MSA_BUILTIN_PURE): New macro. Add a pure qualifier to the MSA
|
||||
built-ins.
|
||||
(struct mips_builtin_description): Add is_pure flag.
|
||||
(mips_init_builtins): Mark built-in as pure if the flag in the
|
||||
corresponding mips_builtin_description struct is set.
|
||||
|
||||
* config/mips/mips-msa.md (msa_insert_<msaftm_f>): Add an
|
||||
alternative which covers the floating-point input value. Also
|
||||
forbid the split of insert.d pattern for floating-point values.
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,7 @@
|
|||
2019-10-28 Mihailo Stojanovic <mistojanovic@wavecomp.com>
|
||||
|
||||
* gcc.target/mips/mips-builtins-pure.c: New test.
|
||||
|
||||
* gcc.target/mips/msa-insert-split.c: New test.
|
||||
|
||||
2019-10-28 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||
|
|
20
gcc/testsuite/gcc.target/mips/mips-builtins-pure.c
Normal file
20
gcc/testsuite/gcc.target/mips/mips-builtins-pure.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-mfp64 -mhard-float -mmsa" } */
|
||||
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
|
||||
|
||||
typedef double v2f64 __attribute__ ((vector_size (16)));
|
||||
typedef long long v2i64 __attribute__ ((vector_size (16)));
|
||||
typedef int v4i32 __attribute__ ((vector_size (16)));
|
||||
|
||||
long long foo(const v2f64* a)
|
||||
{
|
||||
v2f64 x;
|
||||
v2i64 y;
|
||||
|
||||
x = (v2f64)__builtin_msa_shf_w((v4i32)*a, 0xff);
|
||||
y = __builtin_msa_fcun_d(*a, x);
|
||||
|
||||
return y[0];
|
||||
}
|
||||
|
||||
/* { dg-final { scan-assembler-times "ld" 1 } } */
|
Loading…
Add table
Reference in a new issue