Skip to content

Commit 5904b23

Browse files
committed
LoongArch64: Rename core
Use microarchitecture name instead of meaningless strings to name the core, the legacy core is still retained. 1. Rename LOONGSONGENERIC to LA64_GENERIC 2. Rename LOONGSON3R5 to LA464 3. Rename LOONGSON2K1000 to LA264
1 parent fca86e3 commit 5904b23

File tree

15 files changed

+509
-127
lines changed

15 files changed

+509
-127
lines changed

.github/workflows/loongarch64.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ jobs:
2323
- target: LOONGSON2K1000
2424
triple: loongarch64-unknown-linux-gnu
2525
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON2K1000
26+
- target: LA64_GENERIC
27+
triple: loongarch64-unknown-linux-gnu
28+
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA64_GENERIC
29+
- target: LA464
30+
triple: loongarch64-unknown-linux-gnu
31+
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA464
32+
- target: LA264
33+
triple: loongarch64-unknown-linux-gnu
34+
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA264
2635
- target: DYNAMIC_ARCH
2736
triple: loongarch64-unknown-linux-gnu
2837
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=GENERIC

.github/workflows/loongarch64_clang.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ jobs:
2020
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON3R5
2121
- target: LOONGSON2K1000
2222
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON2K1000
23+
- target: LA64_GENERIC
24+
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA64_GENERIC
25+
- target: LA464
26+
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA464
27+
- target: LA264
28+
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA264
2329
- target: DYNAMIC_ARCH
2430
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=GENERIC
2531

Makefile.prebuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ endif
9999
getarch : getarch.c cpuid.S dummy $(CPUIDEMU)
100100
avx512=$$(./c_check$(SCRIPTSUFFIX) - - "$(CC)" $(TARGET_FLAGS) $(CFLAGS) | grep NO_AVX512); \
101101
rv64gv=$$(./c_check$(SCRIPTSUFFIX) - - "$(CC)" $(TARGET_FLAGS) $(CFLAGS) | grep NO_RV64GV); \
102-
$(HOSTCC) $(HOST_CFLAGS) $(EXFLAGS) $${avx512:+-D$${avx512}} $${rv64gv:+-D$${rv64gv}} -o $(@F) getarch.c cpuid.S $(CPUIDEMU)
102+
$(HOSTCC) $(HOST_CFLAGS) $(EXFLAGS) $${avx512:+-D$${avx512}} $${rv64gv:+-D$${rv64gv}} -lm -o $(@F) getarch.c cpuid.S $(CPUIDEMU)
103103

104104
getarch_2nd : getarch_2nd.c $(TARGET_CONF) dummy
105105
ifndef TARGET_CORE

Makefile.system

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ endif
727727
endif
728728

729729
ifeq ($(ARCH), loongarch64)
730-
DYNAMIC_CORE = LOONGSON3R5 LOONGSON2K1000 LOONGSONGENERIC
730+
DYNAMIC_CORE = LA64_GENERIC LA264 LA464
731731
endif
732732

733733
ifeq ($(ARCH), riscv64)
@@ -990,8 +990,8 @@ BINARY_DEFINED = 1
990990
endif
991991

992992
ifeq ($(ARCH), loongarch64)
993-
LA64_ABI=$(shell $(CC) -mabi=lp64d -c $(TOPDIR)/cpuid_loongarch64.c -o /dev/null > /dev/null 2> /dev/null && echo lp64d)
994-
LA64_ARCH=$(shell $(CC) -march=loongarch64 -c $(TOPDIR)/cpuid_loongarch64.c -o /dev/null > /dev/null 2> /dev/null && echo loongarch64)
993+
LA64_ABI=$(shell $(CC) -mabi=lp64d -lm -c $(TOPDIR)/cpuid_loongarch64.c -o /dev/null > /dev/null 2> /dev/null && echo lp64d)
994+
LA64_ARCH=$(shell $(CC) -march=loongarch64 -lm -c $(TOPDIR)/cpuid_loongarch64.c -o /dev/null > /dev/null 2> /dev/null && echo loongarch64)
995995
ifneq ($(LA64_ABI), lp64d)
996996
LA64_ABI=lp64
997997
endif

TargetList.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,17 @@ x280
126126
RISCV64_ZVL256B
127127

128128
11.LOONGARCH64:
129+
// LOONGSONGENERIC/LOONGSON2K1000/LOONGSON3R5 are legacy names,
130+
// and it is recommended to use the more standardized naming conventions
131+
// LA64_GENERIC/LA264/LA464. You can still specify TARGET as
132+
// LOONGSONGENERIC/LOONGSON2K1000/LOONGSON3R5 during compilation or runtime,
133+
// and they will be internally relocated to LA64_GENERIC/LA264/LA464.
129134
LOONGSONGENERIC
130-
LOONGSON3R5
131135
LOONGSON2K1000
136+
LOONGSON3R5
137+
LA64_GENERIC
138+
LA264
139+
LA464
132140

133141
12. Elbrus E2000:
134142
E2K

0 commit comments

Comments
 (0)