Skip to content

Commit 18427f3

Browse files
authored
Have getarch downgrade the RISCV C910V target to GENERIC if compiler lacks vector support
1 parent d328636 commit 18427f3

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Makefile.prebuild

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ endif
7272

7373
getarch : getarch.c cpuid.S dummy $(CPUIDEMU)
7474
avx512=$$(perl c_check - - $(CC) $(TARGET_FLAGS) $(CFLAGS) | grep NO_AVX512); \
75-
$(HOSTCC) $(HOST_CFLAGS) $(EXFLAGS) $${avx512:+-D$${avx512}} -o $(@F) getarch.c cpuid.S $(CPUIDEMU)
75+
rv64gv=$$(perl c_check - - $(CC) $(TARGET_FLAGS) $(CFLAGS) | grep NO_RV64GV); \
76+
$(HOSTCC) $(HOST_CFLAGS) $(EXFLAGS) $${avx512:+-D$${avx512}} $${rv64gv:+-D$${rv64gv}} -o $(@F) getarch.c cpuid.S $(CPUIDEMU)
7677

7778
getarch_2nd : getarch_2nd.c $(TARGET_CONF) dummy
7879
ifndef TARGET_CORE

getarch.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,16 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15741574
#ifdef FORCE_C910V
15751575
#define FORCE
15761576
#define ARCHITECTURE "RISCV64"
1577+
#ifdef NO_RV64GV
1578+
#define SUBARCHITECTURE "RISCV64_GENERIC"
1579+
#define SUBDIRNAME "riscv64"
1580+
#define ARCHCONFIG "-DRISCV64_GENERIC " \
1581+
"-DL1_DATA_SIZE=32768 -DL1_DATA_LINESIZE=32 " \
1582+
"-DL2_SIZE=1048576 -DL2_LINESIZE=32 " \
1583+
"-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 "
1584+
#define LIBNAME "riscv64_generic"
1585+
#define CORENAME "RISCV64_GENERIC"
1586+
#else
15771587
#define SUBARCHITECTURE "C910V"
15781588
#define SUBDIRNAME "riscv64"
15791589
#define ARCHCONFIG "-DC910V " \
@@ -1582,6 +1592,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15821592
"-DDTB_DEFAULT_ENTRIES=128 -DDTB_SIZE=4096 -DL2_ASSOCIATIVE=4 "
15831593
#define LIBNAME "c910v"
15841594
#define CORENAME "C910V"
1595+
#endif
15851596
#else
15861597
#endif
15871598

0 commit comments

Comments
 (0)