riscv64: Add RISC-V target
[platform/upstream/openblas.git] / common_e2k.h
1 /*****************************************************************************
2 Copyright (c) 2011-2016, The OpenBLAS Project
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are
7 met:
8
9    1. Redistributions of source code must retain the above copyright
10       notice, this list of conditions and the following disclaimer.
11
12    2. Redistributions in binary form must reproduce the above copyright
13       notice, this list of conditions and the following disclaimer in
14       the documentation and/or other materials provided with the
15       distribution.
16    3. Neither the name of the OpenBLAS project nor the names of 
17       its contributors may be used to endorse or promote products 
18       derived from this software without specific prior written 
19       permission.
20
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
30 USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 **********************************************************************************/
32
33 #ifndef COMMON_E2K
34 #define COMMON_E2K
35
36 #ifdef ASSEMBLER
37 #error
38 #endif
39
40 #define MB do { __asm__ __volatile__("": : :"memory"); } while (0)
41 #define WMB do { __asm__ __volatile__("": : :"memory"); } while (0)
42 #define RMB
43
44 #define INLINE __attribute__((__always_inline__)) inline
45
46 static inline int blas_quickdivide(blasint x, blasint y) {
47   return x / y;
48 }
49
50 #ifndef PAGESIZE
51 #define PAGESIZE        ( 4 << 10)
52 #endif
53 #define HUGE_PAGESIZE   ( 2 << 20)
54
55 #ifndef BUFFERSIZE
56 #define BUFFER_SIZE     (32 << 20)
57 #else
58 #define BUFFER_SIZE     (32 << BUFFERSIZE)
59 #endif
60
61 #define SEEK_ADDRESS
62
63 #endif
64