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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [sparc/] [combined-2.c] - Rev 691

Compare with Previous | Blame | View Log

/* { dg-do compile } */
/* { dg-options "-O2 -mcpu=ultrasparc -mvis" } */
typedef unsigned char pixel __attribute__((vector_size(4)));
typedef unsigned char vec8 __attribute__((vector_size(8)));
typedef short vec16 __attribute__((vector_size(8)));
 
vec16 foo (pixel a, pixel b) {
  vec8 c = __builtin_vis_fpmerge (a, b);
  vec16 d = { -1, -1, -1, -1 };
  vec16 e = __builtin_vis_fmul8x16 (a, d);
 
  return e;
}
 
vec16 bar (pixel a) {
  vec16 d = { 0, 0, 0, 0 };
  vec16 e = __builtin_vis_fmul8x16 (a, d);  /* Mulitplication by 0 = 0.  */
 
  return e;
}
 
/* { dg-final { scan-assembler "fmul8x16" } } */
/* { dg-final { scan-assembler "fzero" } } */
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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