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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vmx/] [7-01a.c] - Rev 801

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

/* { dg-do compile } */
#include <altivec.h>
extern vector signed short image[];
extern vector signed short band[];
 
#define load(a,b) vec_ld((b)*16, a)
#define store(v,a,b) vec_st(v,(b)*16,a)
 
void
haar (vector signed char a, vector signed char b, vector signed char c,
      vector signed char d, unsigned int N, int XX)
{
  unsigned int i;
  vector unsigned char high, low;
  vector signed int zero = ((vector signed int){0,0,0,0});
 
  for (i = 0; i < N; i++) {
    high = (vector unsigned char) (vec_vmrghh (load(image, i+XX),
					       load(image, i)));
    low = (vector unsigned char) (vec_vmrglh (load(image, i+XX),
					      load(image, i)));
 
    store (vec_vpkswss (vec_vmsummbm (a, high, zero),
			vec_vmsummbm (a, low, zero)),
	   band, i);
    store (vec_vpkswss (vec_vmsummbm (b, high, zero),
			vec_vmsummbm (b, low, zero)),
	   band, i+1);
    store(vec_vpkswss (vec_vmsummbm (c, high, zero),
		       vec_vmsummbm (c, low, zero)),
	  band, i+2);
    store(vec_vpkswss (vec_vmsummbm (d, high, zero),
		       vec_vmsummbm (d, low, zero)),
	  band, i+3);
  }
}
 

Go to most recent revision | 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.