aarch64 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CODE_OF_CONDUCT.md +77 -0
- data/Gemfile +3 -0
- data/LICENSE +201 -0
- data/README.md +77 -0
- data/Rakefile +168 -0
- data/aarch64.gemspec +21 -0
- data/bin/build_instructions.rb +102 -0
- data/lib/aarch64/instructions/adc.rb +31 -0
- data/lib/aarch64/instructions/adcs.rb +30 -0
- data/lib/aarch64/instructions/add_addsub_ext.rb +35 -0
- data/lib/aarch64/instructions/add_addsub_imm.rb +32 -0
- data/lib/aarch64/instructions/add_addsub_shift.rb +35 -0
- data/lib/aarch64/instructions/addg.rb +30 -0
- data/lib/aarch64/instructions/adds_addsub_ext.rb +35 -0
- data/lib/aarch64/instructions/adds_addsub_imm.rb +33 -0
- data/lib/aarch64/instructions/adds_addsub_shift.rb +35 -0
- data/lib/aarch64/instructions/adr.rb +28 -0
- data/lib/aarch64/instructions/adrp.rb +28 -0
- data/lib/aarch64/instructions/and_log_imm.rb +35 -0
- data/lib/aarch64/instructions/and_log_shift.rb +35 -0
- data/lib/aarch64/instructions/ands_log_imm.rb +35 -0
- data/lib/aarch64/instructions/ands_log_shift.rb +35 -0
- data/lib/aarch64/instructions/asrv.rb +31 -0
- data/lib/aarch64/instructions/autda.rb +32 -0
- data/lib/aarch64/instructions/autdb.rb +32 -0
- data/lib/aarch64/instructions/autia.rb +35 -0
- data/lib/aarch64/instructions/autib.rb +35 -0
- data/lib/aarch64/instructions/axflag.rb +18 -0
- data/lib/aarch64/instructions/b_cond.rb +26 -0
- data/lib/aarch64/instructions/b_uncond.rb +24 -0
- data/lib/aarch64/instructions/bc_cond.rb +26 -0
- data/lib/aarch64/instructions/bfm.rb +34 -0
- data/lib/aarch64/instructions/bic_log_shift.rb +35 -0
- data/lib/aarch64/instructions/bics.rb +35 -0
- data/lib/aarch64/instructions/bl.rb +24 -0
- data/lib/aarch64/instructions/blr.rb +24 -0
- data/lib/aarch64/instructions/blra.rb +33 -0
- data/lib/aarch64/instructions/br.rb +24 -0
- data/lib/aarch64/instructions/bra.rb +33 -0
- data/lib/aarch64/instructions/brk.rb +24 -0
- data/lib/aarch64/instructions/bti.rb +24 -0
- data/lib/aarch64/instructions/cas.rb +41 -0
- data/lib/aarch64/instructions/casb.rb +35 -0
- data/lib/aarch64/instructions/cash.rb +35 -0
- data/lib/aarch64/instructions/casp.rb +41 -0
- data/lib/aarch64/instructions/cbnz.rb +29 -0
- data/lib/aarch64/instructions/cbz.rb +29 -0
- data/lib/aarch64/instructions/ccmn_imm.rb +33 -0
- data/lib/aarch64/instructions/ccmn_reg.rb +33 -0
- data/lib/aarch64/instructions/ccmp_imm.rb +33 -0
- data/lib/aarch64/instructions/ccmp_reg.rb +33 -0
- data/lib/aarch64/instructions/cfinv.rb +19 -0
- data/lib/aarch64/instructions/clrex.rb +24 -0
- data/lib/aarch64/instructions/cls_int.rb +29 -0
- data/lib/aarch64/instructions/clz_int.rb +29 -0
- data/lib/aarch64/instructions/crc32.rb +35 -0
- data/lib/aarch64/instructions/crc32c.rb +35 -0
- data/lib/aarch64/instructions/csdb.rb +19 -0
- data/lib/aarch64/instructions/csel.rb +33 -0
- data/lib/aarch64/instructions/csinc.rb +33 -0
- data/lib/aarch64/instructions/csinv.rb +33 -0
- data/lib/aarch64/instructions/csneg.rb +33 -0
- data/lib/aarch64/instructions/dcps.rb +26 -0
- data/lib/aarch64/instructions/dgh.rb +19 -0
- data/lib/aarch64/instructions/dmb.rb +24 -0
- data/lib/aarch64/instructions/drps.rb +19 -0
- data/lib/aarch64/instructions/dsb.rb +25 -0
- data/lib/aarch64/instructions/eon.rb +35 -0
- data/lib/aarch64/instructions/eor_log_imm.rb +35 -0
- data/lib/aarch64/instructions/eor_log_shift.rb +35 -0
- data/lib/aarch64/instructions/eret.rb +19 -0
- data/lib/aarch64/instructions/ereta.rb +25 -0
- data/lib/aarch64/instructions/esb.rb +19 -0
- data/lib/aarch64/instructions/extr.rb +34 -0
- data/lib/aarch64/instructions/gmi.rb +28 -0
- data/lib/aarch64/instructions/hint.rb +26 -0
- data/lib/aarch64/instructions/hlt.rb +24 -0
- data/lib/aarch64/instructions/hvc.rb +24 -0
- data/lib/aarch64/instructions/irg.rb +28 -0
- data/lib/aarch64/instructions/isb.rb +24 -0
- data/lib/aarch64/instructions/ld64b.rb +26 -0
- data/lib/aarch64/instructions/ldadd.rb +41 -0
- data/lib/aarch64/instructions/ldaddb.rb +35 -0
- data/lib/aarch64/instructions/ldaddh.rb +35 -0
- data/lib/aarch64/instructions/ldapr.rb +29 -0
- data/lib/aarch64/instructions/ldaprb.rb +26 -0
- data/lib/aarch64/instructions/ldaprh.rb +26 -0
- data/lib/aarch64/instructions/ldapur_gen.rb +33 -0
- data/lib/aarch64/instructions/ldar.rb +29 -0
- data/lib/aarch64/instructions/ldaxp.rb +31 -0
- data/lib/aarch64/instructions/ldaxr.rb +29 -0
- data/lib/aarch64/instructions/ldclr.rb +41 -0
- data/lib/aarch64/instructions/ldclrb.rb +37 -0
- data/lib/aarch64/instructions/ldeor.rb +41 -0
- data/lib/aarch64/instructions/ldg.rb +28 -0
- data/lib/aarch64/instructions/ldgm.rb +26 -0
- data/lib/aarch64/instructions/ldlar.rb +29 -0
- data/lib/aarch64/instructions/ldnp_gen.rb +33 -0
- data/lib/aarch64/instructions/ldp_gen.rb +39 -0
- data/lib/aarch64/instructions/ldpsw.rb +34 -0
- data/lib/aarch64/instructions/ldr_imm_gen.rb +35 -0
- data/lib/aarch64/instructions/ldr_imm_unsigned.rb +31 -0
- data/lib/aarch64/instructions/ldr_lit_gen.rb +29 -0
- data/lib/aarch64/instructions/ldr_reg_gen.rb +35 -0
- data/lib/aarch64/instructions/ldra.rb +37 -0
- data/lib/aarch64/instructions/ldrb_imm.rb +32 -0
- data/lib/aarch64/instructions/ldrb_reg.rb +33 -0
- data/lib/aarch64/instructions/ldrb_unsigned.rb +28 -0
- data/lib/aarch64/instructions/ldrh_imm.rb +32 -0
- data/lib/aarch64/instructions/ldrh_reg.rb +32 -0
- data/lib/aarch64/instructions/ldrh_unsigned.rb +28 -0
- data/lib/aarch64/instructions/ldrsb_imm.rb +37 -0
- data/lib/aarch64/instructions/ldrsb_reg.rb +37 -0
- data/lib/aarch64/instructions/ldrsb_unsigned.rb +35 -0
- data/lib/aarch64/instructions/ldrsh_imm.rb +37 -0
- data/lib/aarch64/instructions/ldrsh_reg.rb +35 -0
- data/lib/aarch64/instructions/ldrsh_unsigned.rb +31 -0
- data/lib/aarch64/instructions/ldrsw_imm.rb +32 -0
- data/lib/aarch64/instructions/ldrsw_lit.rb +26 -0
- data/lib/aarch64/instructions/ldrsw_reg.rb +32 -0
- data/lib/aarch64/instructions/ldrsw_unsigned.rb +30 -0
- data/lib/aarch64/instructions/ldset.rb +41 -0
- data/lib/aarch64/instructions/ldsetb.rb +35 -0
- data/lib/aarch64/instructions/ldseth.rb +35 -0
- data/lib/aarch64/instructions/ldsmax.rb +41 -0
- data/lib/aarch64/instructions/ldsmaxb.rb +35 -0
- data/lib/aarch64/instructions/ldsmaxh.rb +35 -0
- data/lib/aarch64/instructions/ldsmin.rb +41 -0
- data/lib/aarch64/instructions/ldsminb.rb +35 -0
- data/lib/aarch64/instructions/ldsminh.rb +35 -0
- data/lib/aarch64/instructions/ldtr.rb +31 -0
- data/lib/aarch64/instructions/ldtrb.rb +28 -0
- data/lib/aarch64/instructions/ldtrh.rb +28 -0
- data/lib/aarch64/instructions/ldtrsb.rb +31 -0
- data/lib/aarch64/instructions/ldtrsh.rb +31 -0
- data/lib/aarch64/instructions/ldtrsw.rb +28 -0
- data/lib/aarch64/instructions/ldumax.rb +41 -0
- data/lib/aarch64/instructions/ldumaxb.rb +35 -0
- data/lib/aarch64/instructions/ldumaxh.rb +35 -0
- data/lib/aarch64/instructions/ldumin.rb +41 -0
- data/lib/aarch64/instructions/lduminb.rb +35 -0
- data/lib/aarch64/instructions/lduminh.rb +35 -0
- data/lib/aarch64/instructions/ldur_gen.rb +31 -0
- data/lib/aarch64/instructions/ldursb.rb +31 -0
- data/lib/aarch64/instructions/ldursh.rb +31 -0
- data/lib/aarch64/instructions/ldursw.rb +28 -0
- data/lib/aarch64/instructions/ldxp.rb +31 -0
- data/lib/aarch64/instructions/ldxr.rb +29 -0
- data/lib/aarch64/instructions/lslv.rb +31 -0
- data/lib/aarch64/instructions/lsrv.rb +31 -0
- data/lib/aarch64/instructions/madd.rb +33 -0
- data/lib/aarch64/instructions/movk.rb +31 -0
- data/lib/aarch64/instructions/movn.rb +31 -0
- data/lib/aarch64/instructions/movz.rb +31 -0
- data/lib/aarch64/instructions/mrs.rb +34 -0
- data/lib/aarch64/instructions/msr_imm.rb +28 -0
- data/lib/aarch64/instructions/msr_reg.rb +34 -0
- data/lib/aarch64/instructions/msub.rb +33 -0
- data/lib/aarch64/instructions/nop.rb +19 -0
- data/lib/aarch64/instructions/orn_log_shift.rb +35 -0
- data/lib/aarch64/instructions/orr_log_imm.rb +35 -0
- data/lib/aarch64/instructions/orr_log_shift.rb +35 -0
- data/lib/aarch64/instructions/pacda.rb +29 -0
- data/lib/aarch64/instructions/pacdb.rb +29 -0
- data/lib/aarch64/instructions/pacga.rb +28 -0
- data/lib/aarch64/instructions/pacia.rb +32 -0
- data/lib/aarch64/instructions/pacia2.rb +28 -0
- data/lib/aarch64/instructions/pacib.rb +32 -0
- data/lib/aarch64/instructions/prfm_imm.rb +28 -0
- data/lib/aarch64/instructions/prfm_lit.rb +26 -0
- data/lib/aarch64/instructions/prfm_reg.rb +32 -0
- data/lib/aarch64/instructions/prfum.rb +28 -0
- data/lib/aarch64/instructions/psb.rb +19 -0
- data/lib/aarch64/instructions/rbit_int.rb +29 -0
- data/lib/aarch64/instructions/ret.rb +24 -0
- data/lib/aarch64/instructions/reta.rb +25 -0
- data/lib/aarch64/instructions/rev.rb +31 -0
- data/lib/aarch64/instructions/rmif.rb +28 -0
- data/lib/aarch64/instructions/rorv.rb +31 -0
- data/lib/aarch64/instructions/sb.rb +19 -0
- data/lib/aarch64/instructions/sbc.rb +31 -0
- data/lib/aarch64/instructions/sbcs.rb +31 -0
- data/lib/aarch64/instructions/sbfm.rb +34 -0
- data/lib/aarch64/instructions/sdiv.rb +31 -0
- data/lib/aarch64/instructions/setf.rb +27 -0
- data/lib/aarch64/instructions/setgp.rb +25 -0
- data/lib/aarch64/instructions/setgpn.rb +25 -0
- data/lib/aarch64/instructions/setgpt.rb +25 -0
- data/lib/aarch64/instructions/setgptn.rb +25 -0
- data/lib/aarch64/instructions/setp.rb +25 -0
- data/lib/aarch64/instructions/setpn.rb +25 -0
- data/lib/aarch64/instructions/setpt.rb +25 -0
- data/lib/aarch64/instructions/setptn.rb +25 -0
- data/lib/aarch64/instructions/sev.rb +18 -0
- data/lib/aarch64/instructions/sevl.rb +18 -0
- data/lib/aarch64/instructions/smaddl.rb +30 -0
- data/lib/aarch64/instructions/smc.rb +24 -0
- data/lib/aarch64/instructions/smsubl.rb +30 -0
- data/lib/aarch64/instructions/smulh.rb +28 -0
- data/lib/aarch64/instructions/st2g.rb +32 -0
- data/lib/aarch64/instructions/st64b.rb +26 -0
- data/lib/aarch64/instructions/st64bv.rb +28 -0
- data/lib/aarch64/instructions/st64bv0.rb +28 -0
- data/lib/aarch64/instructions/stg.rb +32 -0
- data/lib/aarch64/instructions/stgm.rb +26 -0
- data/lib/aarch64/instructions/stgp.rb +34 -0
- data/lib/aarch64/instructions/stllr.rb +29 -0
- data/lib/aarch64/instructions/stllrb.rb +26 -0
- data/lib/aarch64/instructions/stllrh.rb +26 -0
- data/lib/aarch64/instructions/stlr.rb +29 -0
- data/lib/aarch64/instructions/stlrb.rb +26 -0
- data/lib/aarch64/instructions/stlrh.rb +26 -0
- data/lib/aarch64/instructions/stlur_gen.rb +31 -0
- data/lib/aarch64/instructions/stlxp.rb +33 -0
- data/lib/aarch64/instructions/stlxr.rb +31 -0
- data/lib/aarch64/instructions/stlxrb.rb +28 -0
- data/lib/aarch64/instructions/stlxrh.rb +28 -0
- data/lib/aarch64/instructions/stnp_gen.rb +33 -0
- data/lib/aarch64/instructions/stp_gen.rb +39 -0
- data/lib/aarch64/instructions/str_imm_gen.rb +37 -0
- data/lib/aarch64/instructions/str_imm_unsigned.rb +31 -0
- data/lib/aarch64/instructions/str_reg_gen.rb +35 -0
- data/lib/aarch64/instructions/strb_imm.rb +32 -0
- data/lib/aarch64/instructions/strb_imm_unsigned.rb +28 -0
- data/lib/aarch64/instructions/strb_reg.rb +33 -0
- data/lib/aarch64/instructions/strh_imm.rb +32 -0
- data/lib/aarch64/instructions/strh_imm_unsigned.rb +28 -0
- data/lib/aarch64/instructions/strh_reg.rb +32 -0
- data/lib/aarch64/instructions/sttr.rb +31 -0
- data/lib/aarch64/instructions/stur_gen.rb +31 -0
- data/lib/aarch64/instructions/stxp.rb +33 -0
- data/lib/aarch64/instructions/stxr.rb +31 -0
- data/lib/aarch64/instructions/stxrb.rb +28 -0
- data/lib/aarch64/instructions/stxrh.rb +28 -0
- data/lib/aarch64/instructions/stz2g.rb +32 -0
- data/lib/aarch64/instructions/stzg.rb +32 -0
- data/lib/aarch64/instructions/stzgm.rb +26 -0
- data/lib/aarch64/instructions/sub_addsub_ext.rb +35 -0
- data/lib/aarch64/instructions/sub_addsub_imm.rb +33 -0
- data/lib/aarch64/instructions/sub_addsub_shift.rb +35 -0
- data/lib/aarch64/instructions/subg.rb +30 -0
- data/lib/aarch64/instructions/subp.rb +28 -0
- data/lib/aarch64/instructions/subps.rb +28 -0
- data/lib/aarch64/instructions/subs_addsub_ext.rb +35 -0
- data/lib/aarch64/instructions/subs_addsub_imm.rb +33 -0
- data/lib/aarch64/instructions/subs_addsub_shift.rb +35 -0
- data/lib/aarch64/instructions/svc.rb +24 -0
- data/lib/aarch64/instructions/swp.rb +41 -0
- data/lib/aarch64/instructions/swpb.rb +35 -0
- data/lib/aarch64/instructions/swph.rb +35 -0
- data/lib/aarch64/instructions/sys.rb +32 -0
- data/lib/aarch64/instructions/sysl.rb +32 -0
- data/lib/aarch64/instructions/tbnz.rb +30 -0
- data/lib/aarch64/instructions/tbz.rb +30 -0
- data/lib/aarch64/instructions/tsb.rb +18 -0
- data/lib/aarch64/instructions/ubfm.rb +34 -0
- data/lib/aarch64/instructions/udf_perm_undef.rb +24 -0
- data/lib/aarch64/instructions/udiv.rb +31 -0
- data/lib/aarch64/instructions/umaddl.rb +30 -0
- data/lib/aarch64/instructions/umsubl.rb +30 -0
- data/lib/aarch64/instructions/umulh.rb +28 -0
- data/lib/aarch64/instructions/wfe.rb +19 -0
- data/lib/aarch64/instructions/wfet.rb +24 -0
- data/lib/aarch64/instructions/wfi.rb +19 -0
- data/lib/aarch64/instructions/wfit.rb +24 -0
- data/lib/aarch64/instructions/xaflag.rb +19 -0
- data/lib/aarch64/instructions/xpac.rb +28 -0
- data/lib/aarch64/instructions/xpaclri.rb +18 -0
- data/lib/aarch64/instructions/yield.rb +19 -0
- data/lib/aarch64/instructions.rb +266 -0
- data/lib/aarch64/system_registers/mrs_msr_64.rb +395 -0
- data/lib/aarch64/utils.rb +325 -0
- data/lib/aarch64/version.rb +3 -0
- data/lib/aarch64.rb +2857 -0
- data/test/all_adds_test.rb +129 -0
- data/test/base_instructions_test.rb +9263 -0
- data/test/dsl_test.rb +11 -0
- data/test/helper.rb +51 -0
- data/test/not_supported_yet_test.rb +55 -0
- metadata +382 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# CCMP (register) -- A64
|
4
|
+
# Conditional Compare (register)
|
5
|
+
# CCMP <Wn>, <Wm>, #<nzcv>, <cond>
|
6
|
+
# CCMP <Xn>, <Xm>, #<nzcv>, <cond>
|
7
|
+
class CCMP_reg
|
8
|
+
def initialize rn, rm, nzcv, cond, sf
|
9
|
+
@rn = rn
|
10
|
+
@rm = rm
|
11
|
+
@nzcv = nzcv
|
12
|
+
@cond = cond
|
13
|
+
@sf = sf
|
14
|
+
end
|
15
|
+
|
16
|
+
def encode
|
17
|
+
CCMP_reg(@sf, @rm.to_i, @cond, @rn.to_i, @nzcv)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def CCMP_reg sf, rm, cond, rn, nzcv
|
23
|
+
insn = 0b0_1_1_11010010_00000_0000_0_0_00000_0_0000
|
24
|
+
insn |= ((sf & 0x1) << 31)
|
25
|
+
insn |= ((rm & 0x1f) << 16)
|
26
|
+
insn |= ((cond & 0xf) << 12)
|
27
|
+
insn |= ((rn & 0x1f) << 5)
|
28
|
+
insn |= (nzcv & 0xf)
|
29
|
+
insn
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# CFINV -- A64
|
4
|
+
# Invert Carry Flag
|
5
|
+
# CFINV
|
6
|
+
class CFINV
|
7
|
+
def encode
|
8
|
+
self.CFINV
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def CFINV
|
14
|
+
insn = 0b1101010100_0_0_0_000_0100_0000_000_11111
|
15
|
+
insn
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# CLREX -- A64
|
4
|
+
# Clear Exclusive
|
5
|
+
# CLREX {#<imm>}
|
6
|
+
class CLREX
|
7
|
+
def initialize imm
|
8
|
+
@imm = imm
|
9
|
+
end
|
10
|
+
|
11
|
+
def encode
|
12
|
+
CLREX(@imm)
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def CLREX crm
|
18
|
+
insn = 0b1101010100_0_00_011_0011_0000_010_11111
|
19
|
+
insn |= ((crm & 0xf) << 8)
|
20
|
+
insn
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# CLS -- A64
|
4
|
+
# Count Leading Sign bits
|
5
|
+
# CLS <Wd>, <Wn>
|
6
|
+
# CLS <Xd>, <Xn>
|
7
|
+
class CLS_int
|
8
|
+
def initialize rd, rn, sf
|
9
|
+
@rd = rd
|
10
|
+
@rn = rn
|
11
|
+
@sf = sf
|
12
|
+
end
|
13
|
+
|
14
|
+
def encode
|
15
|
+
CLS_int(@sf, @rn.to_i, @rd.to_i)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def CLS_int sf, rn, rd
|
21
|
+
insn = 0b0_1_0_11010110_00000_00010_1_00000_00000
|
22
|
+
insn |= ((sf & 0x1) << 31)
|
23
|
+
insn |= ((rn & 0x1f) << 5)
|
24
|
+
insn |= (rd & 0x1f)
|
25
|
+
insn
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# CLZ -- A64
|
4
|
+
# Count Leading Zeros
|
5
|
+
# CLZ <Wd>, <Wn>
|
6
|
+
# CLZ <Xd>, <Xn>
|
7
|
+
class CLZ_int
|
8
|
+
def initialize rd, rn, sf
|
9
|
+
@rd = rd
|
10
|
+
@rn = rn
|
11
|
+
@sf = sf
|
12
|
+
end
|
13
|
+
|
14
|
+
def encode
|
15
|
+
CLZ_int(@sf, @rn.to_i, @rd.to_i)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def CLZ_int sf, rn, rd
|
21
|
+
insn = 0b0_1_0_11010110_00000_00010_0_00000_00000
|
22
|
+
insn |= ((sf & 0x1) << 31)
|
23
|
+
insn |= ((rn & 0x1f) << 5)
|
24
|
+
insn |= (rd & 0x1f)
|
25
|
+
insn
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# CRC32B, CRC32H, CRC32W, CRC32X -- A64
|
4
|
+
# CRC32 checksum
|
5
|
+
# CRC32B <Wd>, <Wn>, <Wm>
|
6
|
+
# CRC32H <Wd>, <Wn>, <Wm>
|
7
|
+
# CRC32W <Wd>, <Wn>, <Wm>
|
8
|
+
# CRC32X <Wd>, <Wn>, <Xm>
|
9
|
+
class CRC32
|
10
|
+
def initialize rd, rn, rm, sz, sf
|
11
|
+
@rd = rd
|
12
|
+
@rn = rn
|
13
|
+
@rm = rm
|
14
|
+
@sz = sz
|
15
|
+
@sf = sf
|
16
|
+
end
|
17
|
+
|
18
|
+
def encode
|
19
|
+
self.CRC32(@sf, @rm.to_i, @sz, @rn.to_i, @rd.to_i)
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def CRC32 sf, rm, sz, rn, rd
|
25
|
+
insn = 0b0_0_0_11010110_00000_010_0_00_00000_00000
|
26
|
+
insn |= ((sf & 0x1) << 31)
|
27
|
+
insn |= ((rm & 0x1f) << 16)
|
28
|
+
insn |= ((sz & 0x3) << 10)
|
29
|
+
insn |= ((rn & 0x1f) << 5)
|
30
|
+
insn |= (rd & 0x1f)
|
31
|
+
insn
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# CRC32CB, CRC32CH, CRC32CW, CRC32CX -- A64
|
4
|
+
# CRC32C checksum
|
5
|
+
# CRC32CB <Wd>, <Wn>, <Wm>
|
6
|
+
# CRC32CH <Wd>, <Wn>, <Wm>
|
7
|
+
# CRC32CW <Wd>, <Wn>, <Wm>
|
8
|
+
# CRC32CX <Wd>, <Wn>, <Xm>
|
9
|
+
class CRC32C
|
10
|
+
def initialize rd, rn, rm, sz, sf
|
11
|
+
@rd = rd
|
12
|
+
@rn = rn
|
13
|
+
@rm = rm
|
14
|
+
@sz = sz
|
15
|
+
@sf = sf
|
16
|
+
end
|
17
|
+
|
18
|
+
def encode
|
19
|
+
self.CRC32C(@sf, @rm.to_i, @sz, @rn.to_i, @rd.to_i)
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def CRC32C sf, rm, sz, rn, rd
|
25
|
+
insn = 0b0_0_0_11010110_00000_010_1_00_00000_00000
|
26
|
+
insn |= ((sf & 0x1) << 31)
|
27
|
+
insn |= ((rm & 0x1f) << 16)
|
28
|
+
insn |= ((sz & 0x3) << 10)
|
29
|
+
insn |= ((rn & 0x1f) << 5)
|
30
|
+
insn |= (rd & 0x1f)
|
31
|
+
insn
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# CSDB -- A64
|
4
|
+
# Consumption of Speculative Data Barrier
|
5
|
+
# CSDB
|
6
|
+
class CSDB
|
7
|
+
def encode
|
8
|
+
self.CSDB
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def CSDB
|
14
|
+
insn = 0b1101010100_0_00_011_0010_0010_100_11111
|
15
|
+
insn
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# CSEL -- A64
|
4
|
+
# Conditional Select
|
5
|
+
# CSEL <Wd>, <Wn>, <Wm>, <cond>
|
6
|
+
# CSEL <Xd>, <Xn>, <Xm>, <cond>
|
7
|
+
class CSEL
|
8
|
+
def initialize rd, rn, rm, cond, sf
|
9
|
+
@rd = rd
|
10
|
+
@rn = rn
|
11
|
+
@rm = rm
|
12
|
+
@cond = cond
|
13
|
+
@sf = sf
|
14
|
+
end
|
15
|
+
|
16
|
+
def encode
|
17
|
+
self.CSEL @sf, @rm.to_i, @cond, @rn.to_i, @rd.to_i
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def CSEL sf, rm, cond, rn, rd
|
23
|
+
insn = 0b0_0_0_11010100_00000_0000_0_0_00000_00000
|
24
|
+
insn |= ((sf & 0x1) << 31)
|
25
|
+
insn |= ((rm & 0x1f) << 16)
|
26
|
+
insn |= ((cond & 0xf) << 12)
|
27
|
+
insn |= ((rn & 0x1f) << 5)
|
28
|
+
insn |= (rd & 0x1f)
|
29
|
+
insn
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# CSINC -- A64
|
4
|
+
# Conditional Select Increment
|
5
|
+
# CSINC <Wd>, <Wn>, <Wm>, <cond>
|
6
|
+
# CSINC <Xd>, <Xn>, <Xm>, <cond>
|
7
|
+
class CSINC
|
8
|
+
def initialize rd, rn, rm, cond, sf
|
9
|
+
@rd = rd
|
10
|
+
@rn = rn
|
11
|
+
@rm = rm
|
12
|
+
@cond = cond
|
13
|
+
@sf = sf
|
14
|
+
end
|
15
|
+
|
16
|
+
def encode
|
17
|
+
CSINC(@sf, @rm.to_i, @cond, @rn.to_i, @rd.to_i)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def CSINC sf, rm, cond, rn, rd
|
23
|
+
insn = 0b0_0_0_11010100_00000_0000_0_1_00000_00000
|
24
|
+
insn |= ((sf & 0x1) << 31)
|
25
|
+
insn |= ((rm & 0x1f) << 16)
|
26
|
+
insn |= ((cond & 0xf) << 12)
|
27
|
+
insn |= ((rn & 0x1f) << 5)
|
28
|
+
insn |= (rd & 0x1f)
|
29
|
+
insn
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# CSINV -- A64
|
4
|
+
# Conditional Select Invert
|
5
|
+
# CSINV <Wd>, <Wn>, <Wm>, <cond>
|
6
|
+
# CSINV <Xd>, <Xn>, <Xm>, <cond>
|
7
|
+
class CSINV
|
8
|
+
def initialize rd, rn, rm, cond, sf
|
9
|
+
@rd = rd
|
10
|
+
@rn = rn
|
11
|
+
@rm = rm
|
12
|
+
@cond = cond
|
13
|
+
@sf = sf
|
14
|
+
end
|
15
|
+
|
16
|
+
def encode
|
17
|
+
CSINV(@sf, @rm.to_i, @cond, @rn.to_i, @rd.to_i)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def CSINV sf, rm, cond, rn, rd
|
23
|
+
insn = 0b0_1_0_11010100_00000_0000_0_0_00000_00000
|
24
|
+
insn |= ((sf & 0x1) << 31)
|
25
|
+
insn |= ((rm & 0x1f) << 16)
|
26
|
+
insn |= ((cond & 0xf) << 12)
|
27
|
+
insn |= ((rn & 0x1f) << 5)
|
28
|
+
insn |= (rd & 0x1f)
|
29
|
+
insn
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# CSNEG -- A64
|
4
|
+
# Conditional Select Negation
|
5
|
+
# CSNEG <Wd>, <Wn>, <Wm>, <cond>
|
6
|
+
# CSNEG <Xd>, <Xn>, <Xm>, <cond>
|
7
|
+
class CSNEG
|
8
|
+
def initialize rd, rn, rm, cond, sf
|
9
|
+
@rd = rd
|
10
|
+
@rn = rn
|
11
|
+
@rm = rm
|
12
|
+
@cond = cond
|
13
|
+
@sf = sf
|
14
|
+
end
|
15
|
+
|
16
|
+
def encode
|
17
|
+
self.CSNEG(@sf, @rm.to_i, @cond, @rn.to_i, @rd.to_i)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def CSNEG sf, rm, cond, rn, rd
|
23
|
+
insn = 0b0_1_0_11010100_00000_0000_0_1_00000_00000
|
24
|
+
insn |= ((sf & 0x1) << 31)
|
25
|
+
insn |= ((rm & 0x1f) << 16)
|
26
|
+
insn |= ((cond & 0xf) << 12)
|
27
|
+
insn |= ((rn & 0x1f) << 5)
|
28
|
+
insn |= (rd & 0x1f)
|
29
|
+
insn
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# DCPS1 -- A64
|
4
|
+
# Debug Change PE State to EL1.
|
5
|
+
# DCPS1 {#<imm>}
|
6
|
+
class DCPS
|
7
|
+
def initialize imm, ll
|
8
|
+
@imm = imm
|
9
|
+
@ll = ll
|
10
|
+
end
|
11
|
+
|
12
|
+
def encode
|
13
|
+
self.DCPS @imm, @ll
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def DCPS imm16, ll
|
19
|
+
insn = 0b11010100_101_0000000000000000_000_00
|
20
|
+
insn |= ((imm16 & 0xffff) << 5)
|
21
|
+
insn |= (ll & 0x3)
|
22
|
+
insn
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# DMB -- A64
|
4
|
+
# Data Memory Barrier
|
5
|
+
# DMB <option>|#<imm>
|
6
|
+
class DMB
|
7
|
+
def initialize imm
|
8
|
+
@imm = imm
|
9
|
+
end
|
10
|
+
|
11
|
+
def encode
|
12
|
+
self.DMB(@imm)
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def DMB crm
|
18
|
+
insn = 0b1101010100_0_00_011_0011_0000_1_01_11111
|
19
|
+
insn |= ((crm & 0xf) << 8)
|
20
|
+
insn
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# DRPS -- A64
|
4
|
+
# Debug restore process state
|
5
|
+
# DRPS
|
6
|
+
class DRPS
|
7
|
+
def encode
|
8
|
+
self.DRPS
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def DRPS
|
14
|
+
insn = 0b1101011_0101_11111_000000_11111_00000
|
15
|
+
insn
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# DSB -- A64
|
4
|
+
# Data Synchronization Barrier
|
5
|
+
# DSB <option>|#<imm>
|
6
|
+
# DSB <option>nXS|#<imm>
|
7
|
+
class DSB
|
8
|
+
def initialize imm
|
9
|
+
@imm = imm
|
10
|
+
end
|
11
|
+
|
12
|
+
def encode
|
13
|
+
self.DSB(@imm)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def DSB crm
|
19
|
+
insn = 0b1101010100_0_00_011_0011_0000_1_00_11111
|
20
|
+
insn |= ((crm & 0xf) << 8)
|
21
|
+
insn
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# EON (shifted register) -- A64
|
4
|
+
# Bitwise Exclusive OR NOT (shifted register)
|
5
|
+
# EON <Wd>, <Wn>, <Wm>{, <shift> #<amount>}
|
6
|
+
# EON <Xd>, <Xn>, <Xm>{, <shift> #<amount>}
|
7
|
+
class EON
|
8
|
+
def initialize rd, rn, rm, shift, imm, sf
|
9
|
+
@rd = rd
|
10
|
+
@rn = rn
|
11
|
+
@rm = rm
|
12
|
+
@shift = shift
|
13
|
+
@imm = imm
|
14
|
+
@sf = sf
|
15
|
+
end
|
16
|
+
|
17
|
+
def encode
|
18
|
+
self.EON(@sf, @shift, @rm.to_i, @imm, @rn.to_i, @rd.to_i)
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def EON sf, shift, rm, imm6, rn, rd
|
24
|
+
insn = 0b0_10_01010_00_1_00000_000000_00000_00000
|
25
|
+
insn |= ((sf & 0x1) << 31)
|
26
|
+
insn |= ((shift & 0x3) << 22)
|
27
|
+
insn |= ((rm & 0x1f) << 16)
|
28
|
+
insn |= ((imm6 & 0x3f) << 10)
|
29
|
+
insn |= ((rn & 0x1f) << 5)
|
30
|
+
insn |= (rd & 0x1f)
|
31
|
+
insn
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# EOR (immediate) -- A64
|
4
|
+
# Bitwise Exclusive OR (immediate)
|
5
|
+
# EOR <Wd|WSP>, <Wn>, #<imm>
|
6
|
+
# EOR <Xd|SP>, <Xn>, #<imm>
|
7
|
+
class EOR_log_imm
|
8
|
+
def initialize rd, rn, n, immr, imms, sf
|
9
|
+
@rd = rd
|
10
|
+
@rn = rn
|
11
|
+
@n = n
|
12
|
+
@immr = immr
|
13
|
+
@imms = imms
|
14
|
+
@sf = sf
|
15
|
+
end
|
16
|
+
|
17
|
+
def encode
|
18
|
+
self.EOR_log_imm(@sf, @n, @immr, @imms, @rn.to_i, @rd.to_i)
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def EOR_log_imm sf, n, immr, imms, rn, rd
|
24
|
+
insn = 0b0_10_100100_0_000000_000000_00000_00000
|
25
|
+
insn |= ((sf & 0x1) << 31)
|
26
|
+
insn |= ((n & 0x1) << 22)
|
27
|
+
insn |= ((immr & 0x3f) << 16)
|
28
|
+
insn |= ((imms & 0x3f) << 10)
|
29
|
+
insn |= ((rn & 0x1f) << 5)
|
30
|
+
insn |= (rd & 0x1f)
|
31
|
+
insn
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# EOR (shifted register) -- A64
|
4
|
+
# Bitwise Exclusive OR (shifted register)
|
5
|
+
# EOR <Wd>, <Wn>, <Wm>{, <shift> #<amount>}
|
6
|
+
# EOR <Xd>, <Xn>, <Xm>{, <shift> #<amount>}
|
7
|
+
class EOR_log_shift
|
8
|
+
def initialize rd, rn, rm, shift, imm6, sf
|
9
|
+
@rd = rd
|
10
|
+
@rn = rn
|
11
|
+
@rm = rm
|
12
|
+
@shift = shift
|
13
|
+
@imm6 = imm6
|
14
|
+
@sf = sf
|
15
|
+
end
|
16
|
+
|
17
|
+
def encode
|
18
|
+
self.EOR_log_shift(@sf, @shift, @rm.to_i, @imm6, @rn.to_i, @rd.to_i)
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def EOR_log_shift sf, shift, rm, imm6, rn, rd
|
24
|
+
insn = 0b0_10_01010_00_0_00000_000000_00000_00000
|
25
|
+
insn |= ((sf & 0x1) << 31)
|
26
|
+
insn |= ((shift & 0x3) << 22)
|
27
|
+
insn |= ((rm & 0x1f) << 16)
|
28
|
+
insn |= ((imm6 & 0x3f) << 10)
|
29
|
+
insn |= ((rn & 0x1f) << 5)
|
30
|
+
insn |= (rd & 0x1f)
|
31
|
+
insn
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# ERET -- A64
|
4
|
+
# Exception Return
|
5
|
+
# ERET
|
6
|
+
class ERET
|
7
|
+
def encode
|
8
|
+
self.ERET
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def ERET
|
14
|
+
insn = 0b1101011_0_100_11111_0000_0_0_11111_00000
|
15
|
+
insn
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# ERETAA, ERETAB -- A64
|
4
|
+
# Exception Return, with pointer authentication
|
5
|
+
# ERETAA
|
6
|
+
# ERETAB
|
7
|
+
class ERETA
|
8
|
+
def initialize m
|
9
|
+
@m = m
|
10
|
+
end
|
11
|
+
|
12
|
+
def encode
|
13
|
+
self.ERETA(@m)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def ERETA m
|
19
|
+
insn = 0b1101011_0_100_11111_0000_1_0_11111_11111
|
20
|
+
insn |= ((m & 0x1) << 10)
|
21
|
+
insn
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# ESB -- A64
|
4
|
+
# Error Synchronization Barrier
|
5
|
+
# ESB
|
6
|
+
class ESB
|
7
|
+
def encode
|
8
|
+
self.ESB
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def ESB
|
14
|
+
insn = 0b1101010100_0_00_011_0010_0010_000_11111
|
15
|
+
insn
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# EXTR -- A64
|
4
|
+
# Extract register
|
5
|
+
# EXTR <Wd>, <Wn>, <Wm>, #<lsb>
|
6
|
+
# EXTR <Xd>, <Xn>, <Xm>, #<lsb>
|
7
|
+
class EXTR
|
8
|
+
def initialize rd, rn, rm, lsb, sf
|
9
|
+
@rd = rd
|
10
|
+
@rn = rn
|
11
|
+
@rm = rm
|
12
|
+
@lsb = lsb
|
13
|
+
@sf = sf
|
14
|
+
end
|
15
|
+
|
16
|
+
def encode
|
17
|
+
self.EXTR(@sf, @sf, @rm.to_i, @lsb, @rn.to_i, @rd.to_i)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def EXTR sf, n, rm, imms, rn, rd
|
23
|
+
insn = 0b0_00_100111_0_0_00000_000000_00000_00000
|
24
|
+
insn |= ((sf & 0x1) << 31)
|
25
|
+
insn |= ((n & 0x1) << 22)
|
26
|
+
insn |= ((rm & 0x1f) << 16)
|
27
|
+
insn |= ((imms & 0x3f) << 10)
|
28
|
+
insn |= ((rn & 0x1f) << 5)
|
29
|
+
insn |= (rd & 0x1f)
|
30
|
+
insn
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|