-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LoongArch64: Rename core #4900
LoongArch64: Rename core #4900
Conversation
9405fdd
to
30d712a
Compare
@yinshiyou @martin-frbg @azuresky01 @Pengzhou0810 Could you help me review the code to see if there are any missing parts? Thanks! |
30d712a
to
87afa95
Compare
I must say I am not particularly happy with renaming TARGET entries that have been in use for quite a while. Can we at least keep the present names as aliases so that users and distributors will not have to change their build scripts (and whatever local documentation there may be out there) ? |
9cc8f7c
to
dad0466
Compare
Okay, I understand your concerns. I have retained the existing TARGET, and users can still specify it during compilation and runtime (it will be internally assigned to the ‘new’ TARGET) |
dad0466
to
5904b23
Compare
Hello, I just tried to build OpenBLAS from the files in your la64_core_rename branch. Unfortunately both gmake and cmake failed. See below. The system is Debian sid with kernel 6.10.2, gcc 14.2.0, cmake 3.30.3, and CPU is Loongson 3A6000. gmake command:
cmake command:
|
@azuresky01 Thank you very much for your testing. |
I wonder if it would be possible to use shifs instead, if all you need the pow (and libm) for is powers of two ? |
5904b23
to
074d03c
Compare
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
074d03c
to
48698b2
Compare
@martin-frbg @azuresky01 Thank you for your suggestions, the update has been submitted. |
I can confirm that after the update both gmake and cmake compilations are OK. The compiler is gcc/gfortran 14.2.0 on Debian sid. |
The current naming convention is not a very formal expression. After the revision, both the
CPU name
andCore name
will be represented by theLA64
microarchitecture.The definition of
CPU name
is as follows, which includes the currently knownLA64
microarchitectures, representing the microarchitecture of the current host:The definition of
Core name
is as follows, representing theLA64
microarchitecture related to the instruction set, which reflects the selected optimization type:Among these,
LA64_GENERIC
is related to scalar optimizations;LA264
corresponds toLSX
instruction optimizations; andLA464
corresponds toLASX
instruction optimizations.The core is selected based on the
CPU name
and the instruction set supported by the system.For
LA364
, although it supportsLSX
instructions, it lacks additional extensions. Currently, there is no need for further optimization of the existingLSX
instructions. Therefore, no new core is required, and theLA264
optimization approach can be reused. Similarly, this principle applies toLA664
. This approach has the advantage of reducing compilation time and code size whenDYNAMIC_ARCH=1
is enabled.Taking
3A6000
as an example, itsCPU name
isLA664
, while itsCore name
isLA464
because it shares the same optimization approach asLA464
.The addition of a new
CPU name
is based on the emergence of newLA64
microarchitectures, while a newCore name
is added only when the newLA64
microarchitecture introduces a new instruction set or other significant performance optimizations. This approach helps prevent code bloat while ensuring streamlined and efficient optimization code.