clb_mul MC MUL PL PH MCA S Ci T F NR (PH:PL) = MC * MUL
10 cells, 3729 characters, 64 sampled cases, 255*255 = 0xFE01 included
For scale: fibonacci is 8761 characters and does not multiply. The tape length
does not depend on MUL at all, because the loop body appears once.
The algorithm is repeated addition, not shift-and-add:
(PH:PL) = 0
while MUL != 0: (PH:PL) += MC ; MUL -= 1
which is the same lever as clb_add_ip: length is the metric, steps are not. Worst
case is about a million steps against the five million limit and that is fine.
The 16 bit accumulate uses clb_add_nc for the low byte because it is the one that
reports a carry out; clb_add_ip does not, so it cannot do that step. clb_add_nc
eats its operands, so each round copies the multiplicand first. The carry then
goes into the high byte with clb_add_ip, which costs nothing extra since it is
0 or 1.
Worth recording what this did to my own plan: I had said the multiplier needed
"cross byte shifts" and "conditional accumulate" first, and sketched a
shift-and-add design around them. Repeated addition needs neither -- the shift
disappears entirely. The primitive that actually mattered was the one I called
missing two messages earlier: an add that keeps the addend alive, which is what
pushed out clb_add_ip and clb_nonzero. Look at the objective function before
copying the shape of a hardware multiplier.
byte_op_test is seventeen operations, still 1.4 s, with test_mul sampled over
8 multipliers x 8 multiplicands.
516 lines
18 KiB
C++
516 lines
18 KiB
C++
// Runs the byte level library macros over every input pair on a ROT-8 machine.
|
|
//
|
|
// r8forge_byte_op_test [repo root]
|
|
//
|
|
// The machine below follows the reference implementation in ROT-8-viz
|
|
// (src/rot8.c): `biz` jumps when the LOW BIT of the cell is 0 and `rnz` jumps
|
|
// back when it is 1, so `set_0` (= [-]) clears the low bit of whatever is in
|
|
// the cell. Reading `[`/`]` as a Brainfuck style "is the cell zero" test makes
|
|
// every one of these programs look like an endless loop -- which is exactly the
|
|
// mistake three interpreters in this repo used to make.
|
|
#include "r8forge/r8asm.hh"
|
|
#include <cstdint>
|
|
#include <cstdlib>
|
|
#include <iostream>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace {
|
|
|
|
struct machine {
|
|
std::vector<uint8_t> cells = std::vector<uint8_t>(256, 0);
|
|
std::vector<uint8_t> out;
|
|
size_t dp = 0;
|
|
size_t steps = 0;
|
|
bool finished = true; // false: the step limit ran out
|
|
|
|
static uint8_t ror(uint8_t v) { return uint8_t((v >> 1) | (v << 7)); }
|
|
|
|
void run(const std::string &tape, size_t limit) {
|
|
for (size_t pc = 0; pc < tape.size(); pc++) {
|
|
if (++steps > limit) {
|
|
finished = false;
|
|
return;
|
|
}
|
|
switch (tape[pc]) {
|
|
case '>':
|
|
dp = (dp + 1) % cells.size();
|
|
break;
|
|
case '<':
|
|
dp = (dp + cells.size() - 1) % cells.size();
|
|
break;
|
|
case '-': // flb
|
|
cells[dp] ^= 1;
|
|
break;
|
|
case '+': // ror
|
|
cells[dp] = ror(cells[dp]);
|
|
break;
|
|
case '[': // biz: branch when the low bit is zero
|
|
if ((cells[dp] & 1) == 0) {
|
|
int depth = 1;
|
|
while (depth) {
|
|
pc++;
|
|
if (tape[pc] == '[')
|
|
depth++;
|
|
else if (tape[pc] == ']')
|
|
depth--;
|
|
}
|
|
}
|
|
break;
|
|
case ']': // rnz: return when the low bit is one
|
|
if ((cells[dp] & 1) == 1) {
|
|
int depth = 1;
|
|
while (depth) {
|
|
pc--;
|
|
if (tape[pc] == ']')
|
|
depth++;
|
|
else if (tape[pc] == '[')
|
|
depth--;
|
|
}
|
|
}
|
|
break;
|
|
case '.':
|
|
out.push_back(cells[dp]);
|
|
break;
|
|
default: // ',' (input) is not modelled
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
std::string assemble(const std::string &file) {
|
|
r8asm assembler;
|
|
if (!assembler.import_file(file, 8) || assembler.failed()) {
|
|
std::cerr << "could not assemble " << file << "\n";
|
|
std::exit(1);
|
|
}
|
|
return assembler.export_rot8();
|
|
}
|
|
|
|
int failures = 0;
|
|
|
|
void report(const std::string &name, int a, int b, const machine &m,
|
|
const std::string &want) {
|
|
if (failures++ < 5) {
|
|
std::cerr << " WRONG " << name << " a=" << a << " b=" << b << " out";
|
|
for (uint8_t v : m.out)
|
|
std::cerr << " " << int(v);
|
|
std::cerr << " want " << want << " finished=" << m.finished
|
|
<< " steps=" << m.steps << "\n";
|
|
}
|
|
}
|
|
|
|
// raw_and / raw_or / raw_xor: both operands are preserved, the result is third.
|
|
int test_bitop(const std::string &file, const char *name, int op) {
|
|
const std::string tape = assemble(file);
|
|
std::cout << name << ": " << tape.size() << " characters\n";
|
|
int bad = 0;
|
|
for (int a = 0; a < 256; a++)
|
|
for (int b = 0; b < 256; b++) {
|
|
machine m;
|
|
m.cells[0] = uint8_t(a); // A
|
|
m.cells[2] = uint8_t(b); // B
|
|
m.run(tape, 100'000);
|
|
const int want = op == 0 ? (a & b) : op == 1 ? (a | b) : (a ^ b);
|
|
const bool ok = m.finished && m.out.size() == 3 && m.out[0] == a &&
|
|
m.out[1] == b && m.out[2] == want;
|
|
if (!ok) {
|
|
bad++;
|
|
if (bad <= 3)
|
|
report(name, a, b, m,
|
|
std::to_string(a) + " " + std::to_string(b) + " " +
|
|
std::to_string(want));
|
|
}
|
|
}
|
|
std::cout << " " << (bad ? "FAILED" : "all 65536 combinations ok")
|
|
<< (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n";
|
|
return bad;
|
|
}
|
|
|
|
// raw_add: out is A, B, Ci, S, Co.
|
|
int test_add(const std::string &file) {
|
|
const std::string tape = assemble(file);
|
|
std::cout << "raw_add: " << tape.size() << " characters\n";
|
|
int bad = 0;
|
|
for (int a = 0; a < 256; a++)
|
|
for (int b = 0; b < 256; b++) {
|
|
machine m;
|
|
m.cells[0] = uint8_t(a);
|
|
m.cells[2] = uint8_t(b);
|
|
m.run(tape, 100'000);
|
|
const int sum = a + b;
|
|
const bool ok = m.finished && m.out.size() == 5 && m.out[0] == a &&
|
|
m.out[1] == b && m.out[2] == 0 &&
|
|
m.out[3] == (sum & 0xff) && m.out[4] == (sum >> 8);
|
|
if (!ok) {
|
|
bad++;
|
|
if (bad <= 3)
|
|
report("raw_add", a, b, m,
|
|
std::to_string(a) + " " + std::to_string(b) + " 0 " +
|
|
std::to_string(sum & 0xff) + " " +
|
|
std::to_string(sum >> 8));
|
|
}
|
|
}
|
|
std::cout << " " << (bad ? "FAILED" : "all 65536 combinations ok")
|
|
<< (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n";
|
|
return bad;
|
|
}
|
|
|
|
// raw_inc: out is A, Ci, S, Co; S = A + Ci.
|
|
int test_inc(const std::string &file) {
|
|
const std::string tape = assemble(file);
|
|
std::cout << "raw_inc: " << tape.size() << " characters\n";
|
|
int bad = 0;
|
|
for (int a = 0; a < 256; a++)
|
|
for (int ci = 0; ci < 2; ci++) {
|
|
machine m;
|
|
m.cells[0] = uint8_t(a);
|
|
m.cells[2] = uint8_t(ci);
|
|
m.run(tape, 100'000);
|
|
const int sum = a + ci;
|
|
const bool ok = m.finished && m.out.size() == 4 && m.out[0] == a &&
|
|
m.out[1] == ci && m.out[2] == (sum & 0xff) &&
|
|
m.out[3] == (sum >> 8);
|
|
if (!ok) {
|
|
bad++;
|
|
if (bad <= 3)
|
|
report("raw_inc", a, ci, m,
|
|
std::to_string(a) + " " + std::to_string(ci) + " " +
|
|
std::to_string(sum & 0xff) + " " +
|
|
std::to_string(sum >> 8));
|
|
}
|
|
}
|
|
std::cout << " " << (bad ? "FAILED" : "all 512 combinations ok")
|
|
<< (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n";
|
|
return bad;
|
|
}
|
|
|
|
// clb_add_nc: out is A, B, S, Ci. This one eats both operands, so A and B have
|
|
// to come back zero -- that is what lets it use the 4 cell slice.
|
|
int test_add_nc(const std::string &file) {
|
|
const std::string tape = assemble(file);
|
|
std::cout << "clb_add_nc: " << tape.size() << " characters\n";
|
|
int bad = 0;
|
|
for (int a = 0; a < 256; a++)
|
|
for (int b = 0; b < 256; b++) {
|
|
machine m;
|
|
m.cells[0] = uint8_t(a); // A
|
|
m.cells[2] = uint8_t(b); // B
|
|
m.run(tape, 100'000);
|
|
const int sum = a + b;
|
|
const bool ok = m.finished && m.out.size() == 4 && m.out[0] == 0 &&
|
|
m.out[1] == 0 && m.out[2] == (sum & 0xff) &&
|
|
m.out[3] == (sum >> 8);
|
|
if (!ok) {
|
|
bad++;
|
|
if (bad <= 3)
|
|
report("clb_add_nc", a, b, m,
|
|
"0 0 " + std::to_string(sum & 0xff) + " " +
|
|
std::to_string(sum >> 8));
|
|
}
|
|
}
|
|
std::cout << " " << (bad ? "FAILED" : "all 65536 combinations ok")
|
|
<< (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n";
|
|
return bad;
|
|
}
|
|
|
|
// clb_inc_nc: out is A, S, Ci.
|
|
int test_inc_nc(const std::string &file) {
|
|
const std::string tape = assemble(file);
|
|
std::cout << "clb_inc_nc: " << tape.size() << " characters\n";
|
|
int bad = 0;
|
|
for (int a = 0; a < 256; a++) {
|
|
machine m;
|
|
m.cells[0] = uint8_t(a); // A
|
|
m.run(tape, 100'000);
|
|
const int sum = a + 1;
|
|
const bool ok = m.finished && m.out.size() == 3 && m.out[0] == 0 &&
|
|
m.out[1] == (sum & 0xff) && m.out[2] == (sum >> 8);
|
|
if (!ok) {
|
|
bad++;
|
|
if (bad <= 3)
|
|
report("clb_inc_nc", a, 1, m,
|
|
"0 " + std::to_string(sum & 0xff) + " " +
|
|
std::to_string(sum >> 8));
|
|
}
|
|
}
|
|
std::cout << " " << (bad ? "FAILED" : "all 256 combinations ok")
|
|
<< (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n";
|
|
return bad;
|
|
}
|
|
|
|
// clb_neg_nc: out is A, S, Ci; S = -A, A is eaten.
|
|
int test_neg_nc(const std::string &file) {
|
|
const std::string tape = assemble(file);
|
|
std::cout << "clb_neg_nc: " << tape.size() << " characters\n";
|
|
int bad = 0;
|
|
for (int a = 0; a < 256; a++) {
|
|
machine m;
|
|
m.cells[0] = uint8_t(a); // A
|
|
m.run(tape, 100'000);
|
|
const int neg = (256 - a) & 0xff;
|
|
const int carry = a == 0 ? 1 : 0; // -0 is 0 but it does carry out
|
|
const bool ok = m.finished && m.out.size() == 3 && m.out[0] == 0 &&
|
|
m.out[1] == neg && m.out[2] == carry;
|
|
if (!ok) {
|
|
bad++;
|
|
if (bad <= 3)
|
|
report("clb_neg_nc", a, 0, m,
|
|
"0 " + std::to_string(neg) + " " + std::to_string(carry));
|
|
}
|
|
}
|
|
std::cout << " " << (bad ? "FAILED" : "all 256 combinations ok")
|
|
<< (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n";
|
|
return bad;
|
|
}
|
|
|
|
// clb_sub_nc: out is A, B, S, Ci; S = A - B and Ci = 1 means no borrow.
|
|
int test_sub_nc(const std::string &file) {
|
|
const std::string tape = assemble(file);
|
|
std::cout << "clb_sub_nc: " << tape.size() << " characters\n";
|
|
int bad = 0;
|
|
for (int a = 0; a < 256; a++)
|
|
for (int b = 0; b < 256; b++) {
|
|
machine m;
|
|
m.cells[0] = uint8_t(a); // A
|
|
m.cells[2] = uint8_t(b); // B
|
|
m.run(tape, 100'000);
|
|
const int diff = (a - b) & 0xff;
|
|
const int no_borrow = a >= b ? 1 : 0;
|
|
const bool ok = m.finished && m.out.size() == 4 && m.out[0] == 0 &&
|
|
m.out[1] == 0 && m.out[2] == diff && m.out[3] == no_borrow;
|
|
if (!ok) {
|
|
bad++;
|
|
if (bad <= 3)
|
|
report("clb_sub_nc", a, b, m,
|
|
"0 0 " + std::to_string(diff) + " " +
|
|
std::to_string(no_borrow));
|
|
}
|
|
}
|
|
std::cout << " " << (bad ? "FAILED" : "all 65536 combinations ok")
|
|
<< (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n";
|
|
return bad;
|
|
}
|
|
|
|
// Same macro with its carry in at 0 is the ones' complement: S = ~A.
|
|
int test_not_nc(const std::string &file) {
|
|
const std::string tape = assemble(file);
|
|
std::cout << "clb_neg_nc (carry 0): " << tape.size() << " characters\n";
|
|
int bad = 0;
|
|
for (int a = 0; a < 256; a++) {
|
|
machine m;
|
|
m.cells[0] = uint8_t(a); // A
|
|
m.run(tape, 100'000);
|
|
const int inv = (~a) & 0xff;
|
|
const bool ok = m.finished && m.out.size() == 3 && m.out[0] == 0 &&
|
|
m.out[1] == inv && m.out[2] == 0;
|
|
if (!ok) {
|
|
bad++;
|
|
if (bad <= 3)
|
|
report("clb_neg_nc/0", a, 0, m, "0 " + std::to_string(inv) + " 0");
|
|
}
|
|
}
|
|
std::cout << " " << (bad ? "FAILED" : "all 256 combinations ok")
|
|
<< (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n";
|
|
return bad;
|
|
}
|
|
|
|
// clb_not_ip: the ones' complement done in place, one cell, no carry.
|
|
int test_not_ip(const std::string &file) {
|
|
const std::string tape = assemble(file);
|
|
std::cout << "clb_not_ip: " << tape.size() << " characters\n";
|
|
int bad = 0;
|
|
for (int a = 0; a < 256; a++) {
|
|
machine m;
|
|
m.cells[0] = uint8_t(a); // A
|
|
m.run(tape, 100'000);
|
|
const int inv = (~a) & 0xff;
|
|
const bool ok =
|
|
m.finished && m.out.size() == 1 && m.out[0] == inv;
|
|
if (!ok) {
|
|
bad++;
|
|
if (bad <= 3)
|
|
report("clb_not_ip", a, 0, m, std::to_string(inv));
|
|
}
|
|
}
|
|
std::cout << " " << (bad ? "FAILED" : "all 256 combinations ok")
|
|
<< (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n";
|
|
return bad;
|
|
}
|
|
|
|
// clb_inc_ip: A = A + 1, both in place and in two cells.
|
|
int test_inc_ip(const std::string &file) {
|
|
const std::string tape = assemble(file);
|
|
std::cout << "clb_inc_ip: " << tape.size() << " characters\n";
|
|
int bad = 0;
|
|
for (int a = 0; a < 256; a++) {
|
|
machine m;
|
|
m.cells[0] = uint8_t(a); // A
|
|
m.run(tape, 100'000);
|
|
const int want = (a + 1) & 0xff;
|
|
const bool ok = m.finished && m.out.size() == 1 && m.out[0] == want &&
|
|
m.cells[1] == 0; // the counter cell is spent
|
|
if (!ok) {
|
|
bad++;
|
|
if (bad <= 3)
|
|
report("clb_inc_ip", a, 0, m, std::to_string(want));
|
|
}
|
|
}
|
|
std::cout << " " << (bad ? "FAILED" : "all 256 combinations ok")
|
|
<< (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n";
|
|
return bad;
|
|
}
|
|
|
|
// clb_neg_ip: A = -A, in place, two cells.
|
|
int test_neg_ip(const std::string &file) {
|
|
const std::string tape = assemble(file);
|
|
std::cout << "clb_neg_ip: " << tape.size() << " characters\n";
|
|
int bad = 0;
|
|
for (int a = 0; a < 256; a++) {
|
|
machine m;
|
|
m.cells[0] = uint8_t(a); // A
|
|
m.run(tape, 100'000);
|
|
const int want = (256 - a) & 0xff;
|
|
const bool ok = m.finished && m.out.size() == 1 && m.out[0] == want;
|
|
if (!ok) {
|
|
bad++;
|
|
if (bad <= 3)
|
|
report("clb_neg_ip", a, 0, m, std::to_string(want));
|
|
}
|
|
}
|
|
std::cout << " " << (bad ? "FAILED" : "all 256 combinations ok")
|
|
<< (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n";
|
|
return bad;
|
|
}
|
|
|
|
// clb_dec_ip: A = A - 1, in place.
|
|
int test_dec_ip(const std::string &file) {
|
|
const std::string tape = assemble(file);
|
|
std::cout << "clb_dec_ip: " << tape.size() << " characters\n";
|
|
int bad = 0;
|
|
for (int a = 0; a < 256; a++) {
|
|
machine m;
|
|
m.cells[0] = uint8_t(a);
|
|
m.run(tape, 100'000);
|
|
const int want = (a - 1) & 0xff;
|
|
const bool ok = m.finished && m.out.size() == 1 && m.out[0] == want;
|
|
if (!ok) {
|
|
bad++;
|
|
if (bad <= 3)
|
|
report("clb_dec_ip", a, 0, m, std::to_string(want));
|
|
}
|
|
}
|
|
std::cout << " " << (bad ? "FAILED" : "all 256 combinations ok")
|
|
<< (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n";
|
|
return bad;
|
|
}
|
|
|
|
// clb_nonzero: F = (B != 0), B untouched.
|
|
int test_nonzero(const std::string &file) {
|
|
const std::string tape = assemble(file);
|
|
std::cout << "clb_nonzero: " << tape.size() << " characters\n";
|
|
int bad = 0;
|
|
for (int b = 0; b < 256; b++) {
|
|
machine m;
|
|
m.cells[0] = uint8_t(b); // B
|
|
m.run(tape, 100'000);
|
|
const bool ok = m.finished && m.out.size() == 2 && m.out[0] == b &&
|
|
m.out[1] == (b != 0 ? 1 : 0);
|
|
if (!ok) {
|
|
bad++;
|
|
if (bad <= 3)
|
|
report("clb_nonzero", b, 0, m,
|
|
std::to_string(b) + " " + std::to_string(b != 0 ? 1 : 0));
|
|
}
|
|
}
|
|
std::cout << " " << (bad ? "FAILED" : "all 256 combinations ok")
|
|
<< (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n";
|
|
return bad;
|
|
}
|
|
|
|
// clb_add_ip: A = A + B in place, B is eaten. The loop runs B times, so this
|
|
// one is sampled rather than exhaustive -- 256 addends x 8 accumulators.
|
|
int test_add_ip(const std::string &file) {
|
|
const std::string tape = assemble(file);
|
|
std::cout << "clb_add_ip: " << tape.size() << " characters (sampled)\n";
|
|
const int accs[] = {0, 1, 5, 127, 128, 200, 254, 255};
|
|
int bad = 0, n = 0;
|
|
for (int a : accs)
|
|
for (int b = 0; b < 256; b++) {
|
|
machine m;
|
|
m.cells[0] = uint8_t(a); // A
|
|
m.cells[1] = uint8_t(b); // B
|
|
m.run(tape, 5'000'000);
|
|
n++;
|
|
const int want = (a + b) & 0xff;
|
|
const bool ok = m.finished && m.out.size() == 2 && m.out[0] == want &&
|
|
m.out[1] == 0;
|
|
if (!ok) {
|
|
bad++;
|
|
if (bad <= 3)
|
|
report("clb_add_ip", a, b, m, std::to_string(want) + " 0");
|
|
}
|
|
}
|
|
std::cout << " " << (bad ? "FAILED" : "all " + std::to_string(n) + " sampled combinations ok")
|
|
<< (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n";
|
|
return bad;
|
|
}
|
|
|
|
// clb_mul: (PH:PL) = MC * MUL, MC preserved. Repeated addition, so whatever
|
|
// MUL says is how many times the loop runs -- sampled, not exhaustive.
|
|
int test_mul(const std::string &file) {
|
|
const std::string tape = assemble(file);
|
|
std::cout << "clb_mul: " << tape.size() << " characters (sampled)\n";
|
|
const int vals[] = {0, 1, 2, 3, 7, 13, 100, 255};
|
|
int bad = 0, n = 0;
|
|
for (int mc : vals)
|
|
for (int mu : vals) {
|
|
machine m;
|
|
m.cells[0] = uint8_t(mc); // MC
|
|
m.cells[1] = uint8_t(mu); // MUL
|
|
m.run(tape, 5'000'000);
|
|
n++;
|
|
const int p = mc * mu;
|
|
const bool ok = m.finished && m.out.size() == 3 &&
|
|
m.out[0] == (p & 0xff) && m.out[1] == ((p >> 8) & 0xff) &&
|
|
m.out[2] == mc;
|
|
if (!ok) {
|
|
bad++;
|
|
if (bad <= 3)
|
|
report("clb_mul", mc, mu, m,
|
|
std::to_string(p & 0xff) + " " + std::to_string((p >> 8) & 0xff) +
|
|
" " + std::to_string(mc));
|
|
}
|
|
}
|
|
std::cout << " " << (bad ? "FAILED" : "all " + std::to_string(n) + " sampled combinations ok")
|
|
<< (bad ? " (" + std::to_string(bad) + " wrong)" : "") << "\n";
|
|
return bad;
|
|
}
|
|
|
|
} // namespace
|
|
|
|
int main(int argc, char **argv) {
|
|
const std::string root = argc > 1 ? argv[1] : ".";
|
|
const std::string drv = root + "/drv/";
|
|
const int bad = test_add(drv + "raw_add_byte.r8asm") +
|
|
test_bitop(drv + "raw_and_byte.r8asm", "raw_and", 0) +
|
|
test_bitop(drv + "raw_or_byte.r8asm", "raw_or", 1) +
|
|
test_bitop(drv + "raw_xor_byte.r8asm", "raw_xor", 2) +
|
|
test_inc(drv + "raw_inc_byte.r8asm") +
|
|
test_add_nc(drv + "raw_add_nc_byte.r8asm") +
|
|
test_inc_nc(drv + "raw_inc_nc_byte.r8asm") +
|
|
test_neg_nc(drv + "raw_neg_nc_byte.r8asm") +
|
|
test_not_nc(drv + "raw_not_nc_byte.r8asm") +
|
|
test_not_ip(drv + "not_ip_byte.r8asm") +
|
|
test_inc_ip(drv + "inc_ip_byte.r8asm") +
|
|
test_neg_ip(drv + "neg_ip_byte.r8asm") +
|
|
test_dec_ip(drv + "dec_ip_byte.r8asm") +
|
|
test_nonzero(drv + "nonzero_byte.r8asm") +
|
|
test_add_ip(drv + "add_ip_byte.r8asm") +
|
|
test_mul(drv + "mul_byte.r8asm") +
|
|
test_sub_nc(drv + "raw_sub_nc_byte.r8asm");
|
|
std::cout << (bad ? "FAILED\n" : "byte level library ok\n");
|
|
return bad ? 1 : 0;
|
|
}
|