-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Krusty/Benediction
committed
Jul 11, 2024
1 parent
9c0b0e0
commit c84961b
Showing
12 changed files
with
56 additions
and
0 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,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
|
||
PROGRAM="basm" | ||
|
||
# STEP 0: Make sure there is no left-over profiling data from previous runs | ||
rm -rf /tmp/pgo-data || true | ||
|
||
# STEP 1: Build the instrumented binaries | ||
RUSTFLAGS="-Cprofile-generate=/tmp/pgo-data" \ | ||
cargo build --release | ||
|
||
# STEP 2: Run the instrumented binaries with some typical data | ||
../target/release/$PROGRAM ../../z80_assemblers_benchmark/z80/include_files.asm > /dev/null | ||
../target/release/$PROGRAM ./tests/asm/roudoudou/rasm_sprites.asm > /dev/null | ||
|
||
# STEP 3: Merge the `.profraw` files into a `.profdata` file | ||
llvm-profdata merge -o /tmp/pgo-data/merged.profdata /tmp/pgo-data | ||
|
||
# STEP 4: Use the `.profdata` file for guiding optimizations | ||
RUSTFLAGS="-Cprofile-use=/tmp/pgo-data/merged.profdata" \ | ||
cargo build --release |
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,8 @@ | ||
org 0x4000 | ||
BINARY_START | ||
run $ | ||
ld a, 'A' : call 0xbb5a | ||
jp $ | ||
BINARY_STOP | ||
|
||
save "test", BINARY_START, BINARY_STOP-BINARY_START, HFE, "saved.hfe" |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,8 @@ | ||
|
||
org 0x4000 | ||
BINARY_START | ||
run $ | ||
jp $ | ||
BINARY_STOP | ||
|
||
save "test", BINARY_START, BINARY_STOP-BINARY_START, DSK, "saved.dsk" |
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,16 @@ | ||
; cargo run -- save_sna.asm --nochunk BRKS --sna -o basm.sna | ||
; to be compared with | ||
; rasm -sb -ss save_sna.asm -o rasm | ||
|
||
|
||
BUILDSNA | ||
BANKSET 0 | ||
|
||
org 0x1234 | ||
BINARY_START | ||
run $ | ||
START | ||
BREAKPOINT | ||
jp $ | ||
BREAKPOINT | ||
BINARY_STOP |
Binary file not shown.