-
Notifications
You must be signed in to change notification settings - Fork 23
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
Showing
3 changed files
with
57 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
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,20 @@ | ||
.text | ||
.balign 16 | ||
.globl test | ||
|
||
test: | ||
vsetvli a1, zero, e8, m8, ta, ma # Set vector length for maximum available bytes, with 8-bit element size | ||
vadd.vi v8, v8, 14 | ||
|
||
li t0, 1000 | ||
loop_start: | ||
|
||
vadd.vv v16, v8, v8 | ||
vmul.vv v24, v16, v8 # v1 chaining from last instr | ||
vsub.vv v24, v16, v8 # v1 chaining from last 2 instr | ||
|
||
addi t0, t0, -1 | ||
bnez t0, loop_start | ||
|
||
ret | ||
|
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,35 @@ | ||
{ lib | ||
, linkerScript | ||
, makeBuilder | ||
, findAndBuild | ||
, t1main | ||
, getTestRequiredFeatures | ||
}: | ||
|
||
let | ||
builder = makeBuilder { casePrefix = "eval"; }; | ||
build = { caseName, sourcePath }: | ||
builder { | ||
inherit caseName; | ||
|
||
src = sourcePath; | ||
|
||
passthru.featuresRequired = getTestRequiredFeatures sourcePath; | ||
isFp = lib.pathExists (lib.path.append sourcePath "isFp"); | ||
|
||
buildPhase = '' | ||
runHook preBuild | ||
$CC -T${linkerScript} \ | ||
${caseName}.S \ | ||
${t1main} \ | ||
-o $pname.elf | ||
runHook postBuild | ||
''; | ||
|
||
meta.description = "test case '${caseName}', written in C assembly"; | ||
}; | ||
in | ||
findAndBuild ./. build | ||
|