mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-10 13:31:04 +08:00
target-supports.exp (check_effective_target_vect_pack_trunc): Rename from check_effective_target_vect_pack_mod.
* lib/target-supports.exp (check_effective_target_vect_pack_trunc): Rename from check_effective_target_vect_pack_mod. Rename global variable et_vect_pack_mod to et_vect_pack_trunc. Update debug messages. * gcc.dg/vect/vect-iv-8.c: Update target check for vect_pack_trunc rename. * gcc.dg/vect/vect-iv-8a.c: Ditto. * gcc.dg/vect/vect-multitypes-8.c: Ditto. From-SVN: r124057
This commit is contained in:
parent
1f2ad84c3c
commit
8b3cc88233
@ -1,3 +1,14 @@
|
||||
2007-04-23 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
* lib/target-supports.exp (check_effective_target_vect_pack_trunc):
|
||||
Rename from check_effective_target_vect_pack_mod. Rename global
|
||||
variable et_vect_pack_mod to et_vect_pack_trunc. Update debug
|
||||
messages.
|
||||
* gcc.dg/vect/vect-iv-8.c: Update target check for vect_pack_trunc
|
||||
rename.
|
||||
* gcc.dg/vect/vect-iv-8a.c: Ditto.
|
||||
* gcc.dg/vect/vect-multitypes-8.c: Ditto.
|
||||
|
||||
2007-04-22 Andrew Pinski <andrew_pinski@playstation.sony.com>
|
||||
|
||||
PR middle-end/31448
|
||||
|
40
gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c
Normal file
40
gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c
Normal file
@ -0,0 +1,40 @@
|
||||
/* { dg-require-effective-target vect_double } */
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "tree-vect.h"
|
||||
|
||||
#define N 32
|
||||
|
||||
int
|
||||
main1 ()
|
||||
{
|
||||
int i;
|
||||
float fb[N] = {0.4,3.5,6.6,9.4,12.5,15.6,18.4,21.5,24.6,27.4,30.5,33.6,36.4,39.5,42.6,45.4,0.5,3.6,6.4,9.5,12.6,15.4,18.5,21.6,24.4,27.5,30.6,33.4,36.5,39.6,42.4,45.5};
|
||||
double da[N];
|
||||
|
||||
/* float -> double */
|
||||
for (i = 0; i < N; i++)
|
||||
{
|
||||
da[i] = (double) fb[i];
|
||||
}
|
||||
|
||||
/* check results: */
|
||||
for (i = 0; i < N; i++)
|
||||
{
|
||||
if (da[i] != (double) fb[i])
|
||||
abort ();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
check_vect ();
|
||||
|
||||
return main1 ();
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail spu*-*-* } } } */
|
||||
/* { dg-final { cleanup-tree-dump "vect" } } */
|
40
gcc/testsuite/gcc.dg/vect/vect-float-truncate-1.c
Normal file
40
gcc/testsuite/gcc.dg/vect/vect-float-truncate-1.c
Normal file
@ -0,0 +1,40 @@
|
||||
/* { dg-require-effective-target vect_double } */
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "tree-vect.h"
|
||||
|
||||
#define N 32
|
||||
|
||||
int
|
||||
main1 ()
|
||||
{
|
||||
int i;
|
||||
double db[N] = {0.4,3.5,6.6,9.4,12.5,15.6,18.4,21.5,24.6,27.4,30.5,33.6,36.4,39.5,42.6,45.4,0.5,3.6,6.4,9.5,12.6,15.4,18.5,21.6,24.4,27.5,30.6,33.4,36.5,39.6,42.4,45.5};
|
||||
float fa[N];
|
||||
|
||||
/* double -> float */
|
||||
for (i = 0; i < N; i++)
|
||||
{
|
||||
fa[i] = (float) db[i];
|
||||
}
|
||||
|
||||
/* check results: */
|
||||
for (i = 0; i < N; i++)
|
||||
{
|
||||
if (fa[i] != (float) db[i])
|
||||
abort ();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
check_vect ();
|
||||
|
||||
return main1 ();
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail spu*-*-* } } } */
|
||||
/* { dg-final { cleanup-tree-dump "vect" } } */
|
@ -42,6 +42,6 @@ int main (void)
|
||||
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
|
||||
/* Fails to get vectorized due to a redundant cast. Once this is fixed,
|
||||
should be vectorized as follows:
|
||||
dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_pack_mod && vect_unpack } } }
|
||||
dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_pack_trunc && vect_unpack } } }
|
||||
*/
|
||||
/* { dg-final { cleanup-tree-dump "vect" } } */
|
||||
|
@ -39,5 +39,5 @@ int main (void)
|
||||
return main1 (3);
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_pack_mod && vect_unpack } } } } */
|
||||
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_pack_trunc && vect_unpack } } } } */
|
||||
/* { dg-final { cleanup-tree-dump "vect" } } */
|
||||
|
@ -45,6 +45,6 @@ int main (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_mod } } } */
|
||||
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
|
||||
/* { dg-final { cleanup-tree-dump "vect" } } */
|
||||
|
||||
|
@ -1862,21 +1862,21 @@ proc check_effective_target_vect_udot_hi { } {
|
||||
#
|
||||
# This won't change for different subtargets so cache the result.
|
||||
|
||||
proc check_effective_target_vect_pack_mod { } {
|
||||
global et_vect_pack_mod
|
||||
proc check_effective_target_vect_pack_trunc { } {
|
||||
global et_vect_pack_trunc
|
||||
|
||||
if [info exists et_vect_pack_mod_saved] {
|
||||
verbose "check_effective_target_vect_pack_mod: using cached result" 2
|
||||
if [info exists et_vect_pack_trunc_saved] {
|
||||
verbose "check_effective_target_vect_pack_trunc: using cached result" 2
|
||||
} else {
|
||||
set et_vect_pack_mod_saved 0
|
||||
set et_vect_pack_trunc_saved 0
|
||||
if { [istarget powerpc*-*-*]
|
||||
|| [istarget i?86-*-*]
|
||||
|| [istarget x86_64-*-*] } {
|
||||
set et_vect_pack_mod_saved 1
|
||||
set et_vect_pack_trunc_saved 1
|
||||
}
|
||||
}
|
||||
verbose "check_effective_target_vect_pack_mod: returning $et_vect_pack_mod_saved" 2
|
||||
return $et_vect_pack_mod_saved
|
||||
verbose "check_effective_target_vect_pack_trunc: returning $et_vect_pack_trunc_saved" 2
|
||||
return $et_vect_pack_trunc_saved
|
||||
}
|
||||
|
||||
# Return 1 if the target plus current options supports a vector
|
||||
|
Loading…
x
Reference in New Issue
Block a user