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,31 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SBC -- A64
|
4
|
+
# Subtract with Carry
|
5
|
+
# SBC <Wd>, <Wn>, <Wm>
|
6
|
+
# SBC <Xd>, <Xn>, <Xm>
|
7
|
+
class SBC
|
8
|
+
def initialize rd, rn, rm, sf
|
9
|
+
@rd = rd
|
10
|
+
@rn = rn
|
11
|
+
@rm = rm
|
12
|
+
@sf = sf
|
13
|
+
end
|
14
|
+
|
15
|
+
def encode
|
16
|
+
self.SBC(@sf, @rm.to_i, @rn.to_i, @rd.to_i)
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def SBC sf, rm, rn, rd
|
22
|
+
insn = 0b0_1_0_11010000_00000_000000_00000_00000
|
23
|
+
insn |= ((sf & 0x1) << 31)
|
24
|
+
insn |= ((rm & 0x1f) << 16)
|
25
|
+
insn |= ((rn & 0x1f) << 5)
|
26
|
+
insn |= (rd & 0x1f)
|
27
|
+
insn
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SBCS -- A64
|
4
|
+
# Subtract with Carry, setting flags
|
5
|
+
# SBCS <Wd>, <Wn>, <Wm>
|
6
|
+
# SBCS <Xd>, <Xn>, <Xm>
|
7
|
+
class SBCS
|
8
|
+
def initialize rd, rn, rm, sf
|
9
|
+
@rd = rd
|
10
|
+
@rn = rn
|
11
|
+
@rm = rm
|
12
|
+
@sf = sf
|
13
|
+
end
|
14
|
+
|
15
|
+
def encode
|
16
|
+
self.SBCS(@sf, @rm.to_i, @rn.to_i, @rd.to_i)
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def SBCS sf, rm, rn, rd
|
22
|
+
insn = 0b0_1_1_11010000_00000_000000_00000_00000
|
23
|
+
insn |= ((sf & 0x1) << 31)
|
24
|
+
insn |= ((rm & 0x1f) << 16)
|
25
|
+
insn |= ((rn & 0x1f) << 5)
|
26
|
+
insn |= (rd & 0x1f)
|
27
|
+
insn
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SBFM -- A64
|
4
|
+
# Signed Bitfield Move
|
5
|
+
# SBFM <Wd>, <Wn>, #<immr>, #<imms>
|
6
|
+
# SBFM <Xd>, <Xn>, #<immr>, #<imms>
|
7
|
+
class SBFM
|
8
|
+
def initialize d, n, immr, imms, sf
|
9
|
+
@d = d
|
10
|
+
@n = n
|
11
|
+
@immr = immr
|
12
|
+
@imms = imms
|
13
|
+
@sf = sf
|
14
|
+
end
|
15
|
+
|
16
|
+
def encode
|
17
|
+
SBFM(@sf, @sf, @immr, @imms, @n.to_i, @d.to_i)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def SBFM sf, n, immr, imms, rn, rd
|
23
|
+
insn = 0b0_00_100110_0_000000_000000_00000_00000
|
24
|
+
insn |= ((sf & 0x1) << 31)
|
25
|
+
insn |= ((n & 0x1) << 22)
|
26
|
+
insn |= ((immr & 0x3f) << 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
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SDIV -- A64
|
4
|
+
# Signed Divide
|
5
|
+
# SDIV <Wd>, <Wn>, <Wm>
|
6
|
+
# SDIV <Xd>, <Xn>, <Xm>
|
7
|
+
class SDIV
|
8
|
+
def initialize rd, rn, rm, sf
|
9
|
+
@rd = rd
|
10
|
+
@rn = rn
|
11
|
+
@rm = rm
|
12
|
+
@sf = sf
|
13
|
+
end
|
14
|
+
|
15
|
+
def encode
|
16
|
+
self.SDIV(@sf, @rm.to_i, @rn.to_i, @rd.to_i)
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def SDIV sf, rm, rn, rd
|
22
|
+
insn = 0b0_0_0_11010110_00000_00001_1_00000_00000
|
23
|
+
insn |= ((sf & 0x1) << 31)
|
24
|
+
insn |= ((rm & 0x1f) << 16)
|
25
|
+
insn |= ((rn & 0x1f) << 5)
|
26
|
+
insn |= (rd & 0x1f)
|
27
|
+
insn
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SETF8, SETF16 -- A64
|
4
|
+
# Evaluation of 8 or 16 bit flag values
|
5
|
+
# SETF8 <Wn>
|
6
|
+
# SETF16 <Wn>
|
7
|
+
class SETF
|
8
|
+
def initialize rn, sz
|
9
|
+
@rn = rn
|
10
|
+
@sz = sz
|
11
|
+
end
|
12
|
+
|
13
|
+
def encode
|
14
|
+
self.SETF(@sz, @rn.to_i)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def SETF sz, rn
|
20
|
+
insn = 0b0_0_1_11010000_000000_0_0010_00000_0_1101
|
21
|
+
insn |= ((sz & 0x1) << 14)
|
22
|
+
insn |= ((rn & 0x1f) << 5)
|
23
|
+
insn
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SETGP, SETGM, SETGE -- A64
|
4
|
+
# Memory Set with tag setting
|
5
|
+
# SETGE [<Xd>]!, <Xn>!, <Xs>
|
6
|
+
# SETGM [<Xd>]!, <Xn>!, <Xs>
|
7
|
+
# SETGP [<Xd>]!, <Xn>!, <Xs>
|
8
|
+
class SETGP
|
9
|
+
def encode
|
10
|
+
raise NotImplementedError
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def SETGP sz, rs, rn, rd
|
16
|
+
insn = 0b00_011_1_01_11_0_00000_xx00_01_00000_00000
|
17
|
+
insn |= ((sz & 0x3) << 30)
|
18
|
+
insn |= ((rs & 0x1f) << 16)
|
19
|
+
insn |= ((rn & 0x1f) << 5)
|
20
|
+
insn |= (rd & 0x1f)
|
21
|
+
insn
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SETGPN, SETGMN, SETGEN -- A64
|
4
|
+
# Memory Set with tag setting, non-temporal
|
5
|
+
# SETGEN [<Xd>]!, <Xn>!, <Xs>
|
6
|
+
# SETGMN [<Xd>]!, <Xn>!, <Xs>
|
7
|
+
# SETGPN [<Xd>]!, <Xn>!, <Xs>
|
8
|
+
class SETGPN
|
9
|
+
def encode
|
10
|
+
raise NotImplementedError
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def SETGPN sz, rs, rn, rd
|
16
|
+
insn = 0b00_011_1_01_11_0_00000_xx10_01_00000_00000
|
17
|
+
insn |= ((sz & 0x3) << 30)
|
18
|
+
insn |= ((rs & 0x1f) << 16)
|
19
|
+
insn |= ((rn & 0x1f) << 5)
|
20
|
+
insn |= (rd & 0x1f)
|
21
|
+
insn
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SETGPT, SETGMT, SETGET -- A64
|
4
|
+
# Memory Set with tag setting, unprivileged
|
5
|
+
# SETGET [<Xd>]!, <Xn>!, <Xs>
|
6
|
+
# SETGMT [<Xd>]!, <Xn>!, <Xs>
|
7
|
+
# SETGPT [<Xd>]!, <Xn>!, <Xs>
|
8
|
+
class SETGPT
|
9
|
+
def encode
|
10
|
+
raise NotImplementedError
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def SETGPT sz, rs, rn, rd
|
16
|
+
insn = 0b00_011_1_01_11_0_00000_xx01_01_00000_00000
|
17
|
+
insn |= ((sz & 0x3) << 30)
|
18
|
+
insn |= ((rs & 0x1f) << 16)
|
19
|
+
insn |= ((rn & 0x1f) << 5)
|
20
|
+
insn |= (rd & 0x1f)
|
21
|
+
insn
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SETGPTN, SETGMTN, SETGETN -- A64
|
4
|
+
# Memory Set with tag setting, unprivileged and non-temporal
|
5
|
+
# SETGETN [<Xd>]!, <Xn>!, <Xs>
|
6
|
+
# SETGMTN [<Xd>]!, <Xn>!, <Xs>
|
7
|
+
# SETGPTN [<Xd>]!, <Xn>!, <Xs>
|
8
|
+
class SETGPTN
|
9
|
+
def encode
|
10
|
+
raise NotImplementedError
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def SETGPTN sz, rs, rn, rd
|
16
|
+
insn = 0b00_011_1_01_11_0_00000_xx11_01_00000_00000
|
17
|
+
insn |= ((sz & 0x3) << 30)
|
18
|
+
insn |= ((rs & 0x1f) << 16)
|
19
|
+
insn |= ((rn & 0x1f) << 5)
|
20
|
+
insn |= (rd & 0x1f)
|
21
|
+
insn
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SETP, SETM, SETE -- A64
|
4
|
+
# Memory Set
|
5
|
+
# SETE [<Xd>]!, <Xn>!, <Xs>
|
6
|
+
# SETM [<Xd>]!, <Xn>!, <Xs>
|
7
|
+
# SETP [<Xd>]!, <Xn>!, <Xs>
|
8
|
+
class SETP
|
9
|
+
def encode
|
10
|
+
raise NotImplementedError
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def SETP sz, rs, rn, rd
|
16
|
+
insn = 0b00_011_0_01_11_0_00000_xx00_01_00000_00000
|
17
|
+
insn |= ((sz & 0x3) << 30)
|
18
|
+
insn |= ((rs & 0x1f) << 16)
|
19
|
+
insn |= ((rn & 0x1f) << 5)
|
20
|
+
insn |= (rd & 0x1f)
|
21
|
+
insn
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SETPN, SETMN, SETEN -- A64
|
4
|
+
# Memory Set, non-temporal
|
5
|
+
# SETEN [<Xd>]!, <Xn>!, <Xs>
|
6
|
+
# SETMN [<Xd>]!, <Xn>!, <Xs>
|
7
|
+
# SETPN [<Xd>]!, <Xn>!, <Xs>
|
8
|
+
class SETPN
|
9
|
+
def encode
|
10
|
+
raise NotImplementedError
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def SETPN sz, rs, rn, rd
|
16
|
+
insn = 0b00_011_0_01_11_0_00000_xx10_01_00000_00000
|
17
|
+
insn |= ((sz & 0x3) << 30)
|
18
|
+
insn |= ((rs & 0x1f) << 16)
|
19
|
+
insn |= ((rn & 0x1f) << 5)
|
20
|
+
insn |= (rd & 0x1f)
|
21
|
+
insn
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SETPT, SETMT, SETET -- A64
|
4
|
+
# Memory Set, unprivileged
|
5
|
+
# SETET [<Xd>]!, <Xn>!, <Xs>
|
6
|
+
# SETMT [<Xd>]!, <Xn>!, <Xs>
|
7
|
+
# SETPT [<Xd>]!, <Xn>!, <Xs>
|
8
|
+
class SETPT
|
9
|
+
def encode
|
10
|
+
raise NotImplementedError
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def SETPT sz, rs, rn, rd
|
16
|
+
insn = 0b00_011_0_01_11_0_00000_xx01_01_00000_00000
|
17
|
+
insn |= ((sz & 0x3) << 30)
|
18
|
+
insn |= ((rs & 0x1f) << 16)
|
19
|
+
insn |= ((rn & 0x1f) << 5)
|
20
|
+
insn |= (rd & 0x1f)
|
21
|
+
insn
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SETPTN, SETMTN, SETETN -- A64
|
4
|
+
# Memory Set, unprivileged and non-temporal
|
5
|
+
# SETETN [<Xd>]!, <Xn>!, <Xs>
|
6
|
+
# SETMTN [<Xd>]!, <Xn>!, <Xs>
|
7
|
+
# SETPTN [<Xd>]!, <Xn>!, <Xs>
|
8
|
+
class SETPTN
|
9
|
+
def encode
|
10
|
+
raise NotImplementedError
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def SETPTN sz, rs, rn, rd
|
16
|
+
insn = 0b00_011_0_01_11_0_00000_xx11_01_00000_00000
|
17
|
+
insn |= ((sz & 0x3) << 30)
|
18
|
+
insn |= ((rs & 0x1f) << 16)
|
19
|
+
insn |= ((rn & 0x1f) << 5)
|
20
|
+
insn |= (rd & 0x1f)
|
21
|
+
insn
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SMADDL -- A64
|
4
|
+
# Signed Multiply-Add Long
|
5
|
+
# SMADDL <Xd>, <Wn>, <Wm>, <Xa>
|
6
|
+
class SMADDL
|
7
|
+
def initialize rd, rn, rm, ra
|
8
|
+
@rd = rd
|
9
|
+
@rn = rn
|
10
|
+
@rm = rm
|
11
|
+
@ra = ra
|
12
|
+
end
|
13
|
+
|
14
|
+
def encode
|
15
|
+
self.SMADDL(@rm.to_i, @ra.to_i, @rn.to_i, @rd.to_i)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def SMADDL rm, ra, rn, rd
|
21
|
+
insn = 0b1_00_11011_0_01_00000_0_00000_00000_00000
|
22
|
+
insn |= ((rm & 0x1f) << 16)
|
23
|
+
insn |= ((ra & 0x1f) << 10)
|
24
|
+
insn |= ((rn & 0x1f) << 5)
|
25
|
+
insn |= (rd & 0x1f)
|
26
|
+
insn
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SMC -- A64
|
4
|
+
# Secure Monitor Call
|
5
|
+
# SMC #<imm>
|
6
|
+
class SMC
|
7
|
+
def initialize imm16
|
8
|
+
@imm16 = imm16
|
9
|
+
end
|
10
|
+
|
11
|
+
def encode
|
12
|
+
self.SMC(@imm16)
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def SMC imm16
|
18
|
+
insn = 0b11010100_000_0000000000000000_000_11
|
19
|
+
insn |= ((imm16 & 0xffff) << 5)
|
20
|
+
insn
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SMSUBL -- A64
|
4
|
+
# Signed Multiply-Subtract Long
|
5
|
+
# SMSUBL <Xd>, <Wn>, <Wm>, <Xa>
|
6
|
+
class SMSUBL
|
7
|
+
def initialize rd, rn, rm, ra
|
8
|
+
@rd = rd
|
9
|
+
@rn = rn
|
10
|
+
@rm = rm
|
11
|
+
@ra = ra
|
12
|
+
end
|
13
|
+
|
14
|
+
def encode
|
15
|
+
self.SMSUBL(@rm.to_i, @ra.to_i, @rn.to_i, @rd.to_i)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def SMSUBL rm, ra, rn, rd
|
21
|
+
insn = 0b1_00_11011_0_01_00000_1_00000_00000_00000
|
22
|
+
insn |= ((rm & 0x1f) << 16)
|
23
|
+
insn |= ((ra & 0x1f) << 10)
|
24
|
+
insn |= ((rn & 0x1f) << 5)
|
25
|
+
insn |= (rd & 0x1f)
|
26
|
+
insn
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# SMULH -- A64
|
4
|
+
# Signed Multiply High
|
5
|
+
# SMULH <Xd>, <Xn>, <Xm>
|
6
|
+
class SMULH
|
7
|
+
def initialize rd, rn, rm
|
8
|
+
@rd = rd
|
9
|
+
@rn = rn
|
10
|
+
@rm = rm
|
11
|
+
end
|
12
|
+
|
13
|
+
def encode
|
14
|
+
self.SMULH(@rm.to_i, @rn.to_i, @rd.to_i)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def SMULH rm, rn, rd
|
20
|
+
insn = 0b1_00_11011_0_10_00000_0_11111_00000_00000
|
21
|
+
insn |= ((rm & 0x1f) << 16)
|
22
|
+
insn |= ((rn & 0x1f) << 5)
|
23
|
+
insn |= (rd & 0x1f)
|
24
|
+
insn
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# ST2G -- A64
|
4
|
+
# Store Allocation Tags
|
5
|
+
# ST2G <Xt|SP>, [<Xn|SP>], #<simm>
|
6
|
+
# ST2G <Xt|SP>, [<Xn|SP>, #<simm>]!
|
7
|
+
# ST2G <Xt|SP>, [<Xn|SP>{, #<simm>}]
|
8
|
+
class ST2G
|
9
|
+
def initialize xt, xn, imm9, option
|
10
|
+
@xt = xt
|
11
|
+
@xn = xn
|
12
|
+
@imm9 = imm9
|
13
|
+
@option = option
|
14
|
+
end
|
15
|
+
|
16
|
+
def encode
|
17
|
+
self.ST2G(@imm9, @option, @xn.to_i, @xt.to_i)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def ST2G imm9, option, xn, xt
|
23
|
+
insn = 0b11011001_1_0_1_000000000_00_00000_00000
|
24
|
+
insn |= ((imm9 & 0x1ff) << 12)
|
25
|
+
insn |= ((option & 0x3) << 10)
|
26
|
+
insn |= ((xn & 0x1f) << 5)
|
27
|
+
insn |= (xt & 0x1f)
|
28
|
+
insn
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# ST64B -- A64
|
4
|
+
# Single-copy Atomic 64-byte Store without Return
|
5
|
+
# ST64B <Xt>, [<Xn|SP> {,#0}]
|
6
|
+
class ST64B
|
7
|
+
def initialize rt, rn
|
8
|
+
@rt = rt
|
9
|
+
@rn = rn
|
10
|
+
end
|
11
|
+
|
12
|
+
def encode
|
13
|
+
self.ST64B(@rn.to_i, @rt.to_i)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def ST64B rn, rt
|
19
|
+
insn = 0b11_111_0_00_0_0_1_11111_1_001_00_00000_00000
|
20
|
+
insn |= ((rn & 0x1f) << 5)
|
21
|
+
insn |= (rt & 0x1f)
|
22
|
+
insn
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# ST64BV -- A64
|
4
|
+
# Single-copy Atomic 64-byte Store with Return
|
5
|
+
# ST64BV <Xs>, <Xt>, [<Xn|SP>]
|
6
|
+
class ST64BV
|
7
|
+
def initialize rs, rt, rn
|
8
|
+
@rs = rs
|
9
|
+
@rt = rt
|
10
|
+
@rn = rn
|
11
|
+
end
|
12
|
+
|
13
|
+
def encode
|
14
|
+
self.ST64BV(@rs.to_i, @rn.to_i, @rt.to_i)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def ST64BV rs, rn, rt
|
20
|
+
insn = 0b11_111_0_00_0_0_1_00000_1_011_00_00000_00000
|
21
|
+
insn |= ((rs & 0x1f) << 16)
|
22
|
+
insn |= ((rn & 0x1f) << 5)
|
23
|
+
insn |= (rt & 0x1f)
|
24
|
+
insn
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# ST64BV0 -- A64
|
4
|
+
# Single-copy Atomic 64-byte EL0 Store with Return
|
5
|
+
# ST64BV0 <Xs>, <Xt>, [<Xn|SP>]
|
6
|
+
class ST64BV0
|
7
|
+
def initialize rs, rt, rn
|
8
|
+
@rs = rs
|
9
|
+
@rt = rt
|
10
|
+
@rn = rn
|
11
|
+
end
|
12
|
+
|
13
|
+
def encode
|
14
|
+
self.ST64BV0(@rs.to_i, @rn.to_i, @rt.to_i)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def ST64BV0 rs, rn, rt
|
20
|
+
insn = 0b11_111_0_00_0_0_1_00000_1_010_00_00000_00000
|
21
|
+
insn |= ((rs & 0x1f) << 16)
|
22
|
+
insn |= ((rn & 0x1f) << 5)
|
23
|
+
insn |= (rt & 0x1f)
|
24
|
+
insn
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module AArch64
|
2
|
+
module Instructions
|
3
|
+
# STG -- A64
|
4
|
+
# Store Allocation Tag
|
5
|
+
# STG <Xt|SP>, [<Xn|SP>], #<simm>
|
6
|
+
# STG <Xt|SP>, [<Xn|SP>, #<simm>]!
|
7
|
+
# STG <Xt|SP>, [<Xn|SP>{, #<simm>}]
|
8
|
+
class STG
|
9
|
+
def initialize xt, xn, imm9, option
|
10
|
+
@xt = xt
|
11
|
+
@xn = xn
|
12
|
+
@imm9 = imm9
|
13
|
+
@option = option
|
14
|
+
end
|
15
|
+
|
16
|
+
def encode
|
17
|
+
self.STG(@imm9, @option, @xn.to_i, @xt.to_i)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def STG imm9, option, xn, xt
|
23
|
+
insn = 0b11011001_0_0_1_000000000_00_00000_00000
|
24
|
+
insn |= ((imm9 & 0x1ff) << 12)
|
25
|
+
insn |= ((option & 0x3) << 10)
|
26
|
+
insn |= ((xn & 0x1f) << 5)
|
27
|
+
insn |= (xt & 0x1f)
|
28
|
+
insn
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|