Commit 6f406594 authored by Ben Avison's avatar Ben Avison Committed by ROOL
Browse files

Add 64-bit versions of clz and family

Where algorithms naturally use 64-bit quantities, these functions will lend
themselves to even better optimisation under AArch64.

Also opt back in to the softload_gnu CI job, since this is one of the
components for which it already passes.

Version 0.21. Tagged as 'AsmUtils-0_21'
parent 06c5bdff
variables:
ENABLE_JOBS: 'softload_gnu'
include: include:
- project: 'Support/CI' - project: 'Support/CI'
file: '/AsmUtils.yml' file: '/AsmUtils.yml'
/* (0.20) /* (0.21)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* *
*/ */
#define Module_MajorVersion_CMHG 0.20 #define Module_MajorVersion_CMHG 0.21
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 25 Jun 2022 #define Module_Date_CMHG 03 Aug 2022
#define Module_MajorVersion "0.20" #define Module_MajorVersion "0.21"
#define Module_Version 20 #define Module_Version 21
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "25 Jun 2022" #define Module_Date "03 Aug 2022"
#define Module_ApplicationDate "25-Jun-22" #define Module_ApplicationDate "03-Aug-22"
#define Module_ComponentName "AsmUtils" #define Module_ComponentName "AsmUtils"
#define Module_FullVersion "0.20" #define Module_FullVersion "0.21"
#define Module_HelpVersion "0.20 (25 Jun 2022)" #define Module_HelpVersion "0.21 (03 Aug 2022)"
#define Module_LibraryVersionInfo "0:20" #define Module_LibraryVersionInfo "0:21"
...@@ -42,6 +42,18 @@ extern unsigned int clo(unsigned int); ...@@ -42,6 +42,18 @@ extern unsigned int clo(unsigned int);
extern unsigned int cto(unsigned int); extern unsigned int cto(unsigned int);
/* Returns the number of trailing one bits in the argument, 0 ... 32 */ /* Returns the number of trailing one bits in the argument, 0 ... 32 */
extern unsigned int clz64(unsigned long long);
/* Returns the number of leading zero bits in the argument, 0 ... 64 */
extern unsigned int ctz64(unsigned long long);
/* Returns the number of trailing zero bits in the argument, 0 ... 64 */
extern unsigned int clo64(unsigned long long);
/* Returns the number of leading one bits in the argument, 0 ... 64 */
extern unsigned int cto64(unsigned long long);
/* Returns the number of trailing one bits in the argument, 0 ... 64 */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -27,6 +27,10 @@ ...@@ -27,6 +27,10 @@
EXPORT |ctz| EXPORT |ctz|
EXPORT |clo| EXPORT |clo|
EXPORT |cto| EXPORT |cto|
EXPORT |clz64|
EXPORT |ctz64|
EXPORT |clo64|
EXPORT |cto64|
|clo| |clo|
[ NoARMv5 [ NoARMv5
...@@ -107,4 +111,44 @@ table ...@@ -107,4 +111,44 @@ table
= 1, 15, 23, 20, 3, 11, 26, 9, 16, 24, 4, 27, 17, 5, 6, 7 = 1, 15, 23, 20, 3, 11, 26, 9, 16, 24, 4, 27, 17, 5, 6, 7
] ]
|clz64|
FunctionEntry "v1"
CMP a2, #0
MOVNE a1, a2
MOVNE v1, #0
MOVEQ v1, #32
BL |clz|
ADD a1, a1, v1
Return "v1"
|ctz64|
FunctionEntry "v1"
CMP a1, #0
MOVEQ a1, a2
MOVNE v1, #0
MOVEQ v1, #32
BL |ctz|
ADD a1, a1, v1
Return "v1"
|clo64|
FunctionEntry "v1"
CMP a2, #-1
MOVNE a1, a2
MOVNE v1, #0
MOVEQ v1, #32
BL |clo|
ADD a1, a1, v1
Return "v1"
|cto64|
FunctionEntry "v1"
CMP a1, #-1
MOVEQ a1, a2
MOVNE v1, #0
MOVEQ v1, #32
BL |cto|
ADD a1, a1, v1
Return "v1"
END END
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment