File: copy.c

package info (click to toggle)
liboil 0.3.15-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,032 kB
  • ctags: 5,929
  • sloc: ansic: 47,058; xml: 12,229; sh: 8,957; perl: 1,095; asm: 1,072; makefile: 748
file content (52 lines) | stat: -rw-r--r-- 794 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <liboil/liboil.h>
#include <liboil/liboilfunction.h>
#include <stdio.h>
#include <string.h>

uint8_t dest[200];
uint8_t src[200];


void test(void)
{
  int i;

  for(i=0;i<200;i++){
    dest[i]=0;
    src[i]=i;
  }

  oil_copy_u8 (dest + 8, src + 0, 64);

  for(i=0;i<100;i++){
    printf("%d\n",dest[i]);
  }
}

int main (int argc, char *argv[])
{
  OilFunctionClass *klass;
  OilFunctionImpl *impl;

  oil_init ();

  klass = oil_class_get ("copy_u8");
  oil_class_optimize(klass);

  oil_class_choose_by_name (klass, "copy_u8_altivec");
  impl = klass->chosen_impl;
  if (oil_impl_is_runnable (impl)) {
    printf("chosen=%p\n", impl);
    impl = klass->reference_impl;
    printf("ref=%p\n", impl);
    test();
  }

  return 0;
}