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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [bmi2-rorx64-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 && { ! ia32 } } } } */
2
/* { dg-options "-mbmi2 -O2 -dp" } */
3
 
4
#include "bmi2-check.h"
5
 
6
__attribute__((noinline))
7
unsigned long long
8
calc_rorx_u64 (unsigned long long a, int l)
9
{
10
  unsigned long long volatile res = a;
11
  int i;
12
  for (i = 0; i < l; ++i)
13
    res = (res >> 1) | ((res&1)<< 63);
14
 
15
  return res;
16
}
17
 
18
#define SHIFT_VAL 0x1e
19
 
20
static void
21
bmi2_test ()
22
{
23
  unsigned i;
24
  unsigned long long src = 0xce7ace0ce7ace0;
25
  unsigned long long res, res_ref;
26
 
27
  for (i = 0; i < 5; ++i) {
28
    src = src * (i + 1);
29
 
30
    res_ref = calc_rorx_u64 (src, SHIFT_VAL);
31
    res = (src >> SHIFT_VAL) | (src << (64 - SHIFT_VAL));
32
 
33
    if (res != res_ref)
34
      abort();
35
  }
36
}

powered by: WebSVN 2.1.0

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