OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [bfin/] [hisilh.c] - Blame information for rev 315

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 315 jeremybenn
/* { dg-do run { target bfin*-*-* } } */
2
/* { dg-options "-O2" } */
3
#include <stdlib.h>
4
typedef short raw2x16 __attribute__ ((vector_size(4)));
5
 
6
int x;
7
 
8
int ll(raw2x16 a, raw2x16 b)
9
{
10
    x = __builtin_bfin_mulhisill(a, b);
11
    return x;
12
}
13
 
14
int lh(raw2x16 a, raw2x16 b)
15
{
16
    x = __builtin_bfin_mulhisilh(a, b);
17
    return x;
18
}
19
 
20
int hl(raw2x16 a, raw2x16 b)
21
{
22
    x = __builtin_bfin_mulhisihl(a, b);
23
    return x;
24
}
25
 
26
int hh(raw2x16 a, raw2x16 b)
27
{
28
    x = __builtin_bfin_mulhisihh(a, b);
29
    return x;
30
}
31
 
32
int main ()
33
{
34
    raw2x16 a = __builtin_bfin_compose_2x16 (0x1234, 0x5678);
35
    raw2x16 b = __builtin_bfin_compose_2x16 (0xFEDC, 0xBA98);
36
    if (ll (a, b) != 0xe88e8740)
37
        abort ();
38
    if (lh (a, b) != 0xff9d5f20)
39
        abort ();
40
    if (hl (a, b) != 0xfb1096e0)
41
        abort ();
42
    if (hh (a, b) != 0xffeb3cb0)
43
        abort ();
44
 
45
    return 0;
46
}

powered by: WebSVN 2.1.0

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