fixed a stack prelude postlude being needlesly generated + struct can now be compared
This commit is contained in:
parent
12bb7029b4
commit
397b2a4b1b
|
@ -313,9 +313,12 @@ Color := packed struct {b: u8, g: u8, r: u8, a: u8}
|
||||||
main := fn(): uint {
|
main := fn(): uint {
|
||||||
i := Color.(0, 0, 0, 0)
|
i := Color.(0, 0, 0, 0)
|
||||||
i += .(1, 1, 1, 1)
|
i += .(1, 1, 1, 1)
|
||||||
if i.r + i.g + i.b + i.a != 4 {
|
if i.r + i.g + i.b + i.a != 4 return 1008
|
||||||
return 1008
|
|
||||||
}
|
if Point.(1, 1) != Point.(1, 1) return 1009
|
||||||
|
if Point.(1, 2) == Point.(1, 1) return 1010
|
||||||
|
if Point.(1, 2) < Point.(1, 1) return 1011
|
||||||
|
if Point.(1, 1) > Point.(2, 1) return 1012
|
||||||
|
|
||||||
a := Point.(1, 2)
|
a := Point.(1, 2)
|
||||||
b := Point.(3, 4)
|
b := Point.(3, 4)
|
||||||
|
|
|
@ -193,6 +193,10 @@ impl TokenKind {
|
||||||
matches!(self, S::Eq | S::Ne | S::Bor | S::Xor | S::Band | S::Add | S::Mul)
|
matches!(self, S::Eq | S::Ne | S::Bor | S::Xor | S::Band | S::Add | S::Mul)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn is_compatison(self) -> bool {
|
||||||
|
matches!(self, Self::Lt | Self::Gt | Self::Ge | Self::Le | Self::Ne | Self::Eq)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn is_supported_float_op(self) -> bool {
|
pub fn is_supported_float_op(self) -> bool {
|
||||||
matches!(
|
matches!(
|
||||||
self,
|
self,
|
||||||
|
|
|
@ -386,10 +386,10 @@ pub mod ty {
|
||||||
pub const DINT: Self = Self::UINT;
|
pub const DINT: Self = Self::UINT;
|
||||||
|
|
||||||
pub fn bin_ret(self, op: TokenKind) -> Id {
|
pub fn bin_ret(self, op: TokenKind) -> Id {
|
||||||
use TokenKind as T;
|
if op.is_compatison() {
|
||||||
match op {
|
Self::BOOL
|
||||||
T::Lt | T::Gt | T::Le | T::Ge | T::Ne | T::Eq => Id::BOOL,
|
} else {
|
||||||
_ => self,
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3066,15 +3066,7 @@ impl<'a> Codegen<'a> {
|
||||||
self.strip_var(&mut rhs);
|
self.strip_var(&mut rhs);
|
||||||
self.implicit_unwrap(right.pos(), &mut rhs);
|
self.implicit_unwrap(right.pos(), &mut rhs);
|
||||||
let (ty, aclass) = self.binop_ty(pos, &mut lhs, &mut rhs, op);
|
let (ty, aclass) = self.binop_ty(pos, &mut lhs, &mut rhs, op);
|
||||||
if matches!(
|
if op.is_compatison() {
|
||||||
op,
|
|
||||||
TokenKind::Lt
|
|
||||||
| TokenKind::Gt
|
|
||||||
| TokenKind::Ge
|
|
||||||
| TokenKind::Le
|
|
||||||
| TokenKind::Ne
|
|
||||||
| TokenKind::Eq
|
|
||||||
) {
|
|
||||||
if lhs.ty.is_float() {
|
if lhs.ty.is_float() {
|
||||||
} else {
|
} else {
|
||||||
self.ci.nodes.lock(rhs.id);
|
self.ci.nodes.lock(rhs.id);
|
||||||
|
@ -3109,6 +3101,22 @@ impl<'a> Codegen<'a> {
|
||||||
self.struct_op(left.pos(), op, s, dst, lhs.id, rhs.id);
|
self.struct_op(left.pos(), op, s, dst, lhs.id, rhs.id);
|
||||||
Some(Value::ptr(dst).ty(lhs.ty))
|
Some(Value::ptr(dst).ty(lhs.ty))
|
||||||
}
|
}
|
||||||
|
ty::Kind::Struct(s) if op.is_compatison() => {
|
||||||
|
let binding_op = match op {
|
||||||
|
TokenKind::Eq => TokenKind::Band,
|
||||||
|
_ => TokenKind::Bor,
|
||||||
|
};
|
||||||
|
|
||||||
|
self.ci.nodes.lock(lhs.id);
|
||||||
|
let rhs = self.raw_expr_ctx(right, Ctx::default().with_ty(lhs.ty));
|
||||||
|
self.ci.nodes.unlock(lhs.id);
|
||||||
|
let mut rhs = rhs?;
|
||||||
|
self.strip_var(&mut rhs);
|
||||||
|
self.assert_ty(pos, &mut rhs, lhs.ty, "struct operand");
|
||||||
|
|
||||||
|
self.struct_fold_op(left.pos(), op, binding_op, s, lhs.id, rhs.id)
|
||||||
|
.or(Value::NEVER)
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
self.report(
|
self.report(
|
||||||
pos,
|
pos,
|
||||||
|
@ -4149,6 +4157,67 @@ impl<'a> Codegen<'a> {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn struct_fold_op(
|
||||||
|
&mut self,
|
||||||
|
pos: Pos,
|
||||||
|
op: TokenKind,
|
||||||
|
fold_op: TokenKind,
|
||||||
|
s: ty::Struct,
|
||||||
|
lhs: Nid,
|
||||||
|
rhs: Nid,
|
||||||
|
) -> Option<Value> {
|
||||||
|
debug_assert!(op.is_compatison());
|
||||||
|
|
||||||
|
let mut fold = None;
|
||||||
|
let mut offs = OffsetIter::new(s, self.tys);
|
||||||
|
while let Some((ty, off)) = offs.next_ty(self.tys) {
|
||||||
|
let lhs = self.offset(lhs, off);
|
||||||
|
let rhs = self.offset(rhs, off);
|
||||||
|
let vl = match ty.expand() {
|
||||||
|
_ if ty.is_pointer() || ty.is_integer() || ty == ty::Id::BOOL => {
|
||||||
|
let lhs = self.load_mem(lhs, ty);
|
||||||
|
let rhs = self.load_mem(rhs, ty);
|
||||||
|
self.ci.nodes.new_node(
|
||||||
|
ty::Id::BOOL,
|
||||||
|
Kind::BinOp { op },
|
||||||
|
[VOID, lhs, rhs],
|
||||||
|
self.tys,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
ty::Kind::Struct(is) => match self.struct_fold_op(pos, op, fold_op, is, lhs, rhs) {
|
||||||
|
Some(v) => v.id,
|
||||||
|
None => {
|
||||||
|
self.report(
|
||||||
|
pos,
|
||||||
|
fa!("...when appliing '{0} {op} {0}'", self.ty_display(s.into())),
|
||||||
|
);
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_ => {
|
||||||
|
self.report(pos, fa!("'{0} {op} {0}' is not supported", self.ty_display(ty)));
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
fold = Some(match fold {
|
||||||
|
None => vl,
|
||||||
|
Some(o) => self.ci.nodes.new_node(
|
||||||
|
ty::Id::BOOL,
|
||||||
|
Kind::BinOp { op: fold_op },
|
||||||
|
[VOID, o, vl],
|
||||||
|
self.tys,
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
match op {
|
||||||
|
_ if let Some(fold) = fold => Some(Value::new(fold).ty(ty::Id::BOOL)),
|
||||||
|
TokenKind::Eq => Some(self.ci.nodes.new_const_lit(ty::Id::BOOL, true)),
|
||||||
|
_ => Some(self.ci.nodes.new_const_lit(ty::Id::BOOL, false)),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn compute_signature(&mut self, func: &mut ty::Func, pos: Pos, args: &[Expr]) -> Option<Sig> {
|
fn compute_signature(&mut self, func: &mut ty::Func, pos: Pos, args: &[Expr]) -> Option<Sig> {
|
||||||
let Func { file, expr, sig, .. } = self.tys.ins.funcs[*func];
|
let Func { file, expr, sig, .. } = self.tys.ins.funcs[*func];
|
||||||
let fast = self.files[file.index()].clone();
|
let fast = self.files[file.index()].clone();
|
||||||
|
|
|
@ -301,10 +301,10 @@ impl HbvmBackend {
|
||||||
let bundle_count = self.ralloc.bundles.len() + (reg_offset as usize);
|
let bundle_count = self.ralloc.bundles.len() + (reg_offset as usize);
|
||||||
(
|
(
|
||||||
if tail {
|
if tail {
|
||||||
|
bundle_count.saturating_sub(reg::RET_ADDR as _)
|
||||||
|
} else {
|
||||||
assert!(bundle_count < reg::STACK_PTR as usize, "TODO: spill memory");
|
assert!(bundle_count < reg::STACK_PTR as usize, "TODO: spill memory");
|
||||||
self.ralloc.bundles.len()
|
self.ralloc.bundles.len()
|
||||||
} else {
|
|
||||||
bundle_count.saturating_sub(reg::RET_ADDR as _)
|
|
||||||
},
|
},
|
||||||
tail,
|
tail,
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -32d
|
ADDI64 r254, r254, -24d
|
||||||
ST r31, r254, 0a, 32h
|
ST r31, r254, 0a, 24h
|
||||||
LI32 r32, 1148846080w
|
LI32 r32, 1148846080w
|
||||||
CP r2, r32
|
CP r2, r32
|
||||||
JAL r31, r0, :sin
|
JAL r31, r0, :sin
|
||||||
|
@ -8,12 +8,10 @@ main:
|
||||||
FMUL32 r32, r33, r32
|
FMUL32 r32, r33, r32
|
||||||
FTI32 r32, r32, 1b
|
FTI32 r32, r32, 1b
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 0a, 32h
|
LD r31, r254, 0a, 24h
|
||||||
ADDI64 r254, r254, 32d
|
ADDI64 r254, r254, 24d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
sin:
|
sin:
|
||||||
ADDI64 r254, r254, -56d
|
|
||||||
ST r32, r254, 0a, 56h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
LI32 r14, 1124073472w
|
LI32 r14, 1124073472w
|
||||||
LI32 r15, 1078530011w
|
LI32 r15, 1078530011w
|
||||||
|
@ -44,9 +42,7 @@ sin:
|
||||||
FMUL32 r13, r14, r13
|
FMUL32 r13, r14, r13
|
||||||
FADD32 r13, r15, r13
|
FADD32 r13, r15, r13
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 56h
|
|
||||||
ADDI64 r254, r254, 56d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 1363
|
code size: 1315
|
||||||
ret: 826
|
ret: 826
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -64d
|
ADDI64 r254, r254, -56d
|
||||||
ST r31, r254, 24a, 40h
|
ST r31, r254, 24a, 32h
|
||||||
LI64 r32, 1d
|
LI64 r32, 1d
|
||||||
ADDI64 r33, r254, 0d
|
ADDI64 r33, r254, 0d
|
||||||
ST r32, r254, 0a, 8h
|
ST r32, r254, 0a, 8h
|
||||||
|
@ -13,12 +13,10 @@ main:
|
||||||
CP r33, r1
|
CP r33, r1
|
||||||
ADD64 r32, r33, r32
|
ADD64 r32, r33, r32
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 24a, 40h
|
LD r31, r254, 24a, 32h
|
||||||
ADDI64 r254, r254, 64d
|
ADDI64 r254, r254, 56d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
pass:
|
pass:
|
||||||
ADDI64 r254, r254, -32d
|
|
||||||
ST r32, r254, 0a, 32h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
LD r14, r13, 8a, 8h
|
LD r14, r13, 8a, 8h
|
||||||
MULI64 r15, r14, 8d
|
MULI64 r15, r14, 8d
|
||||||
|
@ -28,9 +26,7 @@ pass:
|
||||||
LD r13, r13, 0a, 8h
|
LD r13, r13, 0a, 8h
|
||||||
ADD64 r13, r13, r14
|
ADD64 r13, r13, r14
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 32h
|
|
||||||
ADDI64 r254, r254, 32d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 294
|
code size: 246
|
||||||
ret: 8
|
ret: 8
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
LRA r13, r0, :SIN_TABLE
|
LRA r13, r0, :SIN_TABLE
|
||||||
LD r13, r13, 80a, 8h
|
LD r13, r13, 80a, 8h
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 818
|
code size: 770
|
||||||
ret: 1736
|
ret: 1736
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -16d
|
|
||||||
ST r32, r254, 0a, 16h
|
|
||||||
CP r14, r2
|
CP r14, r2
|
||||||
LI64 r13, 1d
|
LI64 r13, 1d
|
||||||
JNE r14, r13, :0
|
JNE r14, r13, :0
|
||||||
|
@ -10,9 +8,7 @@ main:
|
||||||
JMP :1
|
JMP :1
|
||||||
2: LI64 r13, 3d
|
2: LI64 r13, 3d
|
||||||
1: CP r1, r13
|
1: CP r1, r13
|
||||||
LD r32, r254, 0a, 16h
|
|
||||||
ADDI64 r254, r254, 16d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 123
|
code size: 75
|
||||||
ret: 2
|
ret: 2
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -32d
|
ADDI64 r254, r254, -24d
|
||||||
ST r31, r254, 0a, 32h
|
ST r31, r254, 0a, 24h
|
||||||
LRA r32, r0, :"abඞ\n\r\t56789\0"
|
LRA r32, r0, :"abඞ\n\r\t56789\0"
|
||||||
CP r2, r32
|
CP r2, r32
|
||||||
JAL r31, r0, :str_len
|
JAL r31, r0, :str_len
|
||||||
|
@ -11,12 +11,10 @@ main:
|
||||||
CP r33, r1
|
CP r33, r1
|
||||||
ADD64 r32, r33, r32
|
ADD64 r32, r33, r32
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 0a, 32h
|
LD r31, r254, 0a, 24h
|
||||||
ADDI64 r254, r254, 32d
|
ADDI64 r254, r254, 24d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
str_len:
|
str_len:
|
||||||
ADDI64 r254, r254, -32d
|
|
||||||
ST r32, r254, 0a, 32h
|
|
||||||
CP r15, r2
|
CP r15, r2
|
||||||
CP r14, r0
|
CP r14, r0
|
||||||
CP r13, r14
|
CP r13, r14
|
||||||
|
@ -28,9 +26,7 @@ str_len:
|
||||||
0: ADDI64 r15, r15, 1d
|
0: ADDI64 r15, r15, 1d
|
||||||
ADDI64 r13, r13, 1d
|
ADDI64 r13, r13, 1d
|
||||||
JMP :2
|
JMP :2
|
||||||
1: LD r32, r254, 0a, 32h
|
1: JALA r0, r31, 0a
|
||||||
ADDI64 r254, r254, 32d
|
code size: 216
|
||||||
JALA r0, r31, 0a
|
|
||||||
code size: 264
|
|
||||||
ret: 16
|
ret: 16
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
foo:
|
foo:
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -16d
|
ADDI64 r254, r254, -8d
|
||||||
ST r31, r254, 0a, 16h
|
ST r31, r254, 0a, 8h
|
||||||
JAL r31, r0, :foo
|
JAL r31, r0, :foo
|
||||||
CP r1, r0
|
CP r1, r0
|
||||||
LD r31, r254, 0a, 16h
|
LD r31, r254, 0a, 8h
|
||||||
ADDI64 r254, r254, 16d
|
ADDI64 r254, r254, 8d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 88
|
code size: 88
|
||||||
ret: 0
|
ret: 0
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
LRA r13, r0, :a
|
LRA r13, r0, :a
|
||||||
LD r13, r13, 0a, 8h
|
LD r13, r13, 0a, 8h
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 98
|
code size: 50
|
||||||
ret: 50
|
ret: 50
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
LRA r13, r0, :a
|
LRA r13, r0, :a
|
||||||
LD r13, r13, 0a, 8h
|
LD r13, r13, 0a, 8h
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 98
|
code size: 50
|
||||||
ret: 50
|
ret: 50
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -2,8 +2,8 @@ cond:
|
||||||
CP r1, r0
|
CP r1, r0
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -32d
|
ADDI64 r254, r254, -24d
|
||||||
ST r31, r254, 0a, 32h
|
ST r31, r254, 0a, 24h
|
||||||
JAL r31, r0, :cond
|
JAL r31, r0, :cond
|
||||||
CP r33, r1
|
CP r33, r1
|
||||||
CP r32, r0
|
CP r32, r0
|
||||||
|
@ -11,8 +11,8 @@ main:
|
||||||
JMP :1
|
JMP :1
|
||||||
0: LI64 r32, 2d
|
0: LI64 r32, 2d
|
||||||
1: CP r1, r32
|
1: CP r1, r32
|
||||||
LD r31, r254, 0a, 32h
|
LD r31, r254, 0a, 24h
|
||||||
ADDI64 r254, r254, 32d
|
ADDI64 r254, r254, 24d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 117
|
code size: 117
|
||||||
ret: 0
|
ret: 0
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
LI32 r13, 69w
|
LI32 r13, 69w
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 76
|
code size: 28
|
||||||
ret: 69
|
ret: 69
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -152d
|
ADDI64 r254, r254, -144d
|
||||||
ST r31, r254, 80a, 72h
|
ST r31, r254, 80a, 64h
|
||||||
LRA r32, r0, :glob_stru
|
LRA r32, r0, :glob_stru
|
||||||
JAL r31, r0, :new_stru
|
JAL r31, r0, :new_stru
|
||||||
ST r1, r32, 0a, 16h
|
ST r1, r32, 0a, 16h
|
||||||
|
@ -68,19 +68,17 @@ main:
|
||||||
ST r1, r34, 0a, 16h
|
ST r1, r34, 0a, 16h
|
||||||
ADD64 r32, r32, r35
|
ADD64 r32, r32, r35
|
||||||
JMP :8
|
JMP :8
|
||||||
1: LD r31, r254, 80a, 72h
|
1: LD r31, r254, 80a, 64h
|
||||||
ADDI64 r254, r254, 152d
|
ADDI64 r254, r254, 144d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
new_stru:
|
new_stru:
|
||||||
ADDI64 r254, r254, -24d
|
ADDI64 r254, r254, -16d
|
||||||
ST r32, r254, 16a, 8h
|
|
||||||
ADDI64 r13, r254, 0d
|
ADDI64 r13, r254, 0d
|
||||||
ST r0, r254, 0a, 8h
|
ST r0, r254, 0a, 8h
|
||||||
ST r0, r254, 8a, 8h
|
ST r0, r254, 8a, 8h
|
||||||
LD r1, r13, 0a, 16h
|
LD r1, r13, 0a, 16h
|
||||||
LD r32, r254, 16a, 8h
|
ADDI64 r254, r254, 16d
|
||||||
ADDI64 r254, r254, 24d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 791
|
code size: 765
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -36d
|
ADDI64 r254, r254, -12d
|
||||||
ST r32, r254, 12a, 24h
|
|
||||||
LI8 r13, 255b
|
LI8 r13, 255b
|
||||||
ST r13, r254, 0a, 1h
|
ST r13, r254, 0a, 1h
|
||||||
ST r0, r254, 1a, 1h
|
ST r0, r254, 1a, 1h
|
||||||
|
@ -23,9 +22,8 @@ main:
|
||||||
JMP :1
|
JMP :1
|
||||||
2: LI64 r13, 512d
|
2: LI64 r13, 512d
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
1: LD r32, r254, 12a, 24h
|
1: ADDI64 r254, r254, 12d
|
||||||
ADDI64 r254, r254, 36d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 261
|
code size: 235
|
||||||
ret: 512
|
ret: 512
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -48d
|
ADDI64 r254, r254, -16d
|
||||||
ST r32, r254, 16a, 32h
|
|
||||||
LI64 r13, 10d
|
LI64 r13, 10d
|
||||||
ADDI64 r14, r254, 0d
|
ADDI64 r14, r254, 0d
|
||||||
ST r13, r254, 0a, 8h
|
ST r13, r254, 0a, 8h
|
||||||
|
@ -15,10 +14,9 @@ main:
|
||||||
LD r3, r14, 0a, 16h
|
LD r3, r14, 0a, 16h
|
||||||
ECA
|
ECA
|
||||||
CP r1, r0
|
CP r1, r0
|
||||||
LD r32, r254, 16a, 32h
|
ADDI64 r254, r254, 16d
|
||||||
ADDI64 r254, r254, 48d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
ev: Ecall
|
ev: Ecall
|
||||||
code size: 180
|
code size: 154
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
continue_and_state_change:
|
continue_and_state_change:
|
||||||
ADDI64 r254, r254, -48d
|
|
||||||
ST r32, r254, 0a, 48h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
CP r15, r0
|
CP r15, r0
|
||||||
LI64 r16, 3d
|
LI64 r16, 3d
|
||||||
|
@ -18,12 +16,10 @@ continue_and_state_change:
|
||||||
JMP :5
|
JMP :5
|
||||||
4: ADDI64 r13, r13, 1d
|
4: ADDI64 r13, r13, 1d
|
||||||
3: JMP :6
|
3: JMP :6
|
||||||
5: LD r32, r254, 0a, 48h
|
5: JALA r0, r31, 0a
|
||||||
ADDI64 r254, r254, 48d
|
|
||||||
JALA r0, r31, 0a
|
|
||||||
infinite_loop:
|
infinite_loop:
|
||||||
ADDI64 r254, r254, -40d
|
ADDI64 r254, r254, -32d
|
||||||
ST r31, r254, 0a, 40h
|
ST r31, r254, 0a, 32h
|
||||||
LI64 r34, 1d
|
LI64 r34, 1d
|
||||||
CP r33, r0
|
CP r33, r0
|
||||||
CP r32, r33
|
CP r32, r33
|
||||||
|
@ -33,12 +29,12 @@ infinite_loop:
|
||||||
JAL r31, r0, :continue_and_state_change
|
JAL r31, r0, :continue_and_state_change
|
||||||
CP r32, r1
|
CP r32, r1
|
||||||
JMP :1
|
JMP :1
|
||||||
LD r31, r254, 0a, 40h
|
LD r31, r254, 0a, 32h
|
||||||
ADDI64 r254, r254, 40d
|
ADDI64 r254, r254, 32d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -48d
|
ADDI64 r254, r254, -40d
|
||||||
ST r31, r254, 0a, 48h
|
ST r31, r254, 0a, 40h
|
||||||
CP r2, r0
|
CP r2, r0
|
||||||
JAL r31, r0, :multiple_breaks
|
JAL r31, r0, :multiple_breaks
|
||||||
CP r32, r1
|
CP r32, r1
|
||||||
|
@ -84,12 +80,10 @@ main:
|
||||||
JMP :1
|
JMP :1
|
||||||
6: JAL r31, r0, :infinite_loop
|
6: JAL r31, r0, :infinite_loop
|
||||||
CP r1, r0
|
CP r1, r0
|
||||||
1: LD r31, r254, 0a, 48h
|
1: LD r31, r254, 0a, 40h
|
||||||
ADDI64 r254, r254, 48d
|
ADDI64 r254, r254, 40d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
multiple_breaks:
|
multiple_breaks:
|
||||||
ADDI64 r254, r254, -24d
|
|
||||||
ST r32, r254, 0a, 24h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
LI64 r14, 3d
|
LI64 r14, 3d
|
||||||
LI64 r15, 10d
|
LI64 r15, 10d
|
||||||
|
@ -100,12 +94,8 @@ multiple_breaks:
|
||||||
1: CP r1, r13
|
1: CP r1, r13
|
||||||
JMP :3
|
JMP :3
|
||||||
2: JMP :4
|
2: JMP :4
|
||||||
3: LD r32, r254, 0a, 24h
|
3: JALA r0, r31, 0a
|
||||||
ADDI64 r254, r254, 24d
|
|
||||||
JALA r0, r31, 0a
|
|
||||||
state_change_in_break:
|
state_change_in_break:
|
||||||
ADDI64 r254, r254, -24d
|
|
||||||
ST r32, r254, 0a, 24h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
LI64 r14, 3d
|
LI64 r14, 3d
|
||||||
LI64 r15, 10d
|
LI64 r15, 10d
|
||||||
|
@ -117,10 +107,8 @@ state_change_in_break:
|
||||||
JMP :3
|
JMP :3
|
||||||
2: ADDI64 r13, r13, 1d
|
2: ADDI64 r13, r13, 1d
|
||||||
JMP :4
|
JMP :4
|
||||||
3: LD r32, r254, 0a, 24h
|
3: JALA r0, r31, 0a
|
||||||
ADDI64 r254, r254, 24d
|
|
||||||
JALA r0, r31, 0a
|
|
||||||
timed out
|
timed out
|
||||||
code size: 811
|
code size: 667
|
||||||
ret: 10
|
ret: 10
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
check_platform:
|
check_platform:
|
||||||
ADDI64 r254, r254, -24d
|
ADDI64 r254, r254, -16d
|
||||||
ST r31, r254, 0a, 24h
|
ST r31, r254, 0a, 16h
|
||||||
JAL r31, r0, :x86_fb_ptr
|
JAL r31, r0, :x86_fb_ptr
|
||||||
CP r32, r1
|
CP r32, r1
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 0a, 24h
|
LD r31, r254, 0a, 16h
|
||||||
ADDI64 r254, r254, 24d
|
ADDI64 r254, r254, 16d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -64d
|
ADDI64 r254, r254, -56d
|
||||||
ST r31, r254, 0a, 64h
|
ST r31, r254, 0a, 56h
|
||||||
JAL r31, r0, :check_platform
|
JAL r31, r0, :check_platform
|
||||||
CP r33, r0
|
CP r33, r0
|
||||||
LI64 r36, 30d
|
LI64 r36, 30d
|
||||||
|
@ -35,29 +35,21 @@ main:
|
||||||
0: ADDI64 r35, r35, 1d
|
0: ADDI64 r35, r35, 1d
|
||||||
ADDI64 r32, r32, 1d
|
ADDI64 r32, r32, 1d
|
||||||
4: JMP :5
|
4: JMP :5
|
||||||
2: LD r31, r254, 0a, 64h
|
2: LD r31, r254, 0a, 56h
|
||||||
ADDI64 r254, r254, 64d
|
ADDI64 r254, r254, 56d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
set_pixel:
|
set_pixel:
|
||||||
ADDI64 r254, r254, -24d
|
|
||||||
ST r32, r254, 0a, 24h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
CP r14, r3
|
CP r14, r3
|
||||||
CP r15, r4
|
CP r15, r4
|
||||||
MUL64 r14, r14, r15
|
MUL64 r14, r14, r15
|
||||||
ADD64 r13, r14, r13
|
ADD64 r13, r14, r13
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 24h
|
|
||||||
ADDI64 r254, r254, 24d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
x86_fb_ptr:
|
x86_fb_ptr:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
LI64 r13, 100d
|
LI64 r13, 100d
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 425
|
code size: 329
|
||||||
ret: 3000
|
ret: 3000
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
LI32 r13, 3212836864w
|
LI32 r13, 3212836864w
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 76
|
code size: 28
|
||||||
ret: 3212836864
|
ret: 3212836864
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,24 +1,16 @@
|
||||||
add_one:
|
add_one:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
ADDI64 r13, r13, 1d
|
ADDI64 r13, r13, 1d
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
add_two:
|
add_two:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
ADDI64 r13, r13, 2d
|
ADDI64 r13, r13, 2d
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -32d
|
ADDI64 r254, r254, -24d
|
||||||
ST r31, r254, 0a, 32h
|
ST r31, r254, 0a, 24h
|
||||||
LI64 r32, 10d
|
LI64 r32, 10d
|
||||||
CP r2, r32
|
CP r2, r32
|
||||||
JAL r31, r0, :add_one
|
JAL r31, r0, :add_one
|
||||||
|
@ -29,9 +21,9 @@ main:
|
||||||
CP r33, r1
|
CP r33, r1
|
||||||
ADD64 r32, r33, r32
|
ADD64 r32, r33, r32
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 0a, 32h
|
LD r31, r254, 0a, 24h
|
||||||
ADDI64 r254, r254, 32d
|
ADDI64 r254, r254, 24d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 272
|
code size: 176
|
||||||
ret: 33
|
ret: 33
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,26 +1,18 @@
|
||||||
add:
|
add:
|
||||||
ADDI64 r254, r254, -16d
|
|
||||||
ST r32, r254, 0a, 16h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
CP r14, r3
|
CP r14, r3
|
||||||
ADD64 r13, r13, r14
|
ADD64 r13, r13, r14
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 16h
|
|
||||||
ADDI64 r254, r254, 16d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
add:
|
add:
|
||||||
ADDI64 r254, r254, -16d
|
|
||||||
ST r32, r254, 0a, 16h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
CP r14, r3
|
CP r14, r3
|
||||||
ADD32 r13, r13, r14
|
ADD32 r13, r13, r14
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 16h
|
|
||||||
ADDI64 r254, r254, 16d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -40d
|
ADDI64 r254, r254, -32d
|
||||||
ST r31, r254, 0a, 40h
|
ST r31, r254, 0a, 32h
|
||||||
LI32 r32, 2w
|
LI32 r32, 2w
|
||||||
CP r2, r32
|
CP r2, r32
|
||||||
CP r3, r32
|
CP r3, r32
|
||||||
|
@ -35,9 +27,9 @@ main:
|
||||||
ANDI r32, r32, 4294967295d
|
ANDI r32, r32, 4294967295d
|
||||||
SUB64 r32, r32, r33
|
SUB64 r32, r32, r33
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 0a, 40h
|
LD r31, r254, 0a, 32h
|
||||||
ADDI64 r254, r254, 40d
|
ADDI64 r254, r254, 32d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 287
|
code size: 191
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -16d
|
ADDI64 r254, r254, -8d
|
||||||
ST r31, r254, 0a, 16h
|
ST r31, r254, 0a, 8h
|
||||||
JAL r31, r0, :process
|
JAL r31, r0, :process
|
||||||
LD r31, r254, 0a, 16h
|
LD r31, r254, 0a, 8h
|
||||||
ADDI64 r254, r254, 16d
|
ADDI64 r254, r254, 8d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
opaque:
|
opaque:
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
process:
|
process:
|
||||||
ADDI64 r254, r254, -56d
|
ADDI64 r254, r254, -48d
|
||||||
ST r31, r254, 16a, 40h
|
ST r31, r254, 16a, 32h
|
||||||
LI64 r32, 1000d
|
LI64 r32, 1000d
|
||||||
ADDI64 r33, r254, 0d
|
ADDI64 r33, r254, 0d
|
||||||
ST r0, r254, 0a, 1h
|
ST r0, r254, 0a, 1h
|
||||||
|
@ -23,8 +23,8 @@ process:
|
||||||
JMP :3
|
JMP :3
|
||||||
2: ADDI64 r32, r32, -1d
|
2: ADDI64 r32, r32, -1d
|
||||||
1: JMP :4
|
1: JMP :4
|
||||||
3: LD r31, r254, 16a, 40h
|
3: LD r31, r254, 16a, 32h
|
||||||
ADDI64 r254, r254, 56d
|
ADDI64 r254, r254, 48d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
timed out
|
timed out
|
||||||
code size: 248
|
code size: 248
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
deinit:
|
deinit:
|
||||||
ADDI64 r254, r254, -48d
|
ADDI64 r254, r254, -40d
|
||||||
ST r31, r254, 0a, 48h
|
ST r31, r254, 0a, 40h
|
||||||
CP r32, r2
|
CP r32, r2
|
||||||
LD r33, r32, 16a, 8h
|
LD r33, r32, 16a, 8h
|
||||||
LI64 r34, 8d
|
LI64 r34, 8d
|
||||||
|
@ -12,12 +12,10 @@ deinit:
|
||||||
JAL r31, r0, :free
|
JAL r31, r0, :free
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
JAL r31, r0, :new
|
JAL r31, r0, :new
|
||||||
LD r31, r254, 0a, 48h
|
LD r31, r254, 0a, 40h
|
||||||
ADDI64 r254, r254, 48d
|
ADDI64 r254, r254, 40d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
free:
|
free:
|
||||||
ADDI64 r254, r254, -32d
|
|
||||||
ST r32, r254, 0a, 32h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
CP r14, r3
|
CP r14, r3
|
||||||
CP r15, r4
|
CP r15, r4
|
||||||
|
@ -28,12 +26,10 @@ free:
|
||||||
CP r4, r14
|
CP r4, r14
|
||||||
CP r5, r15
|
CP r5, r15
|
||||||
ECA
|
ECA
|
||||||
LD r32, r254, 0a, 32h
|
|
||||||
ADDI64 r254, r254, 32d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -64d
|
ADDI64 r254, r254, -56d
|
||||||
ST r31, r254, 24a, 40h
|
ST r31, r254, 24a, 32h
|
||||||
ADDI64 r32, r254, 0d
|
ADDI64 r32, r254, 0d
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
JAL r31, r0, :new
|
JAL r31, r0, :new
|
||||||
|
@ -47,12 +43,10 @@ main:
|
||||||
CP r2, r32
|
CP r2, r32
|
||||||
JAL r31, r0, :deinit
|
JAL r31, r0, :deinit
|
||||||
CP r1, r33
|
CP r1, r33
|
||||||
LD r31, r254, 24a, 40h
|
LD r31, r254, 24a, 32h
|
||||||
ADDI64 r254, r254, 64d
|
ADDI64 r254, r254, 56d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
malloc:
|
malloc:
|
||||||
ADDI64 r254, r254, -24d
|
|
||||||
ST r32, r254, 0a, 24h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
CP r14, r3
|
CP r14, r3
|
||||||
LRA r15, r0, :MALLOC_SYS_CALL
|
LRA r15, r0, :MALLOC_SYS_CALL
|
||||||
|
@ -63,24 +57,20 @@ malloc:
|
||||||
ECA
|
ECA
|
||||||
CP r13, r1
|
CP r13, r1
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 24h
|
|
||||||
ADDI64 r254, r254, 24d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
new:
|
new:
|
||||||
ADDI64 r254, r254, -32d
|
ADDI64 r254, r254, -24d
|
||||||
ST r32, r254, 24a, 8h
|
|
||||||
CP r14, r1
|
CP r14, r1
|
||||||
ADDI64 r13, r254, 0d
|
ADDI64 r13, r254, 0d
|
||||||
ST r0, r254, 0a, 8h
|
ST r0, r254, 0a, 8h
|
||||||
ST r0, r254, 8a, 8h
|
ST r0, r254, 8a, 8h
|
||||||
ST r0, r254, 16a, 8h
|
ST r0, r254, 16a, 8h
|
||||||
BMC r13, r14, 24h
|
BMC r13, r14, 24h
|
||||||
LD r32, r254, 24a, 8h
|
ADDI64 r254, r254, 24d
|
||||||
ADDI64 r254, r254, 32d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
push:
|
push:
|
||||||
ADDI64 r254, r254, -112d
|
ADDI64 r254, r254, -104d
|
||||||
ST r31, r254, 0a, 112h
|
ST r31, r254, 0a, 104h
|
||||||
CP r38, r2
|
CP r38, r2
|
||||||
CP r39, r3
|
CP r39, r3
|
||||||
LI64 r37, 1d
|
LI64 r37, 1d
|
||||||
|
@ -132,9 +122,9 @@ push:
|
||||||
ADD64 r32, r32, r37
|
ADD64 r32, r32, r37
|
||||||
ST r32, r38, 8a, 8h
|
ST r32, r38, 8a, 8h
|
||||||
CP r1, r33
|
CP r1, r33
|
||||||
4: LD r31, r254, 0a, 112h
|
4: LD r31, r254, 0a, 104h
|
||||||
ADDI64 r254, r254, 112d
|
ADDI64 r254, r254, 104d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 1045
|
code size: 923
|
||||||
ret: 69
|
ret: 69
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,23 +1,19 @@
|
||||||
clobber:
|
clobber:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
LRA r13, r0, :var
|
LRA r13, r0, :var
|
||||||
ST r0, r13, 0a, 8h
|
ST r0, r13, 0a, 8h
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -32d
|
ADDI64 r254, r254, -24d
|
||||||
ST r31, r254, 0a, 32h
|
ST r31, r254, 0a, 24h
|
||||||
LRA r32, r0, :var
|
LRA r32, r0, :var
|
||||||
LI64 r33, 2d
|
LI64 r33, 2d
|
||||||
ST r33, r32, 0a, 8h
|
ST r33, r32, 0a, 8h
|
||||||
JAL r31, r0, :clobber
|
JAL r31, r0, :clobber
|
||||||
LD r32, r32, 0a, 8h
|
LD r32, r32, 0a, 8h
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 0a, 32h
|
LD r31, r254, 0a, 24h
|
||||||
ADDI64 r254, r254, 32d
|
ADDI64 r254, r254, 24d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 207
|
code size: 159
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -2,8 +2,8 @@ inb:
|
||||||
CP r1, r0
|
CP r1, r0
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -40d
|
ADDI64 r254, r254, -32d
|
||||||
ST r31, r254, 0a, 40h
|
ST r31, r254, 0a, 32h
|
||||||
LRA r32, r0, :ports
|
LRA r32, r0, :ports
|
||||||
LD r33, r32, 0a, 1h
|
LD r33, r32, 0a, 1h
|
||||||
ANDI r33, r33, 255d
|
ANDI r33, r33, 255d
|
||||||
|
@ -15,8 +15,8 @@ main:
|
||||||
CMPUI r34, r34, 0d
|
CMPUI r34, r34, 0d
|
||||||
NOT r34, r34
|
NOT r34, r34
|
||||||
ST r34, r32, 0a, 1h
|
ST r34, r32, 0a, 1h
|
||||||
1: LD r31, r254, 0a, 40h
|
1: LD r31, r254, 0a, 32h
|
||||||
ADDI64 r254, r254, 40d
|
ADDI64 r254, r254, 32d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 164
|
code size: 164
|
||||||
ret: 0
|
ret: 0
|
||||||
|
|
|
@ -1,14 +1,10 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -16d
|
|
||||||
ST r32, r254, 0a, 16h
|
|
||||||
LRA r13, r0, :complex_global_var
|
LRA r13, r0, :complex_global_var
|
||||||
LD r14, r13, 0a, 8h
|
LD r14, r13, 0a, 8h
|
||||||
ADDI64 r14, r14, 5d
|
ADDI64 r14, r14, 5d
|
||||||
ST r14, r13, 0a, 8h
|
ST r14, r13, 0a, 8h
|
||||||
CP r1, r14
|
CP r1, r14
|
||||||
LD r32, r254, 0a, 16h
|
|
||||||
ADDI64 r254, r254, 16d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 122
|
code size: 74
|
||||||
ret: 55
|
ret: 55
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -176d
|
ADDI64 r254, r254, -128d
|
||||||
ST r32, r254, 128a, 48h
|
|
||||||
LI8 r15, 69b
|
LI8 r15, 69b
|
||||||
LI64 r16, 128d
|
LI64 r16, 128d
|
||||||
CP r13, r0
|
CP r13, r0
|
||||||
|
@ -15,9 +14,8 @@ main:
|
||||||
ST r15, r13, 0a, 1h
|
ST r15, r13, 0a, 1h
|
||||||
CP r13, r14
|
CP r13, r14
|
||||||
JMP :2
|
JMP :2
|
||||||
1: LD r32, r254, 128a, 48h
|
1: ADDI64 r254, r254, 128d
|
||||||
ADDI64 r254, r254, 176d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 167
|
code size: 141
|
||||||
ret: 69
|
ret: 69
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
fib:
|
fib:
|
||||||
ADDI64 r254, r254, -40d
|
ADDI64 r254, r254, -32d
|
||||||
ST r31, r254, 0a, 40h
|
ST r31, r254, 0a, 32h
|
||||||
CP r32, r2
|
CP r32, r2
|
||||||
LI64 r33, 1d
|
LI64 r33, 1d
|
||||||
LI64 r34, 2d
|
LI64 r34, 2d
|
||||||
|
@ -17,19 +17,19 @@ fib:
|
||||||
CP r32, r1
|
CP r32, r1
|
||||||
ADD64 r32, r32, r33
|
ADD64 r32, r32, r33
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
1: LD r31, r254, 0a, 40h
|
1: LD r31, r254, 0a, 32h
|
||||||
ADDI64 r254, r254, 40d
|
ADDI64 r254, r254, 32d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -24d
|
ADDI64 r254, r254, -16d
|
||||||
ST r31, r254, 0a, 24h
|
ST r31, r254, 0a, 16h
|
||||||
LI64 r32, 10d
|
LI64 r32, 10d
|
||||||
CP r2, r32
|
CP r2, r32
|
||||||
JAL r31, r0, :fib
|
JAL r31, r0, :fib
|
||||||
CP r32, r1
|
CP r32, r1
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 0a, 24h
|
LD r31, r254, 0a, 16h
|
||||||
ADDI64 r254, r254, 24d
|
ADDI64 r254, r254, 16d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 229
|
code size: 229
|
||||||
ret: 55
|
ret: 55
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
CP r13, r0
|
CP r13, r0
|
||||||
0: ADDI64 r13, r13, 1d
|
0: ADDI64 r13, r13, 1d
|
||||||
JMP :0
|
JMP :0
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
timed out
|
timed out
|
||||||
code size: 86
|
code size: 38
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -16d
|
|
||||||
ST r32, r254, 0a, 16h
|
|
||||||
LI64 r13, 8d
|
LI64 r13, 8d
|
||||||
CP r2, r13
|
CP r2, r13
|
||||||
ECA
|
ECA
|
||||||
|
@ -17,9 +15,7 @@ main:
|
||||||
0: LI64 r13, 1d
|
0: LI64 r13, 1d
|
||||||
1: SUB64 r13, r13, r14
|
1: SUB64 r13, r13, r14
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 16h
|
|
||||||
ADDI64 r254, r254, 16d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 179
|
code size: 131
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -24d
|
ADDI64 r254, r254, -16d
|
||||||
ST r31, r254, 0a, 24h
|
ST r31, r254, 0a, 16h
|
||||||
JAL r31, r0, :scalar_values
|
JAL r31, r0, :scalar_values
|
||||||
CP r32, r1
|
CP r32, r1
|
||||||
JEQ r32, r0, :0
|
JEQ r32, r0, :0
|
||||||
|
@ -15,8 +15,8 @@ main:
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
JMP :1
|
JMP :1
|
||||||
2: CP r1, r0
|
2: CP r1, r0
|
||||||
1: LD r31, r254, 0a, 24h
|
1: LD r31, r254, 0a, 16h
|
||||||
ADDI64 r254, r254, 24d
|
ADDI64 r254, r254, 16d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
scalar_values:
|
scalar_values:
|
||||||
CP r1, r0
|
CP r1, r0
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
LI64 r13, 10d
|
LI64 r13, 10d
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 80
|
code size: 32
|
||||||
ret: 10
|
ret: 10
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -130d
|
ADDI64 r254, r254, -122d
|
||||||
ST r31, r254, 58a, 72h
|
ST r31, r254, 58a, 64h
|
||||||
ADDI64 r32, r254, 33d
|
ADDI64 r32, r254, 33d
|
||||||
ADDI64 r33, r254, 34d
|
ADDI64 r33, r254, 34d
|
||||||
ADDI64 r34, r254, 1d
|
ADDI64 r34, r254, 1d
|
||||||
|
@ -22,12 +22,11 @@ main:
|
||||||
LD r5, r34, 0a, 16h
|
LD r5, r34, 0a, 16h
|
||||||
LD r7, r37, 0a, 1h
|
LD r7, r37, 0a, 1h
|
||||||
JAL r31, r0, :put_filled_rect
|
JAL r31, r0, :put_filled_rect
|
||||||
LD r31, r254, 58a, 72h
|
LD r31, r254, 58a, 64h
|
||||||
ADDI64 r254, r254, 130d
|
ADDI64 r254, r254, 122d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
put_filled_rect:
|
put_filled_rect:
|
||||||
ADDI64 r254, r254, -236d
|
ADDI64 r254, r254, -108d
|
||||||
ST r32, r254, 108a, 128h
|
|
||||||
CP r14, r2
|
CP r14, r2
|
||||||
ST r3, r254, 92a, 16h
|
ST r3, r254, 92a, 16h
|
||||||
ADDI64 r3, r254, 92d
|
ADDI64 r3, r254, 92d
|
||||||
|
@ -98,9 +97,8 @@ put_filled_rect:
|
||||||
ADD64 r14, r27, r14
|
ADD64 r14, r27, r14
|
||||||
SUB64 r13, r13, r18
|
SUB64 r13, r13, r18
|
||||||
JMP :3
|
JMP :3
|
||||||
2: LD r32, r254, 108a, 128h
|
2: ADDI64 r254, r254, 108d
|
||||||
ADDI64 r254, r254, 236d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 901
|
code size: 875
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -56d
|
ADDI64 r254, r254, -48d
|
||||||
ST r31, r254, 16a, 40h
|
ST r31, r254, 16a, 32h
|
||||||
ADDI64 r32, r254, 0d
|
ADDI64 r32, r254, 0d
|
||||||
ADDI64 r33, r254, 8d
|
ADDI64 r33, r254, 8d
|
||||||
ST r0, r254, 0a, 8h
|
ST r0, r254, 0a, 8h
|
||||||
|
@ -13,17 +13,13 @@ main:
|
||||||
CP r32, r1
|
CP r32, r1
|
||||||
ANDI r32, r32, 4294967295d
|
ANDI r32, r32, 4294967295d
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 16a, 40h
|
LD r31, r254, 16a, 32h
|
||||||
ADDI64 r254, r254, 56d
|
ADDI64 r254, r254, 48d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
set:
|
set:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
CP r13, r4
|
CP r13, r4
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 223
|
code size: 175
|
||||||
ret: 1024
|
ret: 1024
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
integer_range:
|
integer_range:
|
||||||
ADDI64 r254, r254, -32d
|
|
||||||
ST r32, r254, 0a, 32h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
CP r14, r3
|
CP r14, r3
|
||||||
LI64 r15, 4d
|
LI64 r15, 4d
|
||||||
|
@ -14,19 +12,17 @@ integer_range:
|
||||||
DIRU64 r0, r14, r15, r14
|
DIRU64 r0, r14, r15, r14
|
||||||
ADD64 r13, r14, r13
|
ADD64 r13, r14, r13
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 32h
|
|
||||||
ADDI64 r254, r254, 32d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -24d
|
ADDI64 r254, r254, -16d
|
||||||
ST r31, r254, 0a, 24h
|
ST r31, r254, 0a, 16h
|
||||||
LI64 r32, 1000d
|
LI64 r32, 1000d
|
||||||
CP r2, r0
|
CP r2, r0
|
||||||
CP r3, r32
|
CP r3, r32
|
||||||
JAL r31, r0, :integer_range
|
JAL r31, r0, :integer_range
|
||||||
LD r31, r254, 0a, 24h
|
LD r31, r254, 0a, 16h
|
||||||
ADDI64 r254, r254, 24d
|
ADDI64 r254, r254, 16d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 212
|
code size: 164
|
||||||
ret: 42
|
ret: 42
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -16d
|
ADDI64 r254, r254, -8d
|
||||||
ST r32, r254, 8a, 8h
|
|
||||||
LI64 r13, 10d
|
LI64 r13, 10d
|
||||||
ST r13, r254, 0a, 8h
|
ST r13, r254, 0a, 8h
|
||||||
2: LD r13, r254, 0a, 8h
|
2: LD r13, r254, 0a, 8h
|
||||||
|
@ -10,9 +9,8 @@ main:
|
||||||
0: ADDI64 r13, r13, -1d
|
0: ADDI64 r13, r13, -1d
|
||||||
ST r13, r254, 0a, 8h
|
ST r13, r254, 0a, 8h
|
||||||
JMP :2
|
JMP :2
|
||||||
1: LD r32, r254, 8a, 8h
|
1: ADDI64 r254, r254, 8d
|
||||||
ADDI64 r254, r254, 16d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 145
|
code size: 119
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
fib:
|
fib:
|
||||||
ADDI64 r254, r254, -40d
|
|
||||||
ST r32, r254, 0a, 40h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
LI64 r17, 1d
|
LI64 r17, 1d
|
||||||
CP r15, r0
|
CP r15, r0
|
||||||
|
@ -13,20 +11,18 @@ fib:
|
||||||
SUB64 r13, r13, r17
|
SUB64 r13, r13, r17
|
||||||
SWA r14, r16
|
SWA r14, r16
|
||||||
JMP :2
|
JMP :2
|
||||||
1: LD r32, r254, 0a, 40h
|
1: JALA r0, r31, 0a
|
||||||
ADDI64 r254, r254, 40d
|
|
||||||
JALA r0, r31, 0a
|
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -24d
|
ADDI64 r254, r254, -16d
|
||||||
ST r31, r254, 0a, 24h
|
ST r31, r254, 0a, 16h
|
||||||
LI64 r32, 10d
|
LI64 r32, 10d
|
||||||
CP r2, r32
|
CP r2, r32
|
||||||
JAL r31, r0, :fib
|
JAL r31, r0, :fib
|
||||||
CP r32, r1
|
CP r32, r1
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 0a, 24h
|
LD r31, r254, 0a, 16h
|
||||||
ADDI64 r254, r254, 24d
|
ADDI64 r254, r254, 16d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 203
|
code size: 155
|
||||||
ret: 55
|
ret: 55
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
LI64 r13, 1d
|
LI64 r13, 1d
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 80
|
code size: 32
|
||||||
ret: 1
|
ret: 1
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
decide:
|
decide:
|
||||||
ADDI64 r254, r254, -40d
|
ADDI64 r254, r254, -24d
|
||||||
ST r32, r254, 24a, 16h
|
|
||||||
CP r14, r2
|
CP r14, r2
|
||||||
CP r15, r1
|
CP r15, r1
|
||||||
ADDI64 r13, r254, 0d
|
ADDI64 r13, r254, 0d
|
||||||
|
@ -8,12 +7,11 @@ decide:
|
||||||
ST r0, r254, 8a, 8h
|
ST r0, r254, 8a, 8h
|
||||||
ST r0, r254, 16a, 8h
|
ST r0, r254, 16a, 8h
|
||||||
BMC r13, r15, 24h
|
BMC r13, r15, 24h
|
||||||
LD r32, r254, 24a, 16h
|
ADDI64 r254, r254, 24d
|
||||||
ADDI64 r254, r254, 40d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -128d
|
ADDI64 r254, r254, -120d
|
||||||
ST r31, r254, 72a, 56h
|
ST r31, r254, 72a, 48h
|
||||||
ADDI64 r32, r254, 48d
|
ADDI64 r32, r254, 48d
|
||||||
CP r2, r0
|
CP r2, r0
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
|
@ -30,9 +28,9 @@ main:
|
||||||
LD r33, r254, 0a, 8h
|
LD r33, r254, 0a, 8h
|
||||||
ADD64 r32, r33, r32
|
ADD64 r32, r33, r32
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 72a, 56h
|
LD r31, r254, 72a, 48h
|
||||||
ADDI64 r254, r254, 128d
|
ADDI64 r254, r254, 120d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 299
|
code size: 273
|
||||||
ret: 1
|
ret: 1
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -32d
|
ADDI64 r254, r254, -24d
|
||||||
ST r31, r254, 0a, 32h
|
ST r31, r254, 0a, 24h
|
||||||
JAL r31, r0, :opaque
|
JAL r31, r0, :opaque
|
||||||
CP r33, r1
|
CP r33, r1
|
||||||
JAL r31, r0, :opaque
|
JAL r31, r0, :opaque
|
||||||
|
@ -12,8 +12,8 @@ main:
|
||||||
LD r32, r33, 0a, 8h
|
LD r32, r33, 0a, 8h
|
||||||
JMP :2
|
JMP :2
|
||||||
2: CP r1, r32
|
2: CP r1, r32
|
||||||
LD r31, r254, 0a, 32h
|
LD r31, r254, 0a, 24h
|
||||||
ADDI64 r254, r254, 32d
|
ADDI64 r254, r254, 24d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
opaque:
|
opaque:
|
||||||
CP r1, r0
|
CP r1, r0
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -38d
|
ADDI64 r254, r254, -30d
|
||||||
ST r31, r254, 6a, 32h
|
ST r31, r254, 6a, 24h
|
||||||
ADDI64 r32, r254, 0d
|
ADDI64 r32, r254, 0d
|
||||||
2: JAL r31, r0, :return_fn
|
2: JAL r31, r0, :return_fn
|
||||||
ST r1, r32, 0a, 6h
|
ST r1, r32, 0a, 6h
|
||||||
|
@ -11,12 +11,11 @@ main:
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
JMP :1
|
JMP :1
|
||||||
0: JMP :2
|
0: JMP :2
|
||||||
1: LD r31, r254, 6a, 32h
|
1: LD r31, r254, 6a, 24h
|
||||||
ADDI64 r254, r254, 38d
|
ADDI64 r254, r254, 30d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
return_fn:
|
return_fn:
|
||||||
ADDI64 r254, r254, -22d
|
ADDI64 r254, r254, -6d
|
||||||
ST r32, r254, 6a, 16h
|
|
||||||
LI8 r13, 1b
|
LI8 r13, 1b
|
||||||
ADDI64 r14, r254, 0d
|
ADDI64 r14, r254, 0d
|
||||||
ST r13, r254, 0a, 1h
|
ST r13, r254, 0a, 1h
|
||||||
|
@ -26,9 +25,8 @@ return_fn:
|
||||||
ST r0, r254, 4a, 1h
|
ST r0, r254, 4a, 1h
|
||||||
ST r0, r254, 5a, 1h
|
ST r0, r254, 5a, 1h
|
||||||
LD r1, r14, 0a, 6h
|
LD r1, r14, 0a, 6h
|
||||||
LD r32, r254, 6a, 16h
|
ADDI64 r254, r254, 6d
|
||||||
ADDI64 r254, r254, 22d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 314
|
code size: 288
|
||||||
ret: 1
|
ret: 1
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
foo:
|
foo:
|
||||||
ADDI64 r254, r254, -120d
|
ADDI64 r254, r254, -112d
|
||||||
ST r31, r254, 80a, 40h
|
ST r31, r254, 80a, 32h
|
||||||
ADDI64 r32, r254, 64d
|
ADDI64 r32, r254, 64d
|
||||||
LRA r33, r0, :some_file
|
LRA r33, r0, :some_file
|
||||||
CP r3, r33
|
CP r3, r33
|
||||||
|
@ -34,12 +34,11 @@ foo:
|
||||||
3: ADDI64 r32, r254, 0d
|
3: ADDI64 r32, r254, 0d
|
||||||
ST r0, r254, 0a, 1h
|
ST r0, r254, 0a, 1h
|
||||||
LD r1, r32, 0a, 16h
|
LD r1, r32, 0a, 16h
|
||||||
1: LD r31, r254, 80a, 40h
|
1: LD r31, r254, 80a, 32h
|
||||||
ADDI64 r254, r254, 120d
|
ADDI64 r254, r254, 112d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
get:
|
get:
|
||||||
ADDI64 r254, r254, -56d
|
ADDI64 r254, r254, -32d
|
||||||
ST r32, r254, 32a, 24h
|
|
||||||
CP r13, r3
|
CP r13, r3
|
||||||
LD r13, r13, 0a, 1h
|
LD r13, r13, 0a, 1h
|
||||||
LRA r14, r0, :MAGIC
|
LRA r14, r0, :MAGIC
|
||||||
|
@ -55,12 +54,11 @@ get:
|
||||||
0: ADDI64 r13, r254, 0d
|
0: ADDI64 r13, r254, 0d
|
||||||
ST r0, r254, 0a, 1h
|
ST r0, r254, 0a, 1h
|
||||||
LD r1, r13, 0a, 16h
|
LD r1, r13, 0a, 16h
|
||||||
1: LD r32, r254, 32a, 24h
|
1: ADDI64 r254, r254, 32d
|
||||||
ADDI64 r254, r254, 56d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -48d
|
ADDI64 r254, r254, -40d
|
||||||
ST r31, r254, 16a, 32h
|
ST r31, r254, 16a, 24h
|
||||||
ADDI64 r32, r254, 0d
|
ADDI64 r32, r254, 0d
|
||||||
JAL r31, r0, :foo
|
JAL r31, r0, :foo
|
||||||
ST r1, r32, 0a, 16h
|
ST r1, r32, 0a, 16h
|
||||||
|
@ -72,9 +70,9 @@ main:
|
||||||
JMP :1
|
JMP :1
|
||||||
0: LD r32, r254, 8a, 8h
|
0: LD r32, r254, 8a, 8h
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
1: LD r31, r254, 16a, 32h
|
1: LD r31, r254, 16a, 24h
|
||||||
ADDI64 r254, r254, 48d
|
ADDI64 r254, r254, 40d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 765
|
code size: 739
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -2,8 +2,8 @@ get_ptr:
|
||||||
CP r1, r0
|
CP r1, r0
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -40d
|
ADDI64 r254, r254, -32d
|
||||||
ST r31, r254, 0a, 40h
|
ST r31, r254, 0a, 32h
|
||||||
JAL r31, r0, :get_ptr
|
JAL r31, r0, :get_ptr
|
||||||
CP r32, r1
|
CP r32, r1
|
||||||
JNE r32, r0, :0
|
JNE r32, r0, :0
|
||||||
|
@ -16,8 +16,8 @@ main:
|
||||||
ST r34, r32, 0a, 8h
|
ST r34, r32, 0a, 8h
|
||||||
JMP :3
|
JMP :3
|
||||||
2: CP r1, r34
|
2: CP r1, r34
|
||||||
1: LD r31, r254, 0a, 40h
|
1: LD r31, r254, 0a, 32h
|
||||||
ADDI64 r254, r254, 40d
|
ADDI64 r254, r254, 32d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 164
|
code size: 164
|
||||||
ret: 0
|
ret: 0
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -74d
|
ADDI64 r254, r254, -66d
|
||||||
ST r31, r254, 26a, 48h
|
ST r31, r254, 26a, 40h
|
||||||
JAL r31, r0, :returner_fn
|
JAL r31, r0, :returner_fn
|
||||||
CP r32, r1
|
CP r32, r1
|
||||||
ADDI64 r33, r254, 2d
|
ADDI64 r33, r254, 2d
|
||||||
|
@ -25,12 +25,11 @@ main:
|
||||||
JMP :1
|
JMP :1
|
||||||
0: LI64 r32, 1d
|
0: LI64 r32, 1d
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
1: LD r31, r254, 26a, 48h
|
1: LD r31, r254, 26a, 40h
|
||||||
ADDI64 r254, r254, 74d
|
ADDI64 r254, r254, 66d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
returner_bn:
|
returner_bn:
|
||||||
ADDI64 r254, r254, -40d
|
ADDI64 r254, r254, -24d
|
||||||
ST r32, r254, 24a, 16h
|
|
||||||
CP r15, r1
|
CP r15, r1
|
||||||
LI8 r14, 1b
|
LI8 r14, 1b
|
||||||
ADDI64 r13, r254, 0d
|
ADDI64 r13, r254, 0d
|
||||||
|
@ -38,29 +37,22 @@ returner_bn:
|
||||||
ST r0, r254, 8a, 8h
|
ST r0, r254, 8a, 8h
|
||||||
ST r0, r254, 16a, 8h
|
ST r0, r254, 16a, 8h
|
||||||
BMC r13, r15, 24h
|
BMC r13, r15, 24h
|
||||||
LD r32, r254, 24a, 16h
|
ADDI64 r254, r254, 24d
|
||||||
ADDI64 r254, r254, 40d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
returner_cn:
|
returner_cn:
|
||||||
ADDI64 r254, r254, -18d
|
ADDI64 r254, r254, -2d
|
||||||
ST r32, r254, 2a, 16h
|
|
||||||
LI8 r13, 1b
|
LI8 r13, 1b
|
||||||
ADDI64 r14, r254, 0d
|
ADDI64 r14, r254, 0d
|
||||||
ST r13, r254, 0a, 1h
|
ST r13, r254, 0a, 1h
|
||||||
ST r0, r254, 1a, 1h
|
ST r0, r254, 1a, 1h
|
||||||
LD r1, r14, 0a, 2h
|
LD r1, r14, 0a, 2h
|
||||||
LD r32, r254, 2a, 16h
|
ADDI64 r254, r254, 2d
|
||||||
ADDI64 r254, r254, 18d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
returner_fn:
|
returner_fn:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
LD r13, r254, 0a, 0h
|
LD r13, r254, 0a, 0h
|
||||||
ORI r13, r13, 128d
|
ORI r13, r13, 128d
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 563
|
code size: 463
|
||||||
ret: 1
|
ret: 1
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,14 +1,10 @@
|
||||||
decide:
|
decide:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
LI8 r13, 1b
|
LI8 r13, 1b
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -136d
|
ADDI64 r254, r254, -128d
|
||||||
ST r31, r254, 80a, 56h
|
ST r31, r254, 80a, 48h
|
||||||
JAL r31, r0, :decide
|
JAL r31, r0, :decide
|
||||||
CP r32, r1
|
CP r32, r1
|
||||||
CP r33, r0
|
CP r33, r0
|
||||||
|
@ -102,12 +98,11 @@ main:
|
||||||
ANDI r32, r32, 65535d
|
ANDI r32, r32, 65535d
|
||||||
SUB64 r32, r32, r33
|
SUB64 r32, r32, r33
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
3: LD r31, r254, 80a, 56h
|
3: LD r31, r254, 80a, 48h
|
||||||
ADDI64 r254, r254, 136d
|
ADDI64 r254, r254, 128d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
new_bar:
|
new_bar:
|
||||||
ADDI64 r254, r254, -48d
|
ADDI64 r254, r254, -24d
|
||||||
ST r32, r254, 24a, 24h
|
|
||||||
CP r14, r2
|
CP r14, r2
|
||||||
CP r16, r1
|
CP r16, r1
|
||||||
LI8 r15, 1b
|
LI8 r15, 1b
|
||||||
|
@ -117,28 +112,23 @@ new_bar:
|
||||||
LI64 r14, 1d
|
LI64 r14, 1d
|
||||||
ST r14, r254, 16a, 8h
|
ST r14, r254, 16a, 8h
|
||||||
BMC r13, r16, 24h
|
BMC r13, r16, 24h
|
||||||
LD r32, r254, 24a, 24h
|
ADDI64 r254, r254, 24d
|
||||||
ADDI64 r254, r254, 48d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
new_foo:
|
new_foo:
|
||||||
ADDI64 r254, r254, -40d
|
ADDI64 r254, r254, -24d
|
||||||
ST r32, r254, 24a, 16h
|
|
||||||
ADDI64 r13, r254, 0d
|
ADDI64 r13, r254, 0d
|
||||||
ADDI64 r14, r254, 8d
|
ADDI64 r14, r254, 8d
|
||||||
ST r13, r254, 8a, 8h
|
ST r13, r254, 8a, 8h
|
||||||
ST r0, r254, 16a, 8h
|
ST r0, r254, 16a, 8h
|
||||||
LD r1, r14, 0a, 16h
|
LD r1, r14, 0a, 16h
|
||||||
LD r32, r254, 24a, 16h
|
ADDI64 r254, r254, 24d
|
||||||
ADDI64 r254, r254, 40d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
no_foo:
|
no_foo:
|
||||||
ADDI64 r254, r254, -24d
|
ADDI64 r254, r254, -16d
|
||||||
ST r32, r254, 16a, 8h
|
|
||||||
ADDI64 r13, r254, 0d
|
ADDI64 r13, r254, 0d
|
||||||
ST r0, r254, 0a, 8h
|
ST r0, r254, 0a, 8h
|
||||||
LD r1, r13, 0a, 16h
|
LD r1, r13, 0a, 16h
|
||||||
LD r32, r254, 16a, 8h
|
ADDI64 r254, r254, 16d
|
||||||
ADDI64 r254, r254, 24d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
use_foo:
|
use_foo:
|
||||||
ADDI64 r254, r254, -16d
|
ADDI64 r254, r254, -16d
|
||||||
|
@ -146,6 +136,6 @@ use_foo:
|
||||||
ADDI64 r2, r254, 0d
|
ADDI64 r2, r254, 0d
|
||||||
ADDI64 r254, r254, 16d
|
ADDI64 r254, r254, 16d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 1240
|
code size: 1114
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,14 +1,10 @@
|
||||||
inb:
|
inb:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -32d
|
ADDI64 r254, r254, -24d
|
||||||
ST r31, r254, 0a, 32h
|
ST r31, r254, 0a, 24h
|
||||||
LI64 r32, 100d
|
LI64 r32, 100d
|
||||||
4: CP r2, r32
|
4: CP r2, r32
|
||||||
JAL r31, r0, :inb
|
JAL r31, r0, :inb
|
||||||
|
@ -28,11 +24,11 @@ main:
|
||||||
JMP :2
|
JMP :2
|
||||||
1: JMP :3
|
1: JMP :3
|
||||||
0: JMP :4
|
0: JMP :4
|
||||||
2: LD r31, r254, 0a, 32h
|
2: LD r31, r254, 0a, 24h
|
||||||
ADDI64 r254, r254, 32d
|
ADDI64 r254, r254, 24d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
outb:
|
outb:
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 251
|
code size: 203
|
||||||
ret: 1
|
ret: 1
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -32d
|
ADDI64 r254, r254, -16d
|
||||||
ST r32, r254, 16a, 16h
|
|
||||||
ADDI64 r13, r254, 0d
|
ADDI64 r13, r254, 0d
|
||||||
CP r3, r0
|
CP r3, r0
|
||||||
CP r4, r0
|
CP r4, r0
|
||||||
|
@ -14,10 +13,9 @@ main:
|
||||||
UN
|
UN
|
||||||
0: LD r13, r254, 8a, 8h
|
0: LD r13, r254, 8a, 8h
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 16a, 16h
|
ADDI64 r254, r254, 16d
|
||||||
ADDI64 r254, r254, 32d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
unknown ecall: 0
|
unknown ecall: 0
|
||||||
code size: 150
|
code size: 124
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Err(Unreachable)
|
status: Err(Unreachable)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -72d
|
ADDI64 r254, r254, -64d
|
||||||
ST r31, r254, 24a, 48h
|
ST r31, r254, 24a, 40h
|
||||||
ADDI64 r32, r254, 0d
|
ADDI64 r32, r254, 0d
|
||||||
LI64 r33, 1d
|
LI64 r33, 1d
|
||||||
ST r33, r254, 16a, 8h
|
ST r33, r254, 16a, 8h
|
||||||
|
@ -15,21 +15,19 @@ main:
|
||||||
LD r32, r254, 0a, 8h
|
LD r32, r254, 0a, 8h
|
||||||
SUB64 r32, r32, r34
|
SUB64 r32, r32, r34
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 24a, 48h
|
LD r31, r254, 24a, 40h
|
||||||
ADDI64 r254, r254, 72d
|
ADDI64 r254, r254, 64d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
opaque:
|
opaque:
|
||||||
ADDI64 r254, r254, -32d
|
ADDI64 r254, r254, -16d
|
||||||
ST r32, r254, 16a, 16h
|
|
||||||
LI64 r13, 3d
|
LI64 r13, 3d
|
||||||
ADDI64 r14, r254, 0d
|
ADDI64 r14, r254, 0d
|
||||||
ST r13, r254, 0a, 8h
|
ST r13, r254, 0a, 8h
|
||||||
LI64 r13, 2d
|
LI64 r13, 2d
|
||||||
ST r13, r254, 8a, 8h
|
ST r13, r254, 8a, 8h
|
||||||
LD r1, r14, 0a, 16h
|
LD r1, r14, 0a, 16h
|
||||||
LD r32, r254, 16a, 16h
|
ADDI64 r254, r254, 16d
|
||||||
ADDI64 r254, r254, 32d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 336
|
code size: 310
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
clobber:
|
clobber:
|
||||||
ADDI64 r254, r254, -16d
|
|
||||||
ST r32, r254, 0a, 16h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
LI64 r14, 4d
|
LI64 r14, 4d
|
||||||
ST r14, r13, 0a, 8h
|
ST r14, r13, 0a, 8h
|
||||||
LD r32, r254, 0a, 16h
|
|
||||||
ADDI64 r254, r254, 16d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -40d
|
ADDI64 r254, r254, -32d
|
||||||
ST r31, r254, 8a, 32h
|
ST r31, r254, 8a, 24h
|
||||||
ADDI64 r32, r254, 0d
|
ADDI64 r32, r254, 0d
|
||||||
LI64 r33, 2d
|
LI64 r33, 2d
|
||||||
ST r33, r254, 0a, 8h
|
ST r33, r254, 0a, 8h
|
||||||
|
@ -19,9 +15,9 @@ main:
|
||||||
LI64 r33, 4d
|
LI64 r33, 4d
|
||||||
SUB64 r32, r33, r32
|
SUB64 r32, r33, r32
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 8a, 32h
|
LD r31, r254, 8a, 24h
|
||||||
ADDI64 r254, r254, 40d
|
ADDI64 r254, r254, 32d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 226
|
code size: 178
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
drop:
|
drop:
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -40d
|
ADDI64 r254, r254, -32d
|
||||||
ST r31, r254, 8a, 32h
|
ST r31, r254, 8a, 24h
|
||||||
ADDI64 r32, r254, 0d
|
ADDI64 r32, r254, 0d
|
||||||
LI64 r33, 1d
|
LI64 r33, 1d
|
||||||
ST r33, r254, 0a, 8h
|
ST r33, r254, 0a, 8h
|
||||||
|
@ -13,18 +13,14 @@ main:
|
||||||
LD r32, r254, 0a, 8h
|
LD r32, r254, 0a, 8h
|
||||||
ADDI64 r32, r32, -2d
|
ADDI64 r32, r32, -2d
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 8a, 32h
|
LD r31, r254, 8a, 24h
|
||||||
ADDI64 r254, r254, 40d
|
ADDI64 r254, r254, 32d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
modify:
|
modify:
|
||||||
ADDI64 r254, r254, -16d
|
|
||||||
ST r32, r254, 0a, 16h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
LI64 r14, 2d
|
LI64 r14, 2d
|
||||||
ST r14, r13, 0a, 8h
|
ST r14, r13, 0a, 8h
|
||||||
LD r32, r254, 0a, 16h
|
|
||||||
ADDI64 r254, r254, 16d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 244
|
code size: 196
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
create_back_buffer:
|
create_back_buffer:
|
||||||
ADDI64 r254, r254, -48d
|
ADDI64 r254, r254, -40d
|
||||||
ST r31, r254, 0a, 48h
|
ST r31, r254, 0a, 40h
|
||||||
CP r32, r2
|
CP r32, r2
|
||||||
LI64 r33, 255d
|
LI64 r33, 255d
|
||||||
JGTS r32, r33, :0
|
JGTS r32, r33, :0
|
||||||
|
@ -25,21 +25,19 @@ create_back_buffer:
|
||||||
JAL r31, r0, :request_page
|
JAL r31, r0, :request_page
|
||||||
4: SUB64 r32, r32, r33
|
4: SUB64 r32, r32, r33
|
||||||
JMP :5
|
JMP :5
|
||||||
1: LD r31, r254, 0a, 48h
|
1: LD r31, r254, 0a, 40h
|
||||||
ADDI64 r254, r254, 48d
|
ADDI64 r254, r254, 40d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -24d
|
ADDI64 r254, r254, -16d
|
||||||
ST r31, r254, 0a, 24h
|
ST r31, r254, 0a, 16h
|
||||||
LI64 r32, 400d
|
LI64 r32, 400d
|
||||||
CP r2, r32
|
CP r2, r32
|
||||||
JAL r31, r0, :create_back_buffer
|
JAL r31, r0, :create_back_buffer
|
||||||
LD r31, r254, 0a, 24h
|
LD r31, r254, 0a, 16h
|
||||||
ADDI64 r254, r254, 24d
|
ADDI64 r254, r254, 16d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
request_page:
|
request_page:
|
||||||
ADDI64 r254, r254, -32d
|
|
||||||
ST r32, r254, 0a, 32h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
LRA r14, r0, :"\0\u{1}xxxxxxxx\0"
|
LRA r14, r0, :"\0\u{1}xxxxxxxx\0"
|
||||||
ST r13, r14, 1a, 1h
|
ST r13, r14, 1a, 1h
|
||||||
|
@ -53,9 +51,7 @@ request_page:
|
||||||
ECA
|
ECA
|
||||||
CP r13, r1
|
CP r13, r1
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 32h
|
|
||||||
ADDI64 r254, r254, 32d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 399
|
code size: 351
|
||||||
ret: 42
|
ret: 42
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -60d
|
ADDI64 r254, r254, -52d
|
||||||
ST r31, r254, 4a, 56h
|
ST r31, r254, 4a, 48h
|
||||||
ADDI64 r32, r254, 0d
|
ADDI64 r32, r254, 0d
|
||||||
JAL r31, r0, :random_color
|
JAL r31, r0, :random_color
|
||||||
ST r1, r32, 0a, 4h
|
ST r1, r32, 0a, 4h
|
||||||
|
@ -16,17 +16,13 @@ main:
|
||||||
ADD64 r33, r34, r33
|
ADD64 r33, r34, r33
|
||||||
ADD64 r32, r33, r32
|
ADD64 r32, r33, r32
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 4a, 56h
|
LD r31, r254, 4a, 48h
|
||||||
ADDI64 r254, r254, 60d
|
ADDI64 r254, r254, 52d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
random_color:
|
random_color:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
LRA r13, r0, :white
|
LRA r13, r0, :white
|
||||||
LD r1, r13, 0a, 4h
|
LD r1, r13, 0a, 4h
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 292
|
code size: 244
|
||||||
ret: 1020
|
ret: 1020
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
get_format:
|
get_format:
|
||||||
ADDI64 r254, r254, -40d
|
ADDI64 r254, r254, -16d
|
||||||
ST r32, r254, 16a, 24h
|
|
||||||
LI8 r13, 1b
|
LI8 r13, 1b
|
||||||
ADDI64 r14, r254, 0d
|
ADDI64 r14, r254, 0d
|
||||||
LRA r15, r0, :BMP
|
LRA r15, r0, :BMP
|
||||||
|
@ -8,12 +7,11 @@ get_format:
|
||||||
LD r13, r15, 0a, 8h
|
LD r13, r15, 0a, 8h
|
||||||
ST r13, r254, 8a, 8h
|
ST r13, r254, 8a, 8h
|
||||||
LD r1, r14, 0a, 16h
|
LD r1, r14, 0a, 16h
|
||||||
LD r32, r254, 16a, 24h
|
ADDI64 r254, r254, 16d
|
||||||
ADDI64 r254, r254, 40d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -48d
|
ADDI64 r254, r254, -40d
|
||||||
ST r31, r254, 16a, 32h
|
ST r31, r254, 16a, 24h
|
||||||
ADDI64 r32, r254, 0d
|
ADDI64 r32, r254, 0d
|
||||||
JAL r31, r0, :get_format
|
JAL r31, r0, :get_format
|
||||||
ST r1, r32, 0a, 16h
|
ST r1, r32, 0a, 16h
|
||||||
|
@ -25,9 +23,9 @@ main:
|
||||||
JMP :1
|
JMP :1
|
||||||
0: LD r32, r254, 8a, 8h
|
0: LD r32, r254, 8a, 8h
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
1: LD r31, r254, 16a, 32h
|
1: LD r31, r254, 16a, 24h
|
||||||
ADDI64 r254, r254, 48d
|
ADDI64 r254, r254, 40d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 301
|
code size: 275
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
constructor:
|
constructor:
|
||||||
ADDI64 r254, r254, -48d
|
ADDI64 r254, r254, -40d
|
||||||
ST r31, r254, 16a, 32h
|
ST r31, r254, 16a, 24h
|
||||||
CP r32, r3
|
CP r32, r3
|
||||||
CP r2, r32
|
CP r2, r32
|
||||||
JAL r31, r0, :opaque
|
JAL r31, r0, :opaque
|
||||||
|
@ -9,31 +9,27 @@ constructor:
|
||||||
ST r32, r254, 0a, 8h
|
ST r32, r254, 0a, 8h
|
||||||
ST r32, r254, 8a, 8h
|
ST r32, r254, 8a, 8h
|
||||||
LD r1, r33, 0a, 16h
|
LD r1, r33, 0a, 16h
|
||||||
LD r31, r254, 16a, 32h
|
LD r31, r254, 16a, 24h
|
||||||
ADDI64 r254, r254, 48d
|
ADDI64 r254, r254, 40d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -40d
|
ADDI64 r254, r254, -32d
|
||||||
ST r31, r254, 16a, 24h
|
ST r31, r254, 16a, 16h
|
||||||
ADDI64 r32, r254, 0d
|
ADDI64 r32, r254, 0d
|
||||||
CP r3, r0
|
CP r3, r0
|
||||||
JAL r31, r0, :constructor
|
JAL r31, r0, :constructor
|
||||||
ST r1, r32, 0a, 16h
|
ST r1, r32, 0a, 16h
|
||||||
LD r31, r254, 16a, 24h
|
LD r31, r254, 16a, 16h
|
||||||
ADDI64 r254, r254, 40d
|
ADDI64 r254, r254, 32d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
opaque:
|
opaque:
|
||||||
ADDI64 r254, r254, -16d
|
|
||||||
ST r32, r254, 0a, 16h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
LRA r14, r0, :file
|
LRA r14, r0, :file
|
||||||
ADD64 r13, r14, r13
|
ADD64 r13, r14, r13
|
||||||
LD r13, r13, 0a, 1h
|
LD r13, r13, 0a, 1h
|
||||||
ANDI r13, r13, 255d
|
ANDI r13, r13, 255d
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 16h
|
|
||||||
ADDI64 r254, r254, 16d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 327
|
code size: 279
|
||||||
ret: 255
|
ret: 255
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
LI64 r13, 1d
|
LI64 r13, 1d
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 80
|
code size: 32
|
||||||
ret: 1
|
ret: 1
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -20d
|
ADDI64 r254, r254, -4d
|
||||||
ST r32, r254, 4a, 16h
|
|
||||||
LRA r13, r0, :white
|
LRA r13, r0, :white
|
||||||
ADDI64 r14, r254, 0d
|
ADDI64 r14, r254, 0d
|
||||||
BMC r13, r14, 4h
|
BMC r13, r14, 4h
|
||||||
LD r13, r254, 3a, 1h
|
LD r13, r254, 3a, 1h
|
||||||
ANDI r13, r13, 255d
|
ANDI r13, r13, 255d
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 4a, 16h
|
ADDI64 r254, r254, 4d
|
||||||
ADDI64 r254, r254, 20d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 121
|
code size: 95
|
||||||
ret: 255
|
ret: 255
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -36d
|
ADDI64 r254, r254, -28d
|
||||||
ST r31, r254, 4a, 32h
|
ST r31, r254, 4a, 24h
|
||||||
LRA r32, r0, :white
|
LRA r32, r0, :white
|
||||||
ADDI64 r33, r254, 0d
|
ADDI64 r33, r254, 0d
|
||||||
LD r32, r32, 0a, 4h
|
LD r32, r32, 0a, 4h
|
||||||
|
@ -10,12 +10,12 @@ main:
|
||||||
LD r32, r254, 0a, 1h
|
LD r32, r254, 0a, 1h
|
||||||
ANDI r32, r32, 255d
|
ANDI r32, r32, 255d
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 4a, 32h
|
LD r31, r254, 4a, 24h
|
||||||
ADDI64 r254, r254, 36d
|
ADDI64 r254, r254, 28d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
u32_to_color:
|
u32_to_color:
|
||||||
ADDI64 r254, r254, -36d
|
ADDI64 r254, r254, -28d
|
||||||
ST r31, r254, 4a, 32h
|
ST r31, r254, 4a, 24h
|
||||||
CP r32, r2
|
CP r32, r2
|
||||||
CP r2, r32
|
CP r2, r32
|
||||||
JAL r31, r0, :u32_to_u32
|
JAL r31, r0, :u32_to_u32
|
||||||
|
@ -23,17 +23,13 @@ u32_to_color:
|
||||||
ADDI64 r33, r254, 0d
|
ADDI64 r33, r254, 0d
|
||||||
ST r32, r254, 0a, 4h
|
ST r32, r254, 0a, 4h
|
||||||
LD r1, r33, 0a, 4h
|
LD r1, r33, 0a, 4h
|
||||||
LD r31, r254, 4a, 32h
|
LD r31, r254, 4a, 24h
|
||||||
ADDI64 r254, r254, 36d
|
ADDI64 r254, r254, 28d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
u32_to_u32:
|
u32_to_u32:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 329
|
code size: 281
|
||||||
ret: 255
|
ret: 255
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -16d
|
ADDI64 r254, r254, -8d
|
||||||
ST r31, r254, 0a, 16h
|
ST r31, r254, 0a, 8h
|
||||||
JAL r31, r0, :some_func
|
JAL r31, r0, :some_func
|
||||||
LD r31, r254, 0a, 16h
|
LD r31, r254, 0a, 8h
|
||||||
ADDI64 r254, r254, 16d
|
ADDI64 r254, r254, 8d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
some_func:
|
some_func:
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
|
|
|
@ -1,17 +1,15 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -24d
|
ADDI64 r254, r254, -16d
|
||||||
ST r31, r254, 0a, 24h
|
ST r31, r254, 0a, 16h
|
||||||
LI64 r32, 100d
|
LI64 r32, 100d
|
||||||
CP r2, r32
|
CP r2, r32
|
||||||
JAL r31, r0, :sqrt
|
JAL r31, r0, :sqrt
|
||||||
CP r32, r1
|
CP r32, r1
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 0a, 24h
|
LD r31, r254, 0a, 16h
|
||||||
ADDI64 r254, r254, 24d
|
ADDI64 r254, r254, 16d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
sqrt:
|
sqrt:
|
||||||
ADDI64 r254, r254, -48d
|
|
||||||
ST r32, r254, 0a, 48h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
LI64 r16, 15d
|
LI64 r16, 15d
|
||||||
LI64 r15, 32768d
|
LI64 r15, 32768d
|
||||||
|
@ -30,9 +28,7 @@ sqrt:
|
||||||
JMP :2
|
JMP :2
|
||||||
2: SRUI64 r15, r15, 1b
|
2: SRUI64 r15, r15, 1b
|
||||||
JMP :3
|
JMP :3
|
||||||
1: LD r32, r254, 0a, 48h
|
1: JALA r0, r31, 0a
|
||||||
ADDI64 r254, r254, 48d
|
code size: 196
|
||||||
JALA r0, r31, 0a
|
|
||||||
code size: 244
|
|
||||||
ret: 14
|
ret: 14
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,16 +1,12 @@
|
||||||
do_stuff:
|
do_stuff:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
just_read:
|
just_read:
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -88d
|
ADDI64 r254, r254, -80d
|
||||||
ST r31, r254, 48a, 40h
|
ST r31, r254, 48a, 32h
|
||||||
ADDI64 r32, r254, 16d
|
ADDI64 r32, r254, 16d
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
JAL r31, r0, :optionala
|
JAL r31, r0, :optionala
|
||||||
|
@ -41,24 +37,21 @@ main:
|
||||||
CP r33, r1
|
CP r33, r1
|
||||||
ADD64 r32, r33, r32
|
ADD64 r32, r33, r32
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
1: LD r31, r254, 48a, 40h
|
1: LD r31, r254, 48a, 32h
|
||||||
ADDI64 r254, r254, 88d
|
ADDI64 r254, r254, 80d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
optional:
|
optional:
|
||||||
ADDI64 r254, r254, -32d
|
ADDI64 r254, r254, -16d
|
||||||
ST r32, r254, 16a, 16h
|
|
||||||
LI8 r13, 1b
|
LI8 r13, 1b
|
||||||
ADDI64 r14, r254, 0d
|
ADDI64 r14, r254, 0d
|
||||||
ST r13, r254, 0a, 1h
|
ST r13, r254, 0a, 1h
|
||||||
LI64 r13, 10d
|
LI64 r13, 10d
|
||||||
ST r13, r254, 8a, 8h
|
ST r13, r254, 8a, 8h
|
||||||
LD r1, r14, 0a, 16h
|
LD r1, r14, 0a, 16h
|
||||||
LD r32, r254, 16a, 16h
|
ADDI64 r254, r254, 16d
|
||||||
ADDI64 r254, r254, 32d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
optionala:
|
optionala:
|
||||||
ADDI64 r254, r254, -80d
|
ADDI64 r254, r254, -48d
|
||||||
ST r32, r254, 48a, 32h
|
|
||||||
CP r17, r1
|
CP r17, r1
|
||||||
ADDI64 r14, r254, 8d
|
ADDI64 r14, r254, 8d
|
||||||
ADDI64 r15, r254, 16d
|
ADDI64 r15, r254, 16d
|
||||||
|
@ -71,9 +64,8 @@ optionala:
|
||||||
ST r0, r254, 8a, 8h
|
ST r0, r254, 8a, 8h
|
||||||
ST r0, r254, 40a, 8h
|
ST r0, r254, 40a, 8h
|
||||||
BMC r15, r17, 32h
|
BMC r15, r17, 32h
|
||||||
LD r32, r254, 48a, 32h
|
ADDI64 r254, r254, 48d
|
||||||
ADDI64 r254, r254, 80d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 667
|
code size: 567
|
||||||
ret: 100
|
ret: 100
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -128d
|
ADDI64 r254, r254, -40d
|
||||||
ST r32, r254, 40a, 88h
|
|
||||||
LI64 r17, 1d
|
LI64 r17, 1d
|
||||||
LI64 r16, 4d
|
LI64 r16, 4d
|
||||||
CP r14, r0
|
CP r14, r0
|
||||||
|
@ -40,9 +39,8 @@ main:
|
||||||
ST r13, r19, 0a, 8h
|
ST r13, r19, 0a, 8h
|
||||||
CP r13, r15
|
CP r13, r15
|
||||||
JMP :6
|
JMP :6
|
||||||
2: LD r32, r254, 40a, 88h
|
2: ADDI64 r254, r254, 40d
|
||||||
ADDI64 r254, r254, 128d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 296
|
code size: 270
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -20d
|
ADDI64 r254, r254, -4d
|
||||||
ST r32, r254, 4a, 16h
|
|
||||||
LRA r13, r0, :MAGENTA
|
LRA r13, r0, :MAGENTA
|
||||||
ADDI64 r14, r254, 0d
|
ADDI64 r14, r254, 0d
|
||||||
BMC r13, r14, 4h
|
BMC r13, r14, 4h
|
||||||
LD r13, r254, 2a, 1h
|
LD r13, r254, 2a, 1h
|
||||||
ANDI r13, r13, 255d
|
ANDI r13, r13, 255d
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 4a, 16h
|
ADDI64 r254, r254, 4d
|
||||||
ADDI64 r254, r254, 20d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 121
|
code size: 95
|
||||||
ret: 205
|
ret: 205
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
LI64 r13, 10d
|
LI64 r13, 10d
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 80
|
code size: 32
|
||||||
ret: 10
|
ret: 10
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
fib:
|
fib:
|
||||||
ADDI64 r254, r254, -40d
|
ADDI64 r254, r254, -32d
|
||||||
ST r31, r254, 0a, 40h
|
ST r31, r254, 0a, 32h
|
||||||
CP r32, r2
|
CP r32, r2
|
||||||
LI64 r33, 2d
|
LI64 r33, 2d
|
||||||
JLTU r32, r33, :0
|
JLTU r32, r33, :0
|
||||||
|
@ -16,12 +16,10 @@ fib:
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
JMP :1
|
JMP :1
|
||||||
0: CP r1, r32
|
0: CP r1, r32
|
||||||
1: LD r31, r254, 0a, 40h
|
1: LD r31, r254, 0a, 32h
|
||||||
ADDI64 r254, r254, 40d
|
ADDI64 r254, r254, 32d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
fib_iter:
|
fib_iter:
|
||||||
ADDI64 r254, r254, -40d
|
|
||||||
ST r32, r254, 0a, 40h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
LI64 r17, 1d
|
LI64 r17, 1d
|
||||||
CP r15, r0
|
CP r15, r0
|
||||||
|
@ -34,12 +32,10 @@ fib_iter:
|
||||||
SUB64 r13, r13, r17
|
SUB64 r13, r13, r17
|
||||||
SWA r14, r16
|
SWA r14, r16
|
||||||
JMP :2
|
JMP :2
|
||||||
1: LD r32, r254, 0a, 40h
|
1: JALA r0, r31, 0a
|
||||||
ADDI64 r254, r254, 40d
|
|
||||||
JALA r0, r31, 0a
|
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -32d
|
ADDI64 r254, r254, -24d
|
||||||
ST r31, r254, 0a, 32h
|
ST r31, r254, 0a, 24h
|
||||||
LI64 r32, 10d
|
LI64 r32, 10d
|
||||||
CP r2, r32
|
CP r2, r32
|
||||||
JAL r31, r0, :fib
|
JAL r31, r0, :fib
|
||||||
|
@ -49,9 +45,9 @@ main:
|
||||||
CP r32, r1
|
CP r32, r1
|
||||||
SUB64 r32, r33, r32
|
SUB64 r32, r33, r32
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 0a, 32h
|
LD r31, r254, 0a, 24h
|
||||||
ADDI64 r254, r254, 32d
|
ADDI64 r254, r254, 24d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 353
|
code size: 305
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
foo:
|
foo:
|
||||||
ADDI64 r254, r254, -32d
|
ADDI64 r254, r254, -16d
|
||||||
ST r32, r254, 16a, 16h
|
|
||||||
LI64 r13, 3d
|
LI64 r13, 3d
|
||||||
ADDI64 r14, r254, 0d
|
ADDI64 r14, r254, 0d
|
||||||
ST r13, r254, 0a, 8h
|
ST r13, r254, 0a, 8h
|
||||||
|
@ -8,12 +7,11 @@ foo:
|
||||||
ST r13, r254, 8a, 4h
|
ST r13, r254, 8a, 4h
|
||||||
ST r13, r254, 12a, 4h
|
ST r13, r254, 12a, 4h
|
||||||
LD r1, r14, 0a, 16h
|
LD r1, r14, 0a, 16h
|
||||||
LD r32, r254, 16a, 16h
|
ADDI64 r254, r254, 16d
|
||||||
ADDI64 r254, r254, 32d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -96d
|
ADDI64 r254, r254, -88d
|
||||||
ST r31, r254, 48a, 48h
|
ST r31, r254, 48a, 40h
|
||||||
ADDI64 r32, r254, 32d
|
ADDI64 r32, r254, 32d
|
||||||
JAL r31, r0, :foo
|
JAL r31, r0, :foo
|
||||||
ST r1, r32, 0a, 16h
|
ST r1, r32, 0a, 16h
|
||||||
|
@ -33,9 +31,9 @@ main:
|
||||||
LI64 r33, 7d
|
LI64 r33, 7d
|
||||||
SUB64 r32, r33, r32
|
SUB64 r32, r33, r32
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 48a, 48h
|
LD r31, r254, 48a, 40h
|
||||||
ADDI64 r254, r254, 96d
|
ADDI64 r254, r254, 88d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 384
|
code size: 358
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -72d
|
ADDI64 r254, r254, -64d
|
||||||
ST r31, r254, 32a, 40h
|
ST r31, r254, 32a, 32h
|
||||||
LI64 r32, 4d
|
LI64 r32, 4d
|
||||||
ADDI64 r33, r254, 16d
|
ADDI64 r33, r254, 16d
|
||||||
ST r32, r254, 16a, 8h
|
ST r32, r254, 16a, 8h
|
||||||
|
@ -18,28 +18,22 @@ main:
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
JMP :1
|
JMP :1
|
||||||
0: CP r1, r0
|
0: CP r1, r0
|
||||||
1: LD r31, r254, 32a, 40h
|
1: LD r31, r254, 32a, 32h
|
||||||
ADDI64 r254, r254, 72d
|
ADDI64 r254, r254, 64d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
odher_pass:
|
odher_pass:
|
||||||
ADDI64 r254, r254, -24d
|
ADDI64 r254, r254, -16d
|
||||||
ST r32, r254, 16a, 8h
|
|
||||||
ST r3, r254, 0a, 16h
|
ST r3, r254, 0a, 16h
|
||||||
ADDI64 r3, r254, 0d
|
ADDI64 r3, r254, 0d
|
||||||
CP r13, r3
|
CP r13, r3
|
||||||
LD r1, r13, 0a, 16h
|
LD r1, r13, 0a, 16h
|
||||||
LD r32, r254, 16a, 8h
|
ADDI64 r254, r254, 16d
|
||||||
ADDI64 r254, r254, 24d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
pass:
|
pass:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
CP r13, r2
|
CP r13, r2
|
||||||
LD r13, r13, 0a, 8h
|
LD r13, r13, 0a, 8h
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 387
|
code size: 313
|
||||||
ret: 4
|
ret: 4
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -10288d
|
ADDI64 r254, r254, -10240d
|
||||||
ST r32, r254, 10240a, 48h
|
|
||||||
LI64 r14, 1d
|
LI64 r14, 1d
|
||||||
LI8 r16, 64b
|
LI8 r16, 64b
|
||||||
LI64 r17, 1024d
|
LI64 r17, 1024d
|
||||||
|
@ -25,9 +24,8 @@ main:
|
||||||
ST r16, r13, 0a, 1h
|
ST r16, r13, 0a, 1h
|
||||||
CP r13, r15
|
CP r13, r15
|
||||||
JMP :4
|
JMP :4
|
||||||
2: LD r32, r254, 10240a, 48h
|
2: ADDI64 r254, r254, 10240d
|
||||||
ADDI64 r254, r254, 10288d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 220
|
code size: 194
|
||||||
ret: 64
|
ret: 64
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -72d
|
ADDI64 r254, r254, -64d
|
||||||
ST r31, r254, 0a, 72h
|
ST r31, r254, 0a, 64h
|
||||||
CP r34, r0
|
CP r34, r0
|
||||||
LI64 r37, 65536d
|
LI64 r37, 65536d
|
||||||
LI8 r35, 1b
|
LI8 r35, 1b
|
||||||
|
@ -25,18 +25,14 @@ main:
|
||||||
6: JMP :7
|
6: JMP :7
|
||||||
4: ADDI64 r33, r33, 1d
|
4: ADDI64 r33, r33, 1d
|
||||||
JMP :8
|
JMP :8
|
||||||
1: LD r31, r254, 0a, 72h
|
1: LD r31, r254, 0a, 64h
|
||||||
ADDI64 r254, r254, 72d
|
ADDI64 r254, r254, 64d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
opaque:
|
opaque:
|
||||||
ADDI64 r254, r254, -8d
|
|
||||||
ST r32, r254, 0a, 8h
|
|
||||||
LI64 r13, 2147483648d
|
LI64 r13, 2147483648d
|
||||||
CP r1, r13
|
CP r1, r13
|
||||||
LD r32, r254, 0a, 8h
|
|
||||||
ADDI64 r254, r254, 8d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
timed out
|
timed out
|
||||||
code size: 268
|
code size: 220
|
||||||
ret: 2147483648
|
ret: 2147483648
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,27 @@
|
||||||
main:
|
main:
|
||||||
CP r1, r0
|
LI64 r16, 4621819117588971520d
|
||||||
JALA r0, r31, 0a
|
LI64 r17, 1d
|
||||||
code size: 22
|
LI64 r18, 3d
|
||||||
ret: 0
|
CP r14, r0
|
||||||
|
CP r15, r14
|
||||||
|
3: JNE r15, r18, :0
|
||||||
|
CP r1, r17
|
||||||
|
JMP :1
|
||||||
|
0: ITF64 r19, r15
|
||||||
|
CP r13, r14
|
||||||
|
5: JNE r13, r18, :2
|
||||||
|
ADD64 r15, r15, r17
|
||||||
|
JMP :3
|
||||||
|
2: ITF64 r20, r13
|
||||||
|
FMUL64 r20, r20, r19
|
||||||
|
FCMPLT64 r20, r20, r16
|
||||||
|
NOT r20, r20
|
||||||
|
ANDI r20, r20, 255d
|
||||||
|
JNE r20, r0, :4
|
||||||
|
ADD64 r13, r13, r17
|
||||||
|
JMP :5
|
||||||
|
4: CP r1, r14
|
||||||
|
1: JALA r0, r31, 0a
|
||||||
|
code size: 130
|
||||||
|
ret: 1
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -56d
|
ADDI64 r254, r254, -48d
|
||||||
ST r31, r254, 16a, 40h
|
ST r31, r254, 16a, 32h
|
||||||
ADDI64 r32, r254, 0d
|
ADDI64 r32, r254, 0d
|
||||||
CP r3, r0
|
CP r3, r0
|
||||||
CP r4, r0
|
CP r4, r0
|
||||||
|
@ -11,12 +11,12 @@ main:
|
||||||
SUB8 r32, r32, r34
|
SUB8 r32, r32, r34
|
||||||
ANDI r32, r32, 255d
|
ANDI r32, r32, 255d
|
||||||
CP r1, r32
|
CP r1, r32
|
||||||
LD r31, r254, 16a, 40h
|
LD r31, r254, 16a, 32h
|
||||||
ADDI64 r254, r254, 56d
|
ADDI64 r254, r254, 48d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
maina:
|
maina:
|
||||||
ADDI64 r254, r254, -68d
|
ADDI64 r254, r254, -60d
|
||||||
ST r31, r254, 20a, 48h
|
ST r31, r254, 20a, 40h
|
||||||
ADDI64 r32, r254, 16d
|
ADDI64 r32, r254, 16d
|
||||||
JAL r31, r0, :small_struct
|
JAL r31, r0, :small_struct
|
||||||
ST r1, r32, 0a, 4h
|
ST r1, r32, 0a, 4h
|
||||||
|
@ -40,19 +40,17 @@ maina:
|
||||||
ST r0, r254, 14a, 1h
|
ST r0, r254, 14a, 1h
|
||||||
ST r0, r254, 15a, 1h
|
ST r0, r254, 15a, 1h
|
||||||
LD r1, r33, 0a, 16h
|
LD r1, r33, 0a, 16h
|
||||||
LD r31, r254, 20a, 48h
|
LD r31, r254, 20a, 40h
|
||||||
ADDI64 r254, r254, 68d
|
ADDI64 r254, r254, 60d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
small_struct:
|
small_struct:
|
||||||
ADDI64 r254, r254, -12d
|
ADDI64 r254, r254, -4d
|
||||||
ST r32, r254, 4a, 8h
|
|
||||||
ADDI64 r13, r254, 0d
|
ADDI64 r13, r254, 0d
|
||||||
ST r0, r254, 0a, 2h
|
ST r0, r254, 0a, 2h
|
||||||
ST r0, r254, 2a, 2h
|
ST r0, r254, 2a, 2h
|
||||||
LD r1, r13, 0a, 4h
|
LD r1, r13, 0a, 4h
|
||||||
LD r32, r254, 4a, 8h
|
ADDI64 r254, r254, 4d
|
||||||
ADDI64 r254, r254, 12d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
code size: 585
|
code size: 559
|
||||||
ret: 2
|
ret: 2
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
inl:
|
inl:
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -16d
|
ADDI64 r254, r254, -8d
|
||||||
ST r31, r254, 0a, 16h
|
ST r31, r254, 0a, 8h
|
||||||
JAL r31, r0, :outl
|
JAL r31, r0, :outl
|
||||||
JAL r31, r0, :inl
|
JAL r31, r0, :inl
|
||||||
LD r31, r254, 0a, 16h
|
LD r31, r254, 0a, 8h
|
||||||
ADDI64 r254, r254, 16d
|
ADDI64 r254, r254, 8d
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
outl:
|
outl:
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
main:
|
main:
|
||||||
ADDI64 r254, r254, -41d
|
ADDI64 r254, r254, -1d
|
||||||
ST r32, r254, 1a, 40h
|
|
||||||
LI64 r14, 255d
|
LI64 r14, 255d
|
||||||
LI8 r13, 1b
|
LI8 r13, 1b
|
||||||
ST r0, r254, 0a, 1h
|
ST r0, r254, 0a, 1h
|
||||||
|
@ -20,10 +19,9 @@ main:
|
||||||
1: ADD8 r15, r15, r13
|
1: ADD8 r15, r15, r13
|
||||||
ST r15, r254, 0a, 1h
|
ST r15, r254, 0a, 1h
|
||||||
JMP :2
|
JMP :2
|
||||||
LD r32, r254, 1a, 40h
|
ADDI64 r254, r254, 1d
|
||||||
ADDI64 r254, r254, 41d
|
|
||||||
JALA r0, r31, 0a
|
JALA r0, r31, 0a
|
||||||
timed out
|
timed out
|
||||||
code size: 204
|
code size: 178
|
||||||
ret: 0
|
ret: 0
|
||||||
status: Ok(())
|
status: Ok(())
|
||||||
|
|
Loading…
Reference in a new issue