foot/DOCS.txt
shylie 80d83f2062
All checks were successful
Test / build (push) Successful in 13s
Add SIMD instruction variants
2025-08-17 11:18:08 -04:00

87 lines
25 KiB
Plaintext

╔══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║ Foot ISA ║
╠══════════════════════════════════════════════════════════════════════════════════════════════════════════╦══╦════════════════════════════════╣
║ Instruction Format ║ ║ Addressing modes ║
╠══════════╦══════════════════════╦════════════════╦═══════════════════════════════════════════════════════╣ ╠══════╦═════════════════════════╣
║ ║ ║ ║ Encoding ║ ║ 00 ║ Immediate ║
║ Mnemonic ║ Description ║ Semantics ╠═════════════╦═════════════╦═════════════╦═════════════╣ ╠══════╬═════════════════════════╣
║ ║ ║ ║ 24-31 ║ 16-23 ║ 8-15 ║ 0-7 ║ ║ 01 ║ Direct ║
╠══════════╬══════════════════════╬════════════════╬══════╦══════╬══════╦══════╬══════╦══════╬══════╦══════╣ ╠══════╬═════════════════════════╣
║ CNST ║ Load immediate ║ D = I ║ CCCR ║ 0000 ║ 0DDd ║ dddd ║ iiii ║ iiii ║ iiii ║ iiii ║ ║ 10 ║ Indirect ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╬═════════════════════════╣
║ CMPR ║ Compare ║ C = A <=> B ║ CCCR ║ 0001 ║ 0BBb ║ bbbb ║ 0000 ║ 0000 ║ 0AAa ║ aaaa ║ ║ 11 ║ Indirect auto-increment ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╩═════════════════════════╣
║ BWNG ║ Bitwise negate ║ D = ~A ║ CCCR ║ 0001 ║ 0DDd ║ dddd ║ 0000 ║ 0001 ║ 0AAa ║ aaaa ║ ║ Conditional execution flags ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╦═════════════════════════╣
║ ARNG ║ Arithmetic negate ║ D = -A ║ CCCR ║ 0001 ║ xDDd ║ dddd ║ 0000 ║ 0010 ║ xAAa ║ aaaa ║ ║ 000 ║ Always ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╬═════════════════════════╣
║ LONG ║ Logical negate ║ D = !A ║ CCCR ║ 0001 ║ xDDd ║ dddd ║ 0000 ║ 0011 ║ xAAa ║ aaaa ║ ║ 001 ║ A < B ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╬═════════════════════════╣
║ CONF ║ Configure processor ║ D = old config ║ CCCR ║ 0001 ║ 0DDd ║ dddd ║ 0000 ║ 0100 ║ 0AAa ║ aaaa ║ ║ 010 ║ A <= B ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╬═════════════════════════╣
║ BWOR ║ Bitwise or ║ D = A | B ║ CCCR ║ 0010 ║ 0DDd ║ dddd ║ 0BBb ║ bbbb ║ 0AAa ║ aaaa ║ ║ 011 ║ A = B ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╬═════════════════════════╣
║ BAND ║ Bitwise and ║ D = A & B ║ CCCR ║ 0011 ║ 0DDd ║ dddd ║ 0BBb ║ bbbb ║ 0AAa ║ aaaa ║ ║ 100 ║ A >= B ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╬═════════════════════════╣
║ BXOR ║ Bitwise exclusive or ║ D = A ^ B ║ CCCR ║ 0100 ║ 0DDd ║ dddd ║ 0BBb ║ bbbb ║ 0AAa ║ aaaa ║ ║ 101 ║ A > B ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╬═════════════════════════╣
║ RESERVED ║ ║ ║ ║ 0101 ║ ║ ║ ║ ║ ║ ║ ║ 110 ║ A != B ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╬═════════════════════════╣
║ SRSH ║ Signed right shift ║ D = A >> B ║ CCCR ║ 0110 ║ xDDd ║ dddd ║ 0BBb ║ bbbb ║ xAAa ║ aaaa ║ ║ 111 ║ Reserved ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╩═════════════════════════╣
║ ZLSH ║ Pad zero left shift ║ D = A << B ║ CCCR ║ 0111 ║ xDDd ║ dddd ║ 0BBb ║ bbbb ║ xAAa ║ aaaa ║ ║ SIMD bits ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╦═════════════════════════╣
║ CLSH ║ Circular left shift ║ D = A << B ║ CCCR ║ 1000 ║ xDDd ║ dddd ║ 0BBb ║ bbbb ║ xAAa ║ aaaa ║ ║ 00 ║ 1 32-bit number ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╬═════════════════════════╣
║ ADDI ║ Addition ║ D = A + B ║ CCCR ║ 1001 ║ xDDd ║ dddd ║ 0BBb ║ bbbb ║ xAAa ║ aaaa ║ ║ 01 ║ 2 16-bit numbers ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╬═════════════════════════╣
║ SUBT ║ Subtraction ║ D = A - B ║ CCCR ║ 1010 ║ xDDd ║ dddd ║ 0BBb ║ bbbb ║ xAAa ║ aaaa ║ ║ 10 ║ 4 8-bit numbers ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╬═════════════════════════╣
║ MULT ║ Multiplication ║ D = A * B ║ CCCR ║ 1011 ║ xDDd ║ dddd ║ 0BBb ║ bbbb ║ xAAa ║ aaaa ║ ║ 11 ║ 8 4-bit numbers ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╩═════════════════════════╣
║ DIVI ║ Division ║ D = A / B ║ CCCR ║ 1100 ║ xDDd ║ dddd ║ 0BBb ║ bbbb ║ xAAa ║ aaaa ║ ║ Processor configuration bits ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╦═════════════════════════╣
║ MODU ║ Modulus ║ D = A % B ║ CCCR ║ 1101 ║ xDDd ║ dddd ║ 0BBb ║ bbbb ║ xAAa ║ aaaa ║ ║ 4-0 ║ Multiplication shift ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╬═════════════════════════╣
║ RESERVED ║ ║ ║ ║ 1110 ║ ║ ║ ║ ║ ║ ║ ║ 31-4 ║ Reserved ║
╠══════════╬══════════════════════╬════════════════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╬══════╣ ╠══════╬═════════════════════════╣
║ RESERVED ║ ║ ║ ║ 1111 ║ ║ ║ ║ ║ ║ ║ ║ ║ ║
╚══════════╩══════════════════════╩════════════════╩══════╩══════╩══════╩══════╩══════╩══════╩══════╩══════╩══╩══════╩═════════════════════════╝
╔═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║ Foot ISA Table Key ║
╠══════════════════════════════════════════════════════════════╦══╦════════════════════════════════════════╦══╦══════════════════════════════════════════════════╦══╦═════════════════════════════════╣
║ Addressing Modes ║ ║ Conditional Execution Flags ║ ║ Processor Configuration Bits ║ ║ Instruction Bits ║
╠═════════════════╦════════════════════════════════════════════╣ ╠════════╦═══════════════════════════════╣ ╠══════════════════════╦═══════════════════════════╣ ╠═══╦═════════════════════════════╣
║ Immediate ║ Use register index as operand or ║ ║ Always ║ Always run ║ ║ Multiplication shift ║ Bit-shift for fixed-point ║ ║ C ║ Conditional Execution Flags ║
║ ║ Discard result ║ ║ ║ ║ ║ ║ multiplication operations ║ ║ ║ ║
╠═════════════════╬════════════════════════════════════════════╣ ╠════════╬═══════════════════════════════╣ ╠══════════════════════╩═══════════════════════════╣ ╠═══╬═════════════════════════════╣
║ Direct ║ Use register contents as operand or ║ ║ A < B ║ Run if last CMPR instruction ║ ║ ║ ║ R ║ Repeat Flag ║
║ ║ Store to register ║ ║ ║ indicated A is less than B ║ ║ ║ ║ ║ ║
╠═════════════════╬════════════════════════════════════════════╣ ╠════════╬═══════════════════════════════╣ ║ ║ ╠═══╬═════════════════════════════╣
║ Indirect ║ Use register contents as memory address, ║ ║ A <= B ║ Run if last CMPR instruction ║ ║ ║ ║ D ║ Destination Addressing Mode ║
║ ║ then use memory contents as operand ║ ║ ║ indicated A is less than or ║ ║ ║ ║ ║ ║
║ ║ or store to memory. ║ ║ ║ equal to B ║ ║ ║ ║ ║ ║
╠═════════════════╬════════════════════════════════════════════╣ ╠════════╬═══════════════════════════════╣ ║ ║ ╠═══╬═════════════════════════════╣
║ Indirect ║ Use register contents as memory address, ║ ║ A = B ║ Run if last CMPR instruction ║ ║ ║ ║ d ║ Destination Register Index ║
║ Auto-increment ║ then use memory contents as operand ║ ║ ║ indicated A equal to B ║ ║ ║ ║ ║ ║
║ ║ or store to memory. ║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ Then, increment register contents by 1. ║ ║ ║ ║ ║ ║ ║ ║ ║
╠═════════════════╬════════════════════════════════════════════╣ ╠════════╬═══════════════════════════════╣ ║ ║ ╠═══╬═════════════════════════════╣
║ Indirect ║ Use register contents as memory address, ║ ║ A >= B ║ Run if last CMPR instruction ║ ║ ║ ║ A ║ Operand A Addressing Mode ║
║ ║ then use memory contents as operand ║ ║ ║ indicated A is greater than ║ ║ ║ ║ ║ ║
║ ║ or store to memory. ║ ║ ║ or equal to B ║ ║ ║ ║ ║ ║
╠═════════════════╩════════════════════════════════════════════╣ ╠════════╬═══════════════════════════════╣ ║ ║ ╠═══╬═════════════════════════════╣
║ ║ ║ A > B ║ Run if last CMPR instruction ║ ║ ║ ║ a ║ Operand A Register Index ║
║ ║ ║ ║ indicated A is greater than B ║ ║ ║ ║ ║ ║
║ ║ ╠════════╬═══════════════════════════════╣ ║ ║ ╠═══╬═════════════════════════════╣
║ ║ ║ A != B ║ Run if last CMPR instruction ║ ║ ║ ║ B ║ Operand B Addressing Mode ║
║ ║ ║ ║ indicated A is not equal to B ║ ║ ║ ║ ║ ║
║ ║ ╠════════╩═══════════════════════════════╣ ║ ║ ╠═══╬═════════════════════════════╣
║ ║ ║ ║ ║ ║ ║ b ║ Operand B Register Index ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ╠═══╬═════════════════════════════╣
║ ║ ║ ║ ║ ║ ║ i ║ Immediate Integer ║
╚══════════════════════════════════════════════════════════════╩══╩════════════════════════════════════════╩══╩══════════════════════════════════════════════════╩══╩═══╩═════════════════════════════╝