Skip to content

Commit

Permalink
fix some minor issue
Browse files Browse the repository at this point in the history
  • Loading branch information
glyh committed Oct 23, 2024
1 parent eb44efb commit 8ad7f89
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ __pycache__

test/*
!test/test_src
!test/longer-cases
!test/script.gdb
!test/build_*
!test/run_*
Expand Down
2 changes: 1 addition & 1 deletion src/riscv/before_alloc.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn reserve_swap_reg(cfg : @ssacfg.SsaCfg, block : @ssacfg.Block) -> Unit {
match inst {
Prim(bind, Math(_) | Eq | Le as op, [lhs, rhs]) as inst =>
if is_imm(lhs) && is_imm(rhs) {
let tmp = cfg.new_named("tmp_swap", ty=Double)
let tmp = cfg.new_named("tmp_swap", ty=lhs.get_type())
insts.push(@ssacfg.Inst::Copy(tmp, lhs))
insts.push(Prim(bind, op, [Var(tmp), rhs]))
} else {
Expand Down
3 changes: 3 additions & 0 deletions src/riscv/extern_stub.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ fn generate_stub(cfg : @ssacfg.SsaCfg) -> AssemblyFunction {
body.append(
[
Label(stub_resolved),
Comment("Round down the stack for alignment, giving up the space"),
Li(T5, "-16"),
And(Sp, Sp, T5),
Comment("Call the external function"),
Jalr(T6),
Comment("Put continuation at \{kont_reg}"),
Expand Down

0 comments on commit 8ad7f89

Please sign in to comment.