-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reimplements clz using the branchless/loopless algorithm (#1423)
Inspired by Benjamin Mourad (@bmourad01) implementation in #1416. It is not only efficient but also helps with bap-veri-fication, as the latter do not support while loops (which is used in the previous implementation).
- Loading branch information
Showing
4 changed files
with
67 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(declare (context (target arm))) | ||
(defpackage llvm-armv7 (:use arm)) | ||
(in-package arm) | ||
|
||
(require bits) | ||
|
||
(defun CLZ (rd rn pre _) | ||
(when (condition-holds pre) | ||
(set$ rd (clz32 rn)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters