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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [dshift_2.F90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! Test the DSHIFTL and DSHIFTR intrinsics.
2
!
3
! { dg-do run }
4
! { dg-options "-ffree-line-length-none" }
5
! { dg-require-effective-target fortran_integer_16 }
6
 
7
  implicit none
8
 
9
#define RESL(I,J,SHIFT) \
10
  IOR(SHIFTL(I,SHIFT),SHIFTR(J,BIT_SIZE(J)-SHIFT))
11
#define RESR(I,J,SHIFT) \
12
  IOR(SHIFTL(I,BIT_SIZE(I)-SHIFT),SHIFTR(J,SHIFT))
13
 
14
#define CHECK(I,J,SHIFT) \
15
  if (dshiftl(I,J,SHIFT) /= RESL(I,J,SHIFT)) call abort ; \
16
  if (dshiftr(I,J,SHIFT) /= RESR(I,J,SHIFT)) call abort ; \
17
  if (run_dshiftl(I,J,SHIFT) /= RESL(I,J,SHIFT)) call abort ; \
18
  if (run_dshiftr(I,J,SHIFT) /= RESR(I,J,SHIFT)) call abort
19
 
20
  CHECK(0_16,0_16,0)
21
  CHECK(0_16,0_16,1)
22
  CHECK(0_16,0_16,7)
23
  CHECK(0_16,0_16,8)
24
  CHECK(28_16,79_16,0)
25
  CHECK(28_16,79_16,1)
26
  CHECK(28_16,79_16,5)
27
  CHECK(28_16,79_16,7)
28
  CHECK(28_16,79_16,8)
29
  CHECK(-28_16,79_16,0)
30
  CHECK(-28_16,79_16,1)
31
  CHECK(-28_16,79_16,5)
32
  CHECK(-28_16,79_16,7)
33
  CHECK(-28_16,79_16,8)
34
  CHECK(28_16,-79_16,0)
35
  CHECK(28_16,-79_16,1)
36
  CHECK(28_16,-79_16,5)
37
  CHECK(28_16,-79_16,7)
38
  CHECK(28_16,-79_16,8)
39
  CHECK(-28_16,-79_16,0)
40
  CHECK(-28_16,-79_16,1)
41
  CHECK(-28_16,-79_16,5)
42
  CHECK(-28_16,-79_16,7)
43
  CHECK(-28_16,-79_16,8)
44
 
45
contains
46
 
47
  function run_dshiftl (i, j, shift) result(res)
48
    integer(kind=16) :: i, j, res
49
    integer :: shift
50
    res = dshiftl(i,j,shift)
51
  end function
52
 
53
  function run_dshiftr (i, j, shift) result(res)
54
    integer(kind=16) :: i, j, res
55
    integer :: shift
56
    res = dshiftr(i,j,shift)
57
  end function
58
 
59
end

powered by: WebSVN 2.1.0

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