Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: whitequark/Boneless-CPU
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 22b299d53d17
Choose a base ref
...
head repository: whitequark/Boneless-CPU
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8ec21cdb469a
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Dec 27, 2018

  1. Copy the full SHA
    244d439 View commit details

Commits on Dec 28, 2018

  1. Copy the full SHA
    8ec21cd View commit details
Showing with 10 additions and 5 deletions.
  1. +10 −5 boneless/arch/instr.py
  2. BIN doc/design.ods
15 changes: 10 additions & 5 deletions boneless/arch/instr.py
Original file line number Diff line number Diff line change
@@ -66,10 +66,6 @@ def AND (rd, ra, rb): return [A_FORMAT(OPCODE_LOGIC, OPTYPE_AND, rd, ra, rb)]
def OR (rd, ra, rb): return [A_FORMAT(OPCODE_LOGIC, OPTYPE_OR, rd, ra, rb)]
def XOR (rd, ra, rb): return [A_FORMAT(OPCODE_LOGIC, OPTYPE_XOR, rd, ra, rb)]

def XCHG(rx, ry): return [*XOR(rx, rx, ry),
*XOR(ry, ry, rx),
*XOR(rx, rx, ry)]

def ADD (rd, ra, rb): return [A_FORMAT(OPCODE_ARITH, OPTYPE_ADD, rd, ra, rb)]
def SUB (rd, ra, rb): return [A_FORMAT(OPCODE_ARITH, OPTYPE_SUB, rd, ra, rb)]
def CMP ( ra, rb): return [A_FORMAT(OPCODE_ARITH, OPTYPE_CMP, 0, ra, rb)]
@@ -122,6 +118,8 @@ def JSLT(off): return [C_FORMAT(OPCODE_JSLT, off)]
def JSGT(off): return [C_FORMAT(OPCODE_JSGT, off)]
def JSLE(off): return [C_FORMAT(OPCODE_JSLE, off)]

def ILL(insn): return [insn & 0xffff]

def MOVI(rd, imm16):
assert imm16 in range(65536)
if imm16 in range(256):
@@ -130,7 +128,14 @@ def MOVI(rd, imm16):
return MOVH(rd, (imm16 >> 8) + ((imm16 >> 7) & 1)) + \
[I_FORMAT(OPCODE_ADDI, rd, imm16 & 0xff, u=True)]

def ILL(insn): return [insn & 0xffff]

def XCHG(rx, ry):
assert rx != ry
return [
*XOR(rx, rx, ry),
*XOR(ry, ry, rx),
*XOR(rx, rx, ry)
]


def L(label): return label
Binary file modified doc/design.ods
Binary file not shown.