Skip to content

Instantly share code, notes, and snippets.

@dramforever
Last active April 6, 2023 16:16
Show Gist options
  • Save dramforever/24437f2524f09954bffa9196f03e5523 to your computer and use it in GitHub Desktop.
Save dramforever/24437f2524f09954bffa9196f03e5523 to your computer and use it in GitHub Desktop.
How much RISC-V instruction space do we have left?

If you really want to use this janky code:

$ git clone https://github.com/riscv/riscv-opcodes
$ # You need like a patch to fix extension handling... might submit PR in a bit
$ python3 parse.py rv_* rv64_*
$ yaml2json < instr_dict.yaml > instr_dict.json # Sorry
$ python3 free-space.py

Summary:

Total of 84.42% RISC-V encoding space is used
  ... 73.51% is RVC
  ... 10.91% is 32-bit instructions
43.63% of >= 32-bit encoding is used
import json
from collections import Counter
def info_good(info):
# Ignore Zcmt and Zcmp
return not any('_zcmt' in e or '_zcmp' in e for e in info['extension'])
def get_instr_space(info):
n = int(info['mask'], 0).bit_count()
return 2 ** (32 - n)
def get_space_by_ext(data):
ctr = Counter()
for name, info in data.items():
ctr['/'.join(info['extension'])] += get_instr_space(info)
return ctr
if __name__ == '__main__':
with open('instr_dict.json', 'rb') as instr_dict:
data = json.load(instr_dict)
data = { name: info for name, info in data.items() if info_good(info) }
per_instr_space = { name: get_instr_space(info) for name, info in data.items() }
print('By instruction:')
for name, space in sorted(per_instr_space.items(), key=lambda i: (-i[1], i[0])):
norm_name = name.replace('_', '.')
print(f'{norm_name} {space / 2**32:.2g}')
print()
print('By extension:')
per_ext_space = get_space_by_ext(data)
for name, space in sorted(per_ext_space.items(), key=lambda i: (-i[1], i[0])):
print(f'{name} {space / 2**32:.2g}')
print()
total_used = sum(per_instr_space.values())
total_free = 2**32 - total_used
print(f'Total of {100 * total_used / 2**32:.2f}% RISC-V encoding space is used')
rvc_used = sum(use for name, use in per_ext_space.items() if '_c' in name or '_zc' in name)
print(f' ... {100 * rvc_used / 2**32:.2f}% is RVC')
print(f' ... {100 * (total_used - rvc_used) / 2**32:.2f}% is 32-bit instructions')
print(f'{100 * (total_used - rvc_used) / (2**32 / 4):.2f}% of >= 32-bit encoding is used')
diff --git a/parse.py b/parse.py
index 9714e99..47846b7 100755
--- a/parse.py
+++ b/parse.py
@@ -247,8 +247,10 @@ def create_inst_dict(file_filter, include_pseudo=False, include_pseudo_ops=[]):
err_msg += f'added from {item["extension"]} in same base extensions'
logging.error(err_msg)
raise SystemExit(1)
- # update the final dict with the instruction
- instr_dict[name] = single_dict
+
+ if name not in instr_dict:
+ # update the final dict with the instruction
+ instr_dict[name] = single_dict
# second pass if for pseudo instructions
logging.debug('Collecting pseudo instructions now')
@@ -382,10 +384,10 @@ def create_inst_dict(file_filter, include_pseudo=False, include_pseudo_ops=[]):
err_msg += f'added from {var} but each have different encodings for the same instruction'
logging.error(err_msg)
raise SystemExit(1)
- instr_dict[name]['extension'].append(single_dict['extension'])
-
- # update the final dict with the instruction
- instr_dict[name] = single_dict
+ instr_dict[name]['extension'].extend(single_dict['extension'])
+ else:
+ # update the final dict with the instruction
+ instr_dict[name] = single_dict
return instr_dict
def make_priv_latex_table():
By instruction:
c.addi 0.031
c.addi4spn 0.031
c.addiw 0.031
c.beqz 0.031
c.bnez 0.031
c.fld 0.031
c.fldsp 0.031
c.fsd 0.031
c.fsdsp 0.031
c.j 0.031
c.ld 0.031
c.ldsp 0.031
c.li 0.031
c.lui 0.031
c.lw 0.031
c.lwsp 0.031
c.sd 0.031
c.sdsp 0.031
c.slli 0.031
c.sw 0.031
c.swsp 0.031
c.add 0.016
c.mv 0.016
auipc 0.0078
c.andi 0.0078
c.srai 0.0078
c.srli 0.0078
jal 0.0078
lui 0.0078
c.lbu 0.0039
c.sb 0.0039
c.lh 0.002
c.lhu 0.002
c.sh 0.002
fmadd.d 0.002
fmadd.h 0.002
fmadd.q 0.002
fmadd.s 0.002
fmsub.d 0.002
fmsub.h 0.002
fmsub.q 0.002
fmsub.s 0.002
fnmadd.d 0.002
fnmadd.h 0.002
fnmadd.q 0.002
fnmadd.s 0.002
fnmsub.d 0.002
fnmsub.h 0.002
fnmsub.q 0.002
fnmsub.s 0.002
addi 0.00098
addiw 0.00098
andi 0.00098
beq 0.00098
bge 0.00098
bgeu 0.00098
blt 0.00098
bltu 0.00098
bne 0.00098
c.addi16sp 0.00098
c.addw 0.00098
c.and 0.00098
c.mul 0.00098
c.nop 0.00098
c.or 0.00098
c.sub 0.00098
c.subw 0.00098
c.xor 0.00098
csrrc 0.00098
csrrci 0.00098
csrrs 0.00098
csrrsi 0.00098
csrrw 0.00098
csrrwi 0.00098
fence 0.00098
fence.i 0.00098
fld 0.00098
flh 0.00098
flq 0.00098
flw 0.00098
fsd 0.00098
fsh 0.00098
fsq 0.00098
fsw 0.00098
jalr 0.00098
lb 0.00098
lbu 0.00098
ld 0.00098
lh 0.00098
lhu 0.00098
lw 0.00098
lwu 0.00098
ori 0.00098
sb 0.00098
sd 0.00098
sh 0.00098
slti 0.00098
sltiu 0.00098
sw 0.00098
xori 0.00098
c.jalr 0.00049
c.jr 0.00049
vsetvli 0.00049
vsetivli 0.00024
c.not 0.00012
c.sext.b 0.00012
c.sext.h 0.00012
c.zext.b 0.00012
c.zext.h 0.00012
c.zext.w 0.00012
vloxei1024.v 0.00012
vloxei128.v 0.00012
vloxei16.v 0.00012
vloxei256.v 0.00012
vloxei32.v 0.00012
vloxei512.v 0.00012
vloxei64.v 0.00012
vloxei8.v 0.00012
vlse1024.v 0.00012
vlse128.v 0.00012
vlse16.v 0.00012
vlse256.v 0.00012
vlse32.v 0.00012
vlse512.v 0.00012
vlse64.v 0.00012
vlse8.v 0.00012
vluxei1024.v 0.00012
vluxei128.v 0.00012
vluxei16.v 0.00012
vluxei256.v 0.00012
vluxei32.v 0.00012
vluxei512.v 0.00012
vluxei64.v 0.00012
vluxei8.v 0.00012
vsoxei1024.v 0.00012
vsoxei128.v 0.00012
vsoxei16.v 0.00012
vsoxei256.v 0.00012
vsoxei32.v 0.00012
vsoxei512.v 0.00012
vsoxei64.v 0.00012
vsoxei8.v 0.00012
vsse1024.v 0.00012
vsse128.v 0.00012
vsse16.v 0.00012
vsse256.v 0.00012
vsse32.v 0.00012
vsse512.v 0.00012
vsse64.v 0.00012
vsse8.v 0.00012
vsuxei1024.v 0.00012
vsuxei128.v 0.00012
vsuxei16.v 0.00012
vsuxei256.v 0.00012
vsuxei32.v 0.00012
vsuxei512.v 0.00012
vsuxei64.v 0.00012
vsuxei8.v 0.00012
fadd.d 6.1e-05
fadd.h 6.1e-05
fadd.q 6.1e-05
fadd.s 6.1e-05
fdiv.d 6.1e-05
fdiv.h 6.1e-05
fdiv.q 6.1e-05
fdiv.s 6.1e-05
fmul.d 6.1e-05
fmul.h 6.1e-05
fmul.q 6.1e-05
fmul.s 6.1e-05
fsub.d 6.1e-05
fsub.h 6.1e-05
fsub.q 6.1e-05
fsub.s 6.1e-05
amoadd.d 3.1e-05
amoadd.w 3.1e-05
amoand.d 3.1e-05
amoand.w 3.1e-05
amomax.d 3.1e-05
amomax.w 3.1e-05
amomaxu.d 3.1e-05
amomaxu.w 3.1e-05
amomin.d 3.1e-05
amomin.w 3.1e-05
amominu.d 3.1e-05
amominu.w 3.1e-05
amoor.d 3.1e-05
amoor.w 3.1e-05
amoswap.d 3.1e-05
amoswap.w 3.1e-05
amoxor.d 3.1e-05
amoxor.w 3.1e-05
sc.d 3.1e-05
sc.w 3.1e-05
sm4ed 3.1e-05
sm4ks 3.1e-05
vamoaddei16.v 3.1e-05
vamoaddei32.v 3.1e-05
vamoaddei64.v 3.1e-05
vamoaddei8.v 3.1e-05
vamoandei16.v 3.1e-05
vamoandei32.v 3.1e-05
vamoandei64.v 3.1e-05
vamoandei8.v 3.1e-05
vamomaxei16.v 3.1e-05
vamomaxei32.v 3.1e-05
vamomaxei64.v 3.1e-05
vamomaxei8.v 3.1e-05
vamomaxuei16.v 3.1e-05
vamomaxuei32.v 3.1e-05
vamomaxuei64.v 3.1e-05
vamomaxuei8.v 3.1e-05
vamominei16.v 3.1e-05
vamominei32.v 3.1e-05
vamominei64.v 3.1e-05
vamominei8.v 3.1e-05
vamominuei16.v 3.1e-05
vamominuei32.v 3.1e-05
vamominuei64.v 3.1e-05
vamominuei8.v 3.1e-05
vamoorei16.v 3.1e-05
vamoorei32.v 3.1e-05
vamoorei64.v 3.1e-05
vamoorei8.v 3.1e-05
vamoswapei16.v 3.1e-05
vamoswapei32.v 3.1e-05
vamoswapei64.v 3.1e-05
vamoswapei8.v 3.1e-05
vamoxorei16.v 3.1e-05
vamoxorei32.v 3.1e-05
vamoxorei64.v 3.1e-05
vamoxorei8.v 3.1e-05
bclri 1.5e-05
bexti 1.5e-05
binvi 1.5e-05
bseti 1.5e-05
c.ebreak 1.5e-05
rori 1.5e-05
slli 1.5e-05
slli.uw 1.5e-05
srai 1.5e-05
srli 1.5e-05
vaadd.vv 1.5e-05
vaadd.vx 1.5e-05
vaaddu.vv 1.5e-05
vaaddu.vx 1.5e-05
vadd.vi 1.5e-05
vadd.vv 1.5e-05
vadd.vx 1.5e-05
vand.vi 1.5e-05
vand.vv 1.5e-05
vand.vx 1.5e-05
vasub.vv 1.5e-05
vasub.vx 1.5e-05
vasubu.vv 1.5e-05
vasubu.vx 1.5e-05
vdiv.vv 1.5e-05
vdiv.vx 1.5e-05
vdivu.vv 1.5e-05
vdivu.vx 1.5e-05
vfadd.vf 1.5e-05
vfadd.vv 1.5e-05
vfdiv.vf 1.5e-05
vfdiv.vv 1.5e-05
vfmacc.vf 1.5e-05
vfmacc.vv 1.5e-05
vfmadd.vf 1.5e-05
vfmadd.vv 1.5e-05
vfmax.vf 1.5e-05
vfmax.vv 1.5e-05
vfmin.vf 1.5e-05
vfmin.vv 1.5e-05
vfmsac.vf 1.5e-05
vfmsac.vv 1.5e-05
vfmsub.vf 1.5e-05
vfmsub.vv 1.5e-05
vfmul.vf 1.5e-05
vfmul.vv 1.5e-05
vfnmacc.vf 1.5e-05
vfnmacc.vv 1.5e-05
vfnmadd.vf 1.5e-05
vfnmadd.vv 1.5e-05
vfnmsac.vf 1.5e-05
vfnmsac.vv 1.5e-05
vfnmsub.vf 1.5e-05
vfnmsub.vv 1.5e-05
vfrdiv.vf 1.5e-05
vfredmax.vs 1.5e-05
vfredmin.vs 1.5e-05
vfredosum.vs 1.5e-05
vfredusum.vs 1.5e-05
vfrsub.vf 1.5e-05
vfsgnj.vf 1.5e-05
vfsgnj.vv 1.5e-05
vfsgnjn.vf 1.5e-05
vfsgnjn.vv 1.5e-05
vfsgnjx.vf 1.5e-05
vfsgnjx.vv 1.5e-05
vfslide1down.vf 1.5e-05
vfslide1up.vf 1.5e-05
vfsub.vf 1.5e-05
vfsub.vv 1.5e-05
vfwadd.vf 1.5e-05
vfwadd.vv 1.5e-05
vfwadd.wf 1.5e-05
vfwadd.wv 1.5e-05
vfwmacc.vf 1.5e-05
vfwmacc.vv 1.5e-05
vfwmsac.vf 1.5e-05
vfwmsac.vv 1.5e-05
vfwmul.vf 1.5e-05
vfwmul.vv 1.5e-05
vfwnmacc.vf 1.5e-05
vfwnmacc.vv 1.5e-05
vfwnmsac.vf 1.5e-05
vfwnmsac.vv 1.5e-05
vfwredosum.vs 1.5e-05
vfwredusum.vs 1.5e-05
vfwsub.vf 1.5e-05
vfwsub.vv 1.5e-05
vfwsub.wf 1.5e-05
vfwsub.wv 1.5e-05
vmacc.vv 1.5e-05
vmacc.vx 1.5e-05
vmadd.vv 1.5e-05
vmadd.vx 1.5e-05
vmand.mm 1.5e-05
vmandn.mm 1.5e-05
vmax.vv 1.5e-05
vmax.vx 1.5e-05
vmaxu.vv 1.5e-05
vmaxu.vx 1.5e-05
vmfeq.vf 1.5e-05
vmfeq.vv 1.5e-05
vmfge.vf 1.5e-05
vmfgt.vf 1.5e-05
vmfle.vf 1.5e-05
vmfle.vv 1.5e-05
vmflt.vf 1.5e-05
vmflt.vv 1.5e-05
vmfne.vf 1.5e-05
vmfne.vv 1.5e-05
vmin.vv 1.5e-05
vmin.vx 1.5e-05
vminu.vv 1.5e-05
vminu.vx 1.5e-05
vmnand.mm 1.5e-05
vmnor.mm 1.5e-05
vmor.mm 1.5e-05
vmorn.mm 1.5e-05
vmseq.vi 1.5e-05
vmseq.vv 1.5e-05
vmseq.vx 1.5e-05
vmsgt.vi 1.5e-05
vmsgt.vx 1.5e-05
vmsgtu.vi 1.5e-05
vmsgtu.vx 1.5e-05
vmsle.vi 1.5e-05
vmsle.vv 1.5e-05
vmsle.vx 1.5e-05
vmsleu.vi 1.5e-05
vmsleu.vv 1.5e-05
vmsleu.vx 1.5e-05
vmslt.vv 1.5e-05
vmslt.vx 1.5e-05
vmsltu.vv 1.5e-05
vmsltu.vx 1.5e-05
vmsne.vi 1.5e-05
vmsne.vv 1.5e-05
vmsne.vx 1.5e-05
vmul.vv 1.5e-05
vmul.vx 1.5e-05
vmulh.vv 1.5e-05
vmulh.vx 1.5e-05
vmulhsu.vv 1.5e-05
vmulhsu.vx 1.5e-05
vmulhu.vv 1.5e-05
vmulhu.vx 1.5e-05
vmxnor.mm 1.5e-05
vmxor.mm 1.5e-05
vnclip.wi 1.5e-05
vnclip.wv 1.5e-05
vnclip.wx 1.5e-05
vnclipu.wi 1.5e-05
vnclipu.wv 1.5e-05
vnclipu.wx 1.5e-05
vnmsac.vv 1.5e-05
vnmsac.vx 1.5e-05
vnmsub.vv 1.5e-05
vnmsub.vx 1.5e-05
vnsra.wi 1.5e-05
vnsra.wv 1.5e-05
vnsra.wx 1.5e-05
vnsrl.wi 1.5e-05
vnsrl.wv 1.5e-05
vnsrl.wx 1.5e-05
vor.vi 1.5e-05
vor.vv 1.5e-05
vor.vx 1.5e-05
vredand.vs 1.5e-05
vredmax.vs 1.5e-05
vredmaxu.vs 1.5e-05
vredmin.vs 1.5e-05
vredminu.vs 1.5e-05
vredor.vs 1.5e-05
vredsum.vs 1.5e-05
vredxor.vs 1.5e-05
vrem.vv 1.5e-05
vrem.vx 1.5e-05
vremu.vv 1.5e-05
vremu.vx 1.5e-05
vrgather.vi 1.5e-05
vrgather.vv 1.5e-05
vrgather.vx 1.5e-05
vrgatherei16.vv 1.5e-05
vrsub.vi 1.5e-05
vrsub.vx 1.5e-05
vsadd.vi 1.5e-05
vsadd.vv 1.5e-05
vsadd.vx 1.5e-05
vsaddu.vi 1.5e-05
vsaddu.vv 1.5e-05
vsaddu.vx 1.5e-05
vslide1down.vx 1.5e-05
vslide1up.vx 1.5e-05
vslidedown.vi 1.5e-05
vslidedown.vx 1.5e-05
vslideup.vi 1.5e-05
vslideup.vx 1.5e-05
vsll.vi 1.5e-05
vsll.vv 1.5e-05
vsll.vx 1.5e-05
vsmul.vv 1.5e-05
vsmul.vx 1.5e-05
vsra.vi 1.5e-05
vsra.vv 1.5e-05
vsra.vx 1.5e-05
vsrl.vi 1.5e-05
vsrl.vv 1.5e-05
vsrl.vx 1.5e-05
vssra.vi 1.5e-05
vssra.vv 1.5e-05
vssra.vx 1.5e-05
vssrl.vi 1.5e-05
vssrl.vv 1.5e-05
vssrl.vx 1.5e-05
vssub.vv 1.5e-05
vssub.vx 1.5e-05
vssubu.vv 1.5e-05
vssubu.vx 1.5e-05
vsub.vv 1.5e-05
vsub.vx 1.5e-05
vwadd.vv 1.5e-05
vwadd.vx 1.5e-05
vwadd.wv 1.5e-05
vwadd.wx 1.5e-05
vwaddu.vv 1.5e-05
vwaddu.vx 1.5e-05
vwaddu.wv 1.5e-05
vwaddu.wx 1.5e-05
vwmacc.vv 1.5e-05
vwmacc.vx 1.5e-05
vwmaccsu.vv 1.5e-05
vwmaccsu.vx 1.5e-05
vwmaccu.vv 1.5e-05
vwmaccu.vx 1.5e-05
vwmaccus.vx 1.5e-05
vwmul.vv 1.5e-05
vwmul.vx 1.5e-05
vwmulsu.vv 1.5e-05
vwmulsu.vx 1.5e-05
vwmulu.vv 1.5e-05
vwmulu.vx 1.5e-05
vwredsum.vs 1.5e-05
vwredsumu.vs 1.5e-05
vwsub.vv 1.5e-05
vwsub.vx 1.5e-05
vwsub.wv 1.5e-05
vwsub.wx 1.5e-05
vwsubu.vv 1.5e-05
vwsubu.vx 1.5e-05
vwsubu.wv 1.5e-05
vwsubu.wx 1.5e-05
vxor.vi 1.5e-05
vxor.vv 1.5e-05
vxor.vx 1.5e-05
add 7.6e-06
add.uw 7.6e-06
addw 7.6e-06
aes64ds 7.6e-06
aes64dsm 7.6e-06
aes64es 7.6e-06
aes64esm 7.6e-06
aes64ks2 7.6e-06
and 7.6e-06
andn 7.6e-06
bclr 7.6e-06
bext 7.6e-06
binv 7.6e-06
bset 7.6e-06
clmul 7.6e-06
clmulh 7.6e-06
clmulr 7.6e-06
div 7.6e-06
divu 7.6e-06
divuw 7.6e-06
divw 7.6e-06
feq.d 7.6e-06
feq.h 7.6e-06
feq.q 7.6e-06
feq.s 7.6e-06
fle.d 7.6e-06
fle.h 7.6e-06
fle.q 7.6e-06
fle.s 7.6e-06
flt.d 7.6e-06
flt.h 7.6e-06
flt.q 7.6e-06
flt.s 7.6e-06
fmax.d 7.6e-06
fmax.h 7.6e-06
fmax.q 7.6e-06
fmax.s 7.6e-06
fmin.d 7.6e-06
fmin.h 7.6e-06
fmin.q 7.6e-06
fmin.s 7.6e-06
fsgnj.d 7.6e-06
fsgnj.h 7.6e-06
fsgnj.q 7.6e-06
fsgnj.s 7.6e-06
fsgnjn.d 7.6e-06
fsgnjn.h 7.6e-06
fsgnjn.q 7.6e-06
fsgnjn.s 7.6e-06
fsgnjx.d 7.6e-06
fsgnjx.h 7.6e-06
fsgnjx.q 7.6e-06
fsgnjx.s 7.6e-06
max 7.6e-06
maxu 7.6e-06
min 7.6e-06
minu 7.6e-06
mul 7.6e-06
mulh 7.6e-06
mulhsu 7.6e-06
mulhu 7.6e-06
mulw 7.6e-06
or 7.6e-06
orn 7.6e-06
pack 7.6e-06
packh 7.6e-06
packw 7.6e-06
rem 7.6e-06
remu 7.6e-06
remuw 7.6e-06
remw 7.6e-06
rol 7.6e-06
rolw 7.6e-06
ror 7.6e-06
roriw 7.6e-06
rorw 7.6e-06
sh1add 7.6e-06
sh1add.uw 7.6e-06
sh2add 7.6e-06
sh2add.uw 7.6e-06
sh3add 7.6e-06
sh3add.uw 7.6e-06
sll 7.6e-06
slliw 7.6e-06
sllw 7.6e-06
slt 7.6e-06
sltu 7.6e-06
sra 7.6e-06
sraiw 7.6e-06
sraw 7.6e-06
srl 7.6e-06
srliw 7.6e-06
srlw 7.6e-06
sub 7.6e-06
subw 7.6e-06
vadc.vim 7.6e-06
vadc.vvm 7.6e-06
vadc.vxm 7.6e-06
vcompress.vm 7.6e-06
vfmerge.vfm 7.6e-06
vmadc.vi 7.6e-06
vmadc.vim 7.6e-06
vmadc.vv 7.6e-06
vmadc.vvm 7.6e-06
vmadc.vx 7.6e-06
vmadc.vxm 7.6e-06
vmerge.vim 7.6e-06
vmerge.vvm 7.6e-06
vmerge.vxm 7.6e-06
vmsbc.vv 7.6e-06
vmsbc.vvm 7.6e-06
vmsbc.vx 7.6e-06
vmsbc.vxm 7.6e-06
vsbc.vvm 7.6e-06
vsbc.vxm 7.6e-06
vsetvl 7.6e-06
xnor 7.6e-06
xor 7.6e-06
xperm4 7.6e-06
xperm8 7.6e-06
aes64ks1i 3.8e-06
vle1024.v 3.8e-06
vle1024ff.v 3.8e-06
vle128.v 3.8e-06
vle128ff.v 3.8e-06
vle16.v 3.8e-06
vle16ff.v 3.8e-06
vle256.v 3.8e-06
vle256ff.v 3.8e-06
vle32.v 3.8e-06
vle32ff.v 3.8e-06
vle512.v 3.8e-06
vle512ff.v 3.8e-06
vle64.v 3.8e-06
vle64ff.v 3.8e-06
vle8.v 3.8e-06
vle8ff.v 3.8e-06
vse1024.v 3.8e-06
vse128.v 3.8e-06
vse16.v 3.8e-06
vse256.v 3.8e-06
vse32.v 3.8e-06
vse512.v 3.8e-06
vse64.v 3.8e-06
vse8.v 3.8e-06
fcvt.d.h 1.9e-06
fcvt.d.l 1.9e-06
fcvt.d.lu 1.9e-06
fcvt.d.q 1.9e-06
fcvt.d.s 1.9e-06
fcvt.d.w 1.9e-06
fcvt.d.wu 1.9e-06
fcvt.h.d 1.9e-06
fcvt.h.l 1.9e-06
fcvt.h.lu 1.9e-06
fcvt.h.q 1.9e-06
fcvt.h.s 1.9e-06
fcvt.h.w 1.9e-06
fcvt.h.wu 1.9e-06
fcvt.l.d 1.9e-06
fcvt.l.h 1.9e-06
fcvt.l.q 1.9e-06
fcvt.l.s 1.9e-06
fcvt.lu.d 1.9e-06
fcvt.lu.h 1.9e-06
fcvt.lu.q 1.9e-06
fcvt.lu.s 1.9e-06
fcvt.q.d 1.9e-06
fcvt.q.h 1.9e-06
fcvt.q.l 1.9e-06
fcvt.q.lu 1.9e-06
fcvt.q.s 1.9e-06
fcvt.q.w 1.9e-06
fcvt.q.wu 1.9e-06
fcvt.s.d 1.9e-06
fcvt.s.h 1.9e-06
fcvt.s.l 1.9e-06
fcvt.s.lu 1.9e-06
fcvt.s.q 1.9e-06
fcvt.s.w 1.9e-06
fcvt.s.wu 1.9e-06
fcvt.w.d 1.9e-06
fcvt.w.h 1.9e-06
fcvt.w.q 1.9e-06
fcvt.w.s 1.9e-06
fcvt.wu.d 1.9e-06
fcvt.wu.h 1.9e-06
fcvt.wu.q 1.9e-06
fcvt.wu.s 1.9e-06
fsqrt.d 1.9e-06
fsqrt.h 1.9e-06
fsqrt.q 1.9e-06
fsqrt.s 1.9e-06
lr.d 9.5e-07
lr.w 9.5e-07
vcpop.m 4.8e-07
vfclass.v 4.8e-07
vfcvt.f.x.v 4.8e-07
vfcvt.f.xu.v 4.8e-07
vfcvt.rtz.x.f.v 4.8e-07
vfcvt.rtz.xu.f.v 4.8e-07
vfcvt.x.f.v 4.8e-07
vfcvt.xu.f.v 4.8e-07
vfirst.m 4.8e-07
vfncvt.f.f.w 4.8e-07
vfncvt.f.x.w 4.8e-07
vfncvt.f.xu.w 4.8e-07
vfncvt.rod.f.f.w 4.8e-07
vfncvt.rtz.x.f.w 4.8e-07
vfncvt.rtz.xu.f.w 4.8e-07
vfncvt.x.f.w 4.8e-07
vfncvt.xu.f.w 4.8e-07
vfrec7.v 4.8e-07
vfrsqrt7.v 4.8e-07
vfsqrt.v 4.8e-07
vfwcvt.f.f.v 4.8e-07
vfwcvt.f.x.v 4.8e-07
vfwcvt.f.xu.v 4.8e-07
vfwcvt.rtz.x.f.v 4.8e-07
vfwcvt.rtz.xu.f.v 4.8e-07
vfwcvt.x.f.v 4.8e-07
vfwcvt.xu.f.v 4.8e-07
viota.m 4.8e-07
vmsbf.m 4.8e-07
vmsif.m 4.8e-07
vmsof.m 4.8e-07
vsext.vf2 4.8e-07
vsext.vf4 4.8e-07
vsext.vf8 4.8e-07
vzext.vf2 4.8e-07
vzext.vf4 4.8e-07
vzext.vf8 4.8e-07
aes64im 2.4e-07
brev8 2.4e-07
clz 2.4e-07
clzw 2.4e-07
cpop 2.4e-07
cpopw 2.4e-07
ctz 2.4e-07
ctzw 2.4e-07
fclass.d 2.4e-07
fclass.h 2.4e-07
fclass.q 2.4e-07
fclass.s 2.4e-07
fmv.d.x 2.4e-07
fmv.h.x 2.4e-07
fmv.w.x 2.4e-07
fmv.x.d 2.4e-07
fmv.x.h 2.4e-07
fmv.x.w 2.4e-07
hfence.gvma 2.4e-07
hfence.vvma 2.4e-07
hinval.gvma 2.4e-07
hinval.vvma 2.4e-07
hlv.b 2.4e-07
hlv.bu 2.4e-07
hlv.d 2.4e-07
hlv.h 2.4e-07
hlv.hu 2.4e-07
hlv.w 2.4e-07
hlv.wu 2.4e-07
hlvx.hu 2.4e-07
hlvx.wu 2.4e-07
hsv.b 2.4e-07
hsv.d 2.4e-07
hsv.h 2.4e-07
hsv.w 2.4e-07
orc.b 2.4e-07
rev8 2.4e-07
sext.b 2.4e-07
sext.h 2.4e-07
sfence.vma 2.4e-07
sha256sig0 2.4e-07
sha256sig1 2.4e-07
sha256sum0 2.4e-07
sha256sum1 2.4e-07
sha512sig0 2.4e-07
sha512sig1 2.4e-07
sha512sum0 2.4e-07
sha512sum1 2.4e-07
sinval.vma 2.4e-07
sm3p0 2.4e-07
sm3p1 2.4e-07
vfmv.f.s 2.4e-07
vfmv.s.f 2.4e-07
vfmv.v.f 2.4e-07
vl1re16.v 2.4e-07
vl1re32.v 2.4e-07
vl1re64.v 2.4e-07
vl1re8.v 2.4e-07
vl2re16.v 2.4e-07
vl2re32.v 2.4e-07
vl2re64.v 2.4e-07
vl2re8.v 2.4e-07
vl4re16.v 2.4e-07
vl4re32.v 2.4e-07
vl4re64.v 2.4e-07
vl4re8.v 2.4e-07
vl8re16.v 2.4e-07
vl8re32.v 2.4e-07
vl8re64.v 2.4e-07
vl8re8.v 2.4e-07
vlm.v 2.4e-07
vmv1r.v 2.4e-07
vmv2r.v 2.4e-07
vmv4r.v 2.4e-07
vmv8r.v 2.4e-07
vmv.s.x 2.4e-07
vmv.v.i 2.4e-07
vmv.v.v 2.4e-07
vmv.v.x 2.4e-07
vmv.x.s 2.4e-07
vs1r.v 2.4e-07
vs2r.v 2.4e-07
vs4r.v 2.4e-07
vs8r.v 2.4e-07
vsm.v 2.4e-07
zext.h 2.4e-07
vid.v 1.5e-08
cbo.clean 7.5e-09
cbo.flush 7.5e-09
cbo.inval 7.5e-09
cbo.zero 7.5e-09
dret 2.3e-10
ebreak 2.3e-10
ecall 2.3e-10
mret 2.3e-10
sfence.inval.ir 2.3e-10
sfence.w.inval 2.3e-10
sret 2.3e-10
wfi 2.3e-10
wrs.nto 2.3e-10
wrs.sto 2.3e-10
By extension:
rv_c 0.39
rv64_c 0.21
rv_c_d 0.12
rv_i 0.045
rv_zcb 0.015
rv_v 0.012
rv_q 0.01
rv_zfh 0.01
rv_d 0.01
rv_f 0.01
rv_zicsr 0.0059
rv64_i 0.004
rv_zifencei 0.00098
rv64_a 0.00031
rv_a 0.00031
rv64_zcb 0.00012
rv64_zbs 6.1e-05
rv_m 6.1e-05
rv_zksed 6.1e-05
rv64_zba 4.6e-05
rv64_m 3.8e-05
rv64_zbb/rv64_zbkb 3.8e-05
rv_zbb/rv_zbkb 3.8e-05
rv_zbb 3.2e-05
rv_zbs 3.1e-05
rv_zba 2.3e-05
rv64_zknd 1.5e-05
rv_zbkb 1.5e-05
rv64_zkne 1.5e-05
rv_zbc/rv_zbkc 1.5e-05
rv_zbkx 1.5e-05
rv64_zknd/rv64_zkne 1.1e-05
rv64_d 8.1e-06
rv64_zbkb 7.9e-06
rv64_f 7.6e-06
rv64_q 7.6e-06
rv64_zfh 7.6e-06
rv_zbc 7.6e-06
rv_d_zfh 3.8e-06
rv_q_zfh 3.8e-06
rv_h 2.9e-06
rv64_zbb 9.5e-07
rv64_zknh 9.5e-07
rv_zknh 9.5e-07
rv_svinval 7.2e-07
rv64_h 7.2e-07
rv_zksh 4.8e-07
rv_s 2.4e-07
rv_zicbo 3e-08
rv_system 7e-10
rv_zawrs 4.7e-10
Total of 84.42% RISC-V encoding space is used
... 73.51% is RVC
... 10.91% is 32-bit instructions
43.63% of >= 32-bit encoding is used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment