A "high-level" language for the Gameboy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
480 B

  1. import type { BinaryOp, UnaryOp } from "../ast"
  2. import type { Loc } from "./loc"
  3. export type Operand = Loc | number
  4. type ASSA<Data> = { dest: Loc, source: Operand } & Data
  5. // dest = source
  6. export type SSACopy = ASSA<{}>
  7. // dest = op(source)
  8. export type SSAUnary = ASSA<{ op: UnaryOp | BinaryOp }>
  9. // dest = op(source, source1)
  10. export type SSABinary = ASSA<{ op: BinaryOp, source1: Operand }>
  11. export type SSA = SSACopy | SSAUnary
  12. export type SSAWithBinary = SSA | SSABinary