-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Add suggestion to discuss maros and aliases
- Loading branch information
1 parent
28c0f70
commit 46296df
Showing
3 changed files
with
77 additions
and
1 deletion.
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,50 @@ | ||
qdata0 .req q8 | ||
qdata1 .req q9 | ||
qdata2 .req q10 | ||
qdata3 .req q11 | ||
|
||
qtwiddle .req q0 | ||
|
||
data0 .req v8 | ||
data1 .req v9 | ||
data2 .req v10 | ||
data3 .req v11 | ||
|
||
twiddle .req v0 | ||
modulus .req v1 | ||
|
||
tmp .req v12 | ||
|
||
data_ptr .req x0 | ||
twiddle_ptr .req x1 | ||
|
||
.macro barmul out, in, twiddle, modulus | ||
mul \out.8h, \in.8h, \twiddle.h[0] | ||
sqrdmulh \in.8h, \in.8h, \twiddle.h[1] | ||
mls \out.8h, \in.8h, \modulus.h[0] | ||
.endm | ||
|
||
.macro butterfly data0, data1, tmp, twiddle, modulus | ||
barmul \tmp, \data1, \twiddle, \modulus | ||
sub \data1.8h, \data0.8h, \tmp.8h | ||
add \data0.8h, \data0.8h, \tmp.8h | ||
.endm | ||
|
||
start: | ||
|
||
ldr qtwiddle, [twiddle_ptr, #0] | ||
|
||
ldr qdata0, [data_ptr, #0*16] | ||
ldr qdata1, [data_ptr, #1*16] | ||
ldr qdata2, [data_ptr, #2*16] | ||
ldr qdata3, [data_ptr, #3*16] | ||
|
||
butterfly data0, data1, tmp, twiddle, modulus | ||
butterfly data2, data3, tmp, twiddle, modulus | ||
|
||
str qdata0, [data_ptr], #4*16 | ||
str qdata1, [data_ptr, #-3*16] | ||
str qdata2, [data_ptr, #-2*16] | ||
str qdata3, [data_ptr, #-1*16] | ||
|
||
end: |
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,23 @@ | ||
import logging | ||
import sys | ||
|
||
sys.path.append("../") | ||
from slothy import Slothy | ||
|
||
import slothy.targets.aarch64.aarch64_neon as AArch64_Neon | ||
import slothy.targets.aarch64.cortex_a55 as Target_CortexA55 | ||
|
||
logging.basicConfig(stream=sys.stdout, level=logging.INFO) | ||
|
||
arch = AArch64_Neon | ||
target = Target_CortexA55 | ||
|
||
slothy = Slothy(arch, target) | ||
|
||
# example | ||
slothy.load_source_from_file("../examples/naive/aarch64/aarch64_simple0_macros.s") | ||
slothy.config.variable_size=True | ||
slothy.config.constraints.stalls_first_attempt=32 | ||
|
||
slothy.optimize(start="start", end="end") | ||
slothy.write_source_to_file("../examples/opt/aarch64/aarch64_simple0_macros_a55.s") |