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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [bmi2-shlx32-1.c] - Blame information for rev 691

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do run { target { bmi2 } } } */
2
/* { dg-options "-mbmi2 -O2 -dp" } */
3
 
4
#include "bmi2-check.h"
5
 
6
__attribute__((noinline))
7
int
8
calc_shlx_u32 (int a, int l)
9
{
10
  int volatile res = a;
11
  int i;
12
  for (i = 0; i < l; ++i)
13
    res <<= 1;
14
 
15
  return res;
16
}
17
 
18
static void
19
bmi2_test ()
20
{
21
  unsigned i;
22
  int src = 0xfce7ace0;
23
  int res, res_ref;
24
 
25
  for (i = 0; i < 5; ++i) {
26
    src = src * (i + 1);
27
 
28
    res_ref = calc_shlx_u32 (src, i + 1);
29
    res = src << (i + 1);
30
 
31
    if (res != res_ref)
32
      abort();
33
  }
34
}

powered by: WebSVN 2.1.0

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