OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [sparc/] [fpmul-2.c] - Blame information for rev 378

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 326 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-mcpu=ultrasparc -mvis -O1 -fdump-tree-optimized" } */
3
 
4
typedef int vec32 __attribute__((vector_size(8)));
5
typedef short vec16 __attribute__((vector_size(8)));
6
typedef unsigned char vec8 __attribute__((vector_size(8)));
7
 
8
typedef unsigned char pixel __attribute__((vector_size(4)));
9
typedef short pixel16 __attribute__((vector_size(4)));
10
 
11
vec16 foo1 () {
12
  pixel a = { (unsigned char)1, (unsigned char)2, (unsigned char)3, (unsigned char)4 };
13
  vec16 b = { (short)1, (short)2, (short)3, (short)4 };
14
  return __builtin_vis_fmul8x16 (a, b);
15
}
16
 
17
vec16 foo1_1 () {
18
  pixel a = { (unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1 };
19
  vec16 b = { (short)256, (short)512, (short)1024, (short)2048 };
20
  return __builtin_vis_fmul8x16 (a, b);
21
}
22
 
23
vec16 foo1_2 () {
24
  pixel a = { (unsigned char)255, (unsigned char)255, (unsigned char)255, (unsigned char)255 };
25
  vec16 b = { (short)256, (short)512, (short)1024, (short)32767 };
26
  return __builtin_vis_fmul8x16 (a, b);
27
}
28
/* { dg-final { scan-assembler-not "fmul8x16\t%" } } */
29
/* { dg-final { scan-tree-dump "{ 0, 0, 0, 0 }" "optimized" } } */
30
/* { dg-final { scan-tree-dump "{ 1, 2, 4, 8 }" "optimized" } } */
31
/* { dg-final { scan-tree-dump "{ 255, 510, 1020, 32639 }" "optimized" } } */
32
 
33
vec16 foo2 () {
34
  pixel a = { 1, 2, 3, 4 };
35
  pixel16 b = { 256, 512 };
36
  return __builtin_vis_fmul8x16au (a, b);
37
}
38
/* { dg-final { scan-assembler-not "fmul8x16au\t%" } } */
39
/* { dg-final { scan-tree-dump "{ 1, 2, 3, 4 }" "optimized" } } */
40
 
41
vec16 foo3 () {
42
  pixel a = { 1, 2, 3, 4 };
43
  pixel16 b = { 256, 512 };
44
  return __builtin_vis_fmul8x16al (a, b);
45
}
46
/* { dg-final { scan-assembler-not "fmul8x16al\t%" } } */
47
/* { dg-final { scan-tree-dump "{ 2, 4, 6, 8 }" "optimized" } } */
48
/* { dg-final { cleanup-tree-dump "optimized" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.