aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-09-18 05:38:12 +0900
committernsfisis <nsfisis@gmail.com>2024-09-18 05:38:12 +0900
commit86363e8aa82621e6c57404bdd05383446f55fe3e (patch)
treef358d13cecc6c57ecf1aaa68c8fdf9e0d078d80f
parentbb75ec16b1400a865b9fb6c2bc4c45db3ef3f550 (diff)
downloadmncore-challenge-86363e8aa82621e6c57404bdd05383446f55fe3e.tar.gz
mncore-challenge-86363e8aa82621e6c57404bdd05383446f55fe3e.tar.zst
mncore-challenge-86363e8aa82621e6c57404bdd05383446f55fe3e.zip
16-Count-Up
-rw-r--r--NOTE.md2
-rw-r--r--problems/05-Abs/07.vsm24
-rw-r--r--problems/16-Count-Up/02.vsm99
3 files changed, 112 insertions, 13 deletions
diff --git a/NOTE.md b/NOTE.md
index 2e7dc2e..5ff1a9a 100644
--- a/NOTE.md
+++ b/NOTE.md
@@ -14,7 +14,7 @@
| Mod 3 | 48 | 52 |
| Matrix Square | 100 | 0 |
| Contains | 19 | 81 |
-| Count Up | 33 | 67 |
+| Count Up | 36 | 64 |
| Transpose MAB | 47 | 53 |
| Inversion Small | 27 | 73 |
| Inversion | 19 | 81 |
diff --git a/problems/05-Abs/07.vsm b/problems/05-Abs/07.vsm
index 6f52852..c5c730c 100644
--- a/problems/05-Abs/07.vsm
+++ b/problems/05-Abs/07.vsm
@@ -1,20 +1,20 @@
imm f"inf" $t
-lpassa $llm0v $lln0v $llr0v
+lpassa $llm0v $lln0v $llr0v
lpassa $llm16v $lln16v $llr16v
lpassa $llm32v $lln32v $llr32v
lpassa $llm48v $lln48v $llr48v
lpassa $llm64v $lln64v $llr64v
-lpassa $llm80v $lln80v $llr80v; fvfma -$lr0v $t -$t $omr1
-isub $ls0 $lm0v $ln0v/$imr1; fvfma -$lr8v $t -$t $omr1
-isub $ls0 $lm8v $ln8v/$imr1; fvfma -$lr16v $t -$t $omr1
-isub $ls0 $lm16v $ln16v/$imr1; fvfma -$lr24v $t -$t $omr1
-isub $ls0 $lm24v $ln24v/$imr1; fvfma -$lr32v $t -$t $omr1
-isub $ls0 $lm32v $ln32v/$imr1; fvfma -$lr40v $t -$t $omr1
-isub $ls0 $lm40v $ln40v/$imr1; fvfma -$lr48v $t -$t $omr1
-isub $ls0 $lm48v $ln48v/$imr1; fvfma -$lr56v $t -$t $omr1
-isub $ls0 $lm56v $ln56v/$imr1; fvfma -$lr64v $t -$t $omr1
-isub $ls0 $lm64v $ln64v/$imr1; fvfma -$lr72v $t -$t $omr1
-isub $ls0 $lm72v $ln72v/$imr1; fvfma -$lr80v $t -$t $omr1
+lpassa $lm80v $ln80v $lr80v; fvfma -$lr0v $t -$t $omr1
+isub $ls0 $lm0v $ln0v/$imr1; fvfma -$lr8v $t -$t $omr1
+isub $ls0 $lm8v $ln8v/$imr1; fvfma -$lr16v $t -$t $omr1
+isub $ls0 $lm16v $ln16v/$imr1; fvfma -$lr24v $t -$t $omr1
+isub $ls0 $lm24v $ln24v/$imr1; fvfma -$lr32v $t -$t $omr1
+isub $ls0 $lm32v $ln32v/$imr1; fvfma -$lr40v $t -$t $omr1
+isub $ls0 $lm40v $ln40v/$imr1; fvfma -$lr48v $t -$t $omr1
+isub $ls0 $lm48v $ln48v/$imr1; fvfma -$lr56v $t -$t $omr1
+isub $ls0 $lm56v $ln56v/$imr1; fvfma -$lr64v $t -$t $omr1
+isub $ls0 $lm64v $ln64v/$imr1; fvfma -$lr72v $t -$t $omr1
+isub $ls0 $lm72v $ln72v/$imr1; fvfma -$lr80v $t -$t $omr1
isub $ls0 $lm80v $ln80v/$imr1
# (88 / 16 + 1).times { |i| puts "lpassa $llm#{16*i}v $lln#{16*i}v $llr#{16*i}v" }
diff --git a/problems/16-Count-Up/02.vsm b/problems/16-Count-Up/02.vsm
new file mode 100644
index 0000000..9a63cfe
--- /dev/null
+++ b/problems/16-Count-Up/02.vsm
@@ -0,0 +1,99 @@
+imm i"4" $s0/1000
+imm i"0b111" $s1/1000
+imm i"0b1110" $s2/1000
+imm i"6" $s3/1000
+
+ilsl $l1bid $s0 $nowrite
+iadd $aluf $s128v $s128v
+iand $peid $s1 $nowrite
+ipackbit $aluf $n0 $nowrite
+iadd $aluf $s128v $s128v
+iand $mabid $s2 $nowrite
+ilsl $aluf $s3 $nowrite
+iadd $aluf $s128v $s128v
+ipassa $aluf $s132v
+
+imm i"4096" $ls256v
+
+imm i"1" $r0/1000
+imm i"2" $r1/1000
+imm i"1025" $r2/1000
+imm i"1026" $r3/1000
+imm i"2049" $r4/1000
+imm i"2050" $r5/1000
+imm i"3073" $r6/1000
+imm i"3074" $r7/1000
+
+iadd $lr0v $ls128v $lr0v
+iadd $aluf $ls256v $lr8v
+iadd $aluf $ls256v $lr16v; l1bmd $lr0v $lb0
+iadd $aluf $ls256v $lr24v; l1bmd $lr8v $lb256
+iadd $aluf $ls256v $lr32v; l1bmd $lr16v $lb512
+iadd $aluf $ls256v $lr40v; l1bmd $lr24v $lb768; l2bmd $lb0 $lc0
+iadd $aluf $ls256v $lr48v; l1bmd $lr32v $lb1024; l2bmd $lb32 $lc256
+iadd $aluf $ls256v $lr56v; l1bmd $lr40v $lb1280; l2bmd $lb64 $lc512
+ l1bmd $lr48v $lb1536; l2bmd $lb96 $lc768
+ l1bmd $lr56v $lb1792; l2bmd $lb128 $lc1024
+l2bmd $lb160 $lc1280
+l2bmd $lb192 $lc1536
+l2bmd $lb224 $lc1792
+l2bmd $lb256 $lc2048
+l2bmd $lb288 $lc2304
+l2bmd $lb320 $lc2560
+l2bmd $lb352 $lc2816
+l2bmd $lb384 $lc3072
+l2bmd $lb416 $lc3328
+l2bmd $lb448 $lc3584
+l2bmd $lb480 $lc3840
+l2bmd $lb512 $lc4096
+l2bmd $lb544 $lc4352
+l2bmd $lb576 $lc4608
+l2bmd $lb608 $lc4864
+l2bmd $lb640 $lc5120
+l2bmd $lb672 $lc5376
+l2bmd $lb704 $lc5632
+l2bmd $lb736 $lc5888
+l2bmd $lb768 $lc6144
+l2bmd $lb800 $lc6400
+l2bmd $lb832 $lc6656
+l2bmd $lb864 $lc6912
+l2bmd $lb896 $lc7168
+l2bmd $lb928 $lc7424
+l2bmd $lb960 $lc7680
+l2bmd $lb992 $lc7936
+l2bmd $lb1024 $lc8192
+l2bmd $lb1056 $lc8448
+l2bmd $lb1088 $lc8704
+l2bmd $lb1120 $lc8960
+l2bmd $lb1152 $lc9216
+l2bmd $lb1184 $lc9472
+l2bmd $lb1216 $lc9728
+l2bmd $lb1248 $lc9984
+l2bmd $lb1280 $lc10240
+l2bmd $lb1312 $lc10496
+l2bmd $lb1344 $lc10752
+l2bmd $lb1376 $lc11008
+l2bmd $lb1408 $lc11264
+l2bmd $lb1440 $lc11520
+l2bmd $lb1472 $lc11776
+l2bmd $lb1504 $lc12032
+l2bmd $lb1536 $lc12288
+l2bmd $lb1568 $lc12544
+l2bmd $lb1600 $lc12800
+l2bmd $lb1632 $lc13056
+l2bmd $lb1664 $lc13312
+l2bmd $lb1696 $lc13568
+l2bmd $lb1728 $lc13824
+l2bmd $lb1760 $lc14080
+l2bmd $lb1792 $lc14336
+l2bmd $lb1824 $lc14592
+l2bmd $lb1856 $lc14848
+l2bmd $lb1888 $lc15104
+l2bmd $lb1920 $lc15360
+l2bmd $lb1952 $lc15616
+l2bmd $lb1984 $lc15872
+l2bmd $lb2016 $lc16128
+
+nop
+
+mvp/n16384 $lc0@.0 $d0