Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mips instructions needed for executing mini-starcoin-vm #14

Open
42 of 61 tasks
templexxx opened this issue Sep 20, 2022 · 0 comments
Open
42 of 61 tasks

mips instructions needed for executing mini-starcoin-vm #14

templexxx opened this issue Sep 20, 2022 · 0 comments

Comments

@templexxx
Copy link
Collaborator

templexxx commented Sep 20, 2022

  • lw
  • sw
  • addiu
  • sll
  • or
  • addu
  • beq
  • jalr
  • sltu
  • bne
  • xor
  • srl
  • lbu
  • lwr
  • lwl
  • sb
  • swr
  • swl
  • mfhi
  • bgezal
  • lui
  • break
  • mflo
  • subu
  • and
  • andi
  • sltiu
  • multu
  • jr
  • lhu
  • ori
  • movz
  • mtlo
  • mthi
  • sh
  • movn
  • nor
  • bltz
  • xori
  • sync
  • bgez
  • clz
  • sra
  • sc
  • ll
  • lb
  • sllv
  • mul
  • srlv
  • slti
  • slt
  • maddu
  • blez
  • syscall
  • lh
  • divu
  • mult
  • teq
  • bgtz
  • srav
  • div

how to get the result:

  1. using this profile.release in Cargo.toml:
[profile.release]
strip=true
lto=true
panic = "abort"
  1. release the min-starcoin-vm with changes in this commit
  2. using objdump inside this toolchain to disassembler executable sections:
mips-linux-musl-objdump -d mini-starcoin-vm > exec.obj
  1. using this mips disassembler tool to get instructions:
cat exec.obj | awk '{print $1, $2}' | mipsdis - > exec.dis
  1. get pure instructions: cat exec.dis | awk '{print $3}' > ins
  2. combine instructions and sort them: perl -0777 -lape's/\s+/\n/g' ins | sort | uniq -c | sort -nr > ins_sort
  3. cat ins_sort | awk '{print $2}' > used_ins
  4. remove meaningless illegal

Close #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant