Introduction
This document provides the installation guide, detailed interface definition, and sample code of the Kunpeng System Library (KSL).
KSL is a high-performance system function library provided by Huawei and optimized for the Kunpeng platform. It offers capabilities such as x86 instruction migration, memory allocation, multi-threading, encoding and decoding, and character string matching on Kunpeng. By utilizing Kunpeng hardware advantages, KSL highlights better performance and usability than the open source implementation. All KSL interfaces are implemented in C, C++, and assembly languages. Table 1 shows the composition of KSL.
No. |
Library |
Description |
Application Scenario |
|---|---|---|---|
1 |
AVX2KI |
Arm implementation of Intel intrinsics. AVX To Kunpeng Intrinsic (AVX2KI) is an interface collection library that re-implements the intrinsic interface collection on a conventional platform using Kunpeng instructions and encapsulates the intrinsic interface collection as an independent interface module (in C language header file mode) to reduce the workload of repeated development of porting projects. Users can continue to use the intrinsic functions of a conventional platform by importing the header file into the application. |
Adaptation and migration of Intel intrinsics to Kunpeng processors |
2 |
KQMalloc |
The Kunpeng Quick Malloc library (KQMalloc) is a memory allocator designed for Kunpeng 920 series processors. The allocator has two versions, one for single-threaded applications and the other for multi-threaded applications. It minimizes internal cache usage and cache misses to dramatically improve application performance. |
Memory application and releasing |
3 |
HTL |
The Hyper Thread Library (HTL) is a user-level thread library built on kernel-mode threads. It is used to solve the problem that application performance deteriorates and the system resources are insufficient when a large number of kernel-mode threads are used, especially when the performance is extremely low in nested parallel scenarios. This library improves concurrency and performance while reducing resource usage. |
Multi-thread parallel application |
4 |
KSL_ASN1 |
Abstract Syntax Notation One (ASN.1) defines a formalism for the specification of abstract data types. This notation is used to flexibly describe data representation, encoding, transmission, and decoding. The KSL_ASN1 library is optimized based on open source ASN.1 software for the Kunpeng platform and has higher performance compared with asn1c. KSL_ASN1 supports the Basic Encoding Rules (BER), Distinguished Encoding Rules (DER), Packed Encoding Rules (PER), and XML Encoding Rules (XER). |
ASN.1 file parsing, encoding, and decoding |
5 |
KHSEL |
The Kunpeng Hyperscan Enhanced Library (KHSEL) is a software enhancement package for open source Hyperscan based on Kunpeng 920 series processors. It includes the KHSEL_ops and KHSEL_core sub-libraries, a hybrid model with a short-rule bypass, and a false-positive blocking model.
|
Regular expression matching Match functions |
6 |
kpglibc |
The Kunpeng GNU C Library (kpglibc) uses a vectorized instruction set to optimize the performance of string, memory, and time operation functions for Kunpeng 920 series processors. |
String, memory, and time operation functions |
KSL is available only for Kunpeng processors. To achieve better performance, complete input parameter verification is not performed in KSL interfaces. Use valid input parameters, and invalid input parameters may cause errors.