-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: switch partial reads to use bitwise AND
This switches partial `read` syscalls (i.e. those that don't read multiples of 8 bytes) to use bitwise AND operators instead of MUL and DIV when combining values bytewise. The goal is to produce a simpler formula for the solver. Note that incomplete solvers in particular have a hard time solving "t = x * (2^N) / (2^N)" for example.
- Loading branch information
1 parent
e1c9a4e
commit ec74690
Showing
3 changed files
with
38 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
uint64_t main() { | ||
uint64_t a; | ||
uint64_t* x; | ||
|
||
x = malloc(8); | ||
|
||
*x = 0; | ||
|
||
read(0, x, 4); | ||
|
||
a = *x - 48; | ||
|
||
if (a < 9) | ||
return 0; | ||
if (a == 9) | ||
return 1; | ||
|
||
return 0; | ||
} |
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