Skip to content

Commit bc93f46

Browse files
authored
Add Elbrus E2000 architecture as generic x86_64 compatible
1 parent 1937b4e commit bc93f46

File tree

6 files changed

+85
-1
lines changed

6 files changed

+85
-1
lines changed

Makefile.e2k

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
COPT = -Wall -O2 # -DGEMMTEST

TargetList.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,7 @@ C910V
115115

116116
11.LOONGARCH64:
117117
LOONGSON3R5
118+
119+
12. Elbrus E2000:
120+
E2K
121+

common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,10 @@ please https://github.com/xianyi/OpenBLAS/issues/246
474474
#include "common_loongarch64.h"
475475
#endif
476476

477+
#ifdef ARCH_E2K
478+
#include "common_e2k.h"
479+
#endif
480+
477481
#ifndef ASSEMBLER
478482
#ifdef OS_WINDOWSSTORE
479483
typedef char env_var_t[MAX_PATH];

common_e2k.h

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+

common_macro.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2611,7 +2611,7 @@
26112611

26122612
#ifndef ASSEMBLER
26132613
#if defined(ARCH_X86) || defined(ARCH_X86_64) || defined(ARCH_IA64) || defined(ARCH_MIPS64) || defined(ARCH_ARM64)\
2614-
|| defined(ARCH_LOONGARCH64)
2614+
|| defined(ARCH_LOONGARCH64) || defined(ARCH_E2K)
26152615
extern BLASLONG gemm_offset_a;
26162616
extern BLASLONG gemm_offset_b;
26172617
extern BLASLONG sbgemm_p;

getarch.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,17 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15361536
#endif
15371537

15381538

1539+
#if defined(FORCE_E2K) || defined(__e2k__)
1540+
#define FORCE
1541+
#define ARCHITECTURE "E2K"
1542+
#define ARCHCONFIG "-DGENERIC " \
1543+
"-DL1_DATA_SIZE=16384 -DL1_DATA_LINESIZE=64 " \
1544+
"-DL2_SIZE=524288 -DL2_LINESIZE=64 " \
1545+
"-DDTB_DEFAULT_ENTRIES=64 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=8 "
1546+
#define LIBNAME "generic"
1547+
#define CORENAME "generic"
1548+
#endif
1549+
15391550
#ifndef FORCE
15401551

15411552
#ifdef USER_TARGET

0 commit comments

Comments
 (0)