summaryrefslogtreecommitdiffstats
path: root/crypto/loongarch_arch.h
AgeCommit message (Collapse)Author
2023-08-28Resolve assembler complains when including loongarch_arch.hMin Zhou
The assembler will complain when we include loongarch_arch.h in an assembly file as following: crypto/loongarch_arch.h: Assembler messages: crypto/loongarch_arch.h:12: Fatal error: no match insn: extern unsigned int OPENSSL_loongarch_hwcap_P So, the sentence of `extern unsigned int OPENSSL_loongarch_hwcap_P` should be guarded with "#ifndef __ASSEMBLER__". Fixes #21838. Signed-off-by: Min Zhou <zhoumin@loongson.cn> Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21839) (cherry picked from commit 84a0b1b169197e3afdadcdafc9fea65361ff672f)
2023-08-01Copyright year updatesMatt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org> Release: yes
2023-07-28vpaes: LoongArch: Use getauxval(AT_HWCAP) for LSX detectionXi Ruoyao
Running LSX instructions requires both the hardware support and the kernel support. The `cpucfg` instruction only tests the hardware support, causing a SIGILL if the hardware supports LSX but the kernel does not. Use `getauxval(AT_HWCAP)` as the ["Software Development and Build Convention for LoongArch Architectures"][1] manual suggests. The LOONGARCH_HWCAP_LSX and LOONGARCH_HWCAP_LASX bits are copied from the manual too. In Glibc 2.38 they'll be provided by <sys/auxv.h> as well, but they are unavailable in earlier Glibc versions so we cannot rely on it. The getauxval syscall and Glibc wrapper are available since day one (Linux-5.19 and Glibc-2.36) for LoongArch. Fixes #21508. [1]:https://github.com/loongson/la-softdev-convention/blob/master/la-softdev-convention.adoc#kernel-constraints Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21509) (cherry picked from commit c612289b77c37f7295d5af0d0e6b6c04e6ba727c)
2022-11-23Add LoongArch64 cpuid and OPENSSL_loongarchcap_Pzhuchen
Loongarch64 architecture defines 128 bit vector extension lsx and 256 bit vector extension lasx. The cpucfg instruction can be used to obtain whether the CPU has a corresponding extension. This part of code is added to prepare for the subsequent addition of corresponding vector instruction optimization. Signed-off-by: zhuchen <zhuchen@loongson.cn> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19364) (cherry picked from commit 7f2d6188c7b16ef7a4deeeedb56f42014156b9f8)