Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/seed/ng/a64/tests/enc.cases # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / ng / a64 / tests / enc.cases` 289 lines ยท 10475 bytes Raw Blame History 1 @ng a64-enc 2 ; Encoder cases for seed/ng/a64/gate.om. One case per line: FORM operands | expected disassembly. 3 ; The expected text is written by hand from Arm ARM DDI 0487 M.d (encoding diagram and preferred 4 ; disassembly alias of each form); GNU objdump is the referee that must print the same text. 5 ; Comparison: blanks collapsed, objdump's trailing `// ...` comment dropped, `@+N` / `@-N` means the case's own 6 ; address plus / minus N bytes. Operands: decimal, -decimal (two's complement) or lowercase 0x hex. 7 ; ---- shifted register ---- 8 addx 1 2 3 | add x1, x2, x3 9 addx 1 2 3 0 4 | add x1, x2, x3, lsl #4 10 addx 9 10 11 2 63 | add x9, x10, x11, asr #63 11 addw 1 2 3 | add w1, w2, w3 12 subx 1 2 3 | sub x1, x2, x3 13 subx 1 31 3 | neg x1, x3 14 subw 4 5 6 1 3 | sub w4, w5, w6, lsr #3 15 addsx 1 2 3 | adds x1, x2, x3 16 addsx 31 2 3 | cmn x2, x3 17 addsw 1 2 3 | adds w1, w2, w3 18 subsx 1 2 3 | subs x1, x2, x3 19 subsx 31 2 3 | cmp x2, x3 20 subsx 31 16 0 2 63 | cmp x16, x0, asr #63 21 subsw 31 2 3 | cmp w2, w3 22 andx 1 2 3 | and x1, x2, x3 23 andw 1 2 3 | and w1, w2, w3 24 orrx 1 2 3 | orr x1, x2, x3 25 orrx 1 31 3 | mov x1, x3 26 orrw 1 31 3 | mov w1, w3 27 eorx 1 2 3 | eor x1, x2, x3 28 eorw 1 2 3 | eor w1, w2, w3 29 andsx 1 2 3 | ands x1, x2, x3 30 andsx 31 2 3 | tst x2, x3 31 bicx 1 2 3 | bic x1, x2, x3 32 ornx 1 31 3 | mvn x1, x3 33 ; ---- multiply, divide, variable shift ---- 34 mulx 1 2 3 | mul x1, x2, x3 35 mulw 1 2 3 | mul w1, w2, w3 36 smulh 1 2 3 | smulh x1, x2, x3 37 umulh 1 2 3 | umulh x1, x2, x3 38 sdivx 1 2 3 | sdiv x1, x2, x3 39 udivx 1 2 3 | udiv x1, x2, x3 40 sdivw 1 2 3 | sdiv w1, w2, w3 41 udivw 1 2 3 | udiv w1, w2, w3 42 lslvx 1 2 3 | lsl x1, x2, x3 43 lsrvx 1 2 3 | lsr x1, x2, x3 44 asrvx 1 2 3 | asr x1, x2, x3 45 rorvx 1 2 3 | ror x1, x2, x3 46 lslvw 1 2 3 | lsl w1, w2, w3 47 lsrvw 1 2 3 | lsr w1, w2, w3 48 asrvw 1 2 3 | asr w1, w2, w3 49 maddx 1 2 3 4 | madd x1, x2, x3, x4 50 msubx 1 2 3 4 | msub x1, x2, x3, x4 51 ; ---- extended register ---- 52 addxe 1 2 3 6 0 | add x1, x2, w3, sxtw 53 subsxe 31 2 3 6 0 | cmp x2, w3, sxtw 54 subsxe 31 2 3 4 0 | cmp x2, w3, sxtb 55 subsxe 31 2 3 5 0 | cmp x2, w3, sxth 56 ; ---- immediate ---- 57 addxi 1 2 4095 0 | add x1, x2, #0xfff 58 addxi 1 2 1 1 | add x1, x2, #0x1, lsl #12 59 addxi 31 16 0 0 | mov sp, x16 60 addxi 27 31 0 0 | mov x27, sp 61 addwi 1 2 5 0 | add w1, w2, #0x5 62 subxi 1 2 16 0 | sub x1, x2, #0x10 63 subxi 31 31 32 0 | sub sp, sp, #0x20 64 subwi 1 2 16 0 | sub w1, w2, #0x10 65 addsxi 1 2 3 0 | adds x1, x2, #0x3 66 addsxi 31 2 1 0 | cmn x2, #0x1 67 subsxi 31 2 9 0 | cmp x2, #0x9 68 subsxi 1 2 9 0 | subs x1, x2, #0x9 69 subswi 31 2 9 0 | cmp w2, #0x9 70 addswi 1 2 3 0 | adds w1, w2, #0x3 71 ; ---- logical immediate (bitmask) ---- 72 andxi 1 2 0xff | and x1, x2, #0xff 73 andxi 1 2 0xff00ff00ff00ff00 | and x1, x2, #0xff00ff00ff00ff00 74 andxi 1 2 0x5555555555555555 | and x1, x2, #0x5555555555555555 75 andxi 1 2 0x8000000000000000 | and x1, x2, #0x8000000000000000 76 andxi 1 2 0xfffffffffffffffe | and x1, x2, #0xfffffffffffffffe 77 andxi 1 2 0x7ffffffffffffff0 | and x1, x2, #0x7ffffffffffffff0 78 orrxi 1 2 0xf0 | orr x1, x2, #0xf0 79 orrxi 1 31 0xffff0000ffff0000 | mov x1, #0xffff0000ffff0000 80 eorxi 1 2 0x1 | eor x1, x2, #0x1 81 andsxi 31 2 0x1 | tst x2, #0x1 82 andwi 1 2 0xff | and w1, w2, #0xff 83 orrwi 1 2 0xf0f0f0f0 | orr w1, w2, #0xf0f0f0f0 84 eorwi 1 2 0x80000000 | eor w1, w2, #0x80000000 85 ; ---- move wide ---- 86 movzx 1 5 0 | mov x1, #0x5 87 movzx 28 0x1000 1 | mov x28, #0x10000000 88 movzx 1 0x1234 3 | mov x1, #0x1234000000000000 89 movnx 1 0 0 | mov x1, #0xffffffffffffffff 90 movnx 1 5 0 | mov x1, #0xfffffffffffffffa 91 movkx 1 0x1234 2 | movk x1, #0x1234, lsl #32 92 movzw 1 7 0 | mov w1, #0x7 93 movnw 1 0 0 | mov w1, #0xffffffff 94 ; ---- bitfield, extract ---- 95 ubfmx 1 2 1 63 | lsr x1, x2, #1 96 ubfmx 1 2 60 59 | lsl x1, x2, #4 97 ubfmx 1 2 0 7 | ubfx x1, x2, #0, #8 98 sbfmx 1 2 0 31 | sxtw x1, w2 99 sbfmx 1 2 63 63 | asr x1, x2, #63 100 sbfmx 1 2 0 7 | sxtb x1, w2 101 sbfmx 1 2 0 15 | sxth x1, w2 102 ubfmw 1 2 0 7 | uxtb w1, w2 103 ubfmw 1 2 0 15 | uxth w1, w2 104 sbfmw 1 2 0 7 | sxtb w1, w2 105 extrx 1 2 3 8 | extr x1, x2, x3, #8 106 extrx 1 2 2 8 | ror x1, x2, #8 107 ; ---- conditional select ---- 108 cselx 1 2 3 0 | csel x1, x2, x3, eq 109 csincx 1 31 31 1 | cset x1, eq 110 csincx 1 2 2 0 | cinc x1, x2, ne 111 csincx 1 2 3 11 | csinc x1, x2, x3, lt 112 csinvx 1 31 31 0 | csetm x1, ne 113 csnegx 1 2 2 10 | cneg x1, x2, lt 114 csnegx 1 2 3 0 | csneg x1, x2, x3, eq 115 ; ---- loads and stores, unsigned offset (offset operand in access-size units) ---- 116 strb 1 2 3 | strb w1, [x2, #3] 117 strb 1 2 0 | strb w1, [x2] 118 ldrb 1 2 4095 | ldrb w1, [x2, #4095] 119 ldrsbx 1 2 1 | ldrsb x1, [x2, #1] 120 strh 1 2 1 | strh w1, [x2, #2] 121 ldrh 1 2 2 | ldrh w1, [x2, #4] 122 ldrshx 1 2 1 | ldrsh x1, [x2, #2] 123 strw 1 2 1 | str w1, [x2, #4] 124 ldrw 1 2 1 | ldr w1, [x2, #4] 125 ldrsw 1 2 1 | ldrsw x1, [x2, #4] 126 strx 30 31 3 | str x30, [sp, #24] 127 ldrx 1 2 4095 | ldr x1, [x2, #32760] 128 strs 1 2 1 | str s1, [x2, #4] 129 ldrs 1 2 1 | ldr s1, [x2, #4] 130 strd 16 31 1 | str d16, [sp, #8] 131 ldrd 1 2 0 | ldr d1, [x2] 132 ; ---- loads and stores, register offset (s 1 = scaled by the access size) ---- 133 strbr 1 2 3 0 | strb w1, [x2, x3] 134 ldrbr 1 2 3 0 | ldrb w1, [x2, x3] 135 ldrsbxr 1 2 3 0 | ldrsb x1, [x2, x3] 136 strhr 1 2 3 1 | strh w1, [x2, x3, lsl #1] 137 ldrhr 1 2 3 1 | ldrh w1, [x2, x3, lsl #1] 138 ldrshxr 1 2 3 1 | ldrsh x1, [x2, x3, lsl #1] 139 strwr 1 2 3 1 | str w1, [x2, x3, lsl #2] 140 ldrwr 1 2 3 0 | ldr w1, [x2, x3] 141 ldrswr 1 2 3 1 | ldrsw x1, [x2, x3, lsl #2] 142 strxr 1 2 3 1 | str x1, [x2, x3, lsl #3] 143 ldrxr 1 2 3 1 | ldr x1, [x2, x3, lsl #3] 144 strsr 1 2 3 1 | str s1, [x2, x3, lsl #2] 145 ldrsr 1 2 3 0 | ldr s1, [x2, x3] 146 strdr 1 2 3 1 | str d1, [x2, x3, lsl #3] 147 ldrdr 1 2 3 0 | ldr d1, [x2, x3] 148 ; ---- pairs (signed byte offset) ---- 149 stpx 29 30 31 -16 | stp x29, x30, [sp, #-16] 150 ldpx 19 20 31 16 | ldp x19, x20, [sp, #16] 151 stpxpre 29 30 31 -32 | stp x29, x30, [sp, #-32]! 152 ldpxpre 1 2 3 8 | ldp x1, x2, [x3, #8]! 153 stpxpost 1 2 3 16 | stp x1, x2, [x3], #16 154 ldpxpost 29 30 31 32 | ldp x29, x30, [sp], #32 155 stpd 8 9 31 504 | stp d8, d9, [sp, #504] 156 ldpd 8 9 31 -512 | ldp d8, d9, [sp, #-512] 157 ; ---- branches (distances in words; ADR in bytes) ---- 158 b 3 | b @+12 159 b -1 | b @-4 160 bl 2 | bl @+8 161 bcond 6 5 | b.vs @+20 162 bcond 0 1 | b.eq @+4 163 bcond 1 1 | b.ne @+4 164 bcond 8 -3 | b.hi @-12 165 bcond 11 2 | b.lt @+8 166 cbzx 1 4 | cbz x1, @+16 167 cbnzx 1 -2 | cbnz x1, @-8 168 cbzw 1 1 | cbz w1, @+4 169 cbnzw 1 1 | cbnz w1, @+4 170 tbz 1 3 2 | tbz w1, #3, @+8 171 tbz 1 40 2 | tbz x1, #40, @+8 172 tbnz 1 63 -1 | tbnz x1, #63, @-4 173 ret 30 | ret 174 ret 1 | ret x1 175 br 16 | br x16 176 blr 16 | blr x16 177 svc 0 | svc #0x0 178 adr 1 8 | adr x1, @+8 179 adr 1 -4 | adr x1, @-4 180 ; ---- scalar floating point ---- 181 faddd 1 2 3 | fadd d1, d2, d3 182 fsubd 1 2 3 | fsub d1, d2, d3 183 fmuld 1 2 3 | fmul d1, d2, d3 184 fdivd 1 2 3 | fdiv d1, d2, d3 185 fmaxd 1 2 3 | fmax d1, d2, d3 186 fmind 1 2 3 | fmin d1, d2, d3 187 fmaxnmd 1 2 3 | fmaxnm d1, d2, d3 188 fminnmd 1 2 3 | fminnm d1, d2, d3 189 fadds 1 2 3 | fadd s1, s2, s3 190 fsubs 1 2 3 | fsub s1, s2, s3 191 fmuls 1 2 3 | fmul s1, s2, s3 192 fdivs 1 2 3 | fdiv s1, s2, s3 193 fmaxs 1 2 3 | fmax s1, s2, s3 194 fmins 1 2 3 | fmin s1, s2, s3 195 fmaxnms 1 2 3 | fmaxnm s1, s2, s3 196 fminnms 1 2 3 | fminnm s1, s2, s3 197 fsqrtd 1 2 | fsqrt d1, d2 198 fabsd 1 2 | fabs d1, d2 199 fnegd 1 2 | fneg d1, d2 200 fmovd 1 2 | fmov d1, d2 201 fsqrts 1 2 | fsqrt s1, s2 202 fabss 1 2 | fabs s1, s2 203 fnegs 1 2 | fneg s1, s2 204 fmovs 1 2 | fmov s1, s2 205 fcmpd 1 2 | fcmp d1, d2 206 fcmps 1 2 | fcmp s1, s2 207 fmaddd 1 2 3 4 | fmadd d1, d2, d3, d4 208 fmadds 1 2 3 4 | fmadd s1, s2, s3, s4 209 fcvtds 1 2 | fcvt d1, s2 210 fcvtsd 1 2 | fcvt s1, d2 211 fmovxd 1 2 | fmov x1, d2 212 fmovdx 1 2 | fmov d1, x2 213 fmovws 1 2 | fmov w1, s2 214 fmovsw 1 2 | fmov s1, w2 215 scvtfdx 1 2 | scvtf d1, x2 216 ucvtfdx 1 2 | ucvtf d1, x2 217 scvtfsx 1 2 | scvtf s1, x2 218 ucvtfsx 1 2 | ucvtf s1, x2 219 fcvtzsxd 1 2 | fcvtzs x1, d2 220 fcvtzuxd 1 2 | fcvtzu x1, d2 221 fcvtzsxs 1 2 | fcvtzs x1, s2 222 fcvtzuxs 1 2 | fcvtzu x1, s2 223 rorvw 1 2 3 | ror w1, w2, w3 224 ; Scalar floats (NgFloatFill): FCSEL S/D (kind 8) and MSR FPCR, Xt (kind 22), then the operand shapes the float 225 ; selection emits with existing forms (FPCR RMode value, exponent extracts, D saves and spills, FMOV of scratch v31). 226 fcseld 1 2 3 1 | fcsel d1, d2, d3, ne 227 fcsels 4 5 6 11 | fcsel s4, s5, s6, lt 228 fcseld 31 29 30 15 | fcsel d31, d29, d30, nv 229 msrfpcr 3 | msr fpcr, x3 230 msrfpcr 15 | msr fpcr, x15 231 msrfpcr 31 | msr fpcr, xzr 232 movzx 15 192 1 | mov x15, #0xc00000 233 ubfmx 15 16 23 30 | ubfx x15, x16, #23, #8 234 ubfmx 17 17 52 62 | ubfx x17, x17, #52, #11 235 stpd 8 9 31 24 | stp d8, d9, [sp, #24] 236 ldpd 14 15 31 496 | ldp d14, d15, [sp, #496] 237 strd 31 31 511 | str d31, [sp, #4088] 238 ldrd 29 31 0 | ldr d29, [sp] 239 fmovdx 31 16 | fmov d31, x16 240 fmovxd 17 29 | fmov x17, d29 241 ; Fill (NgFloatFill): DUP Vd.2D, Xn (kind 19) and STR Qt register offset (kind 10), then the existing forms in the 242 ; shapes the fill emits (pattern replication, byte count, tails). 243 dup2d 31 17 | dup v31.2d, x17 244 dup2d 0 30 | dup v0.2d, x30 245 strqr 31 1 15 0 | str q31, [x1, x15] 246 strqr 2 3 4 1 | str q2, [x3, x4, lsl #4] 247 orrx 17 17 17 0 8 | orr x17, x17, x17, lsl #8 248 andxi 17 3 255 | and x17, x3, #0xff 249 addx 15 31 9 0 3 | add x15, xzr, x9, lsl #3 250 tbz 15 3 3 | tbz w15, #3, @+12 251 ; Packed 16-byte float vectors (NgVecA64, DESIGN.md section 12): STR/LDR Qt (unsigned offset and register offset), 252 ; ORR Vd.16B (MOV alias when Vn = Vm), DUP element (vector 4S/2D and scalar S/D), and FADD/FSUB/FMUL/FMLA 4S/2D. 253 strq 1 2 0 | str q1, [x2] 254 strq 31 31 1 | str q31, [sp, #16] 255 strq 3 31 4095 | str q3, [sp, #65520] 256 ldrq 1 2 0 | ldr q1, [x2] 257 ldrq 29 31 2 | ldr q29, [sp, #32] 258 ldrq 4 31 4095 | ldr q4, [sp, #65520] 259 ldrqr 1 2 3 0 | ldr q1, [x2, x3] 260 ldrqr 2 3 4 1 | ldr q2, [x3, x4, lsl #4] 261 orr16b 1 2 2 | mov v1.16b, v2.16b 262 orr16b 1 2 3 | orr v1.16b, v2.16b, v3.16b 263 dupv4s 1 2 0 | dup v1.4s, v2.s[0] 264 dupv4s 3 4 3 | dup v3.4s, v4.s[3] 265 dupv2d 1 2 0 | dup v1.2d, v2.d[0] 266 dupv2d 3 4 1 | dup v3.2d, v4.d[1] 267 dups 1 2 0 | mov s1, v2.s[0] 268 dups 1 2 2 | mov s1, v2.s[2] 269 dups 5 6 3 | mov s5, v6.s[3] 270 dupd 1 2 0 | mov d1, v2.d[0] 271 dupd 1 2 1 | mov d1, v2.d[1] 272 fadd4s 1 2 3 | fadd v1.4s, v2.4s, v3.4s 273 fadd2d 1 2 3 | fadd v1.2d, v2.2d, v3.2d 274 fsub4s 1 2 3 | fsub v1.4s, v2.4s, v3.4s 275 fsub2d 1 2 3 | fsub v1.2d, v2.2d, v3.2d 276 fmul4s 1 2 3 | fmul v1.4s, v2.4s, v3.4s 277 fmul2d 1 2 3 | fmul v1.2d, v2.2d, v3.2d 278 fmla4s 1 2 3 | fmla v1.4s, v2.4s, v3.4s 279 fmla2d 1 2 3 | fmla v1.2d, v2.2d, v3.2d 280 ; Boundaries next to the refusals of tests/enc-refuse.cases: the largest in-field value each form accepts. 281 orrx 1 2 3 3 5 | orr x1, x2, x3, ror #5 282 addw 1 2 3 0 31 | add w1, w2, w3, lsl #31 283 subw 1 2 3 2 31 | sub w1, w2, w3, asr #31 284 movzx 1 5 3 | mov x1, #0x5000000000000 285 movzw 1 5 1 | mov w1, #0x50000 286 ubfmx 1 2 40 3 | ubfiz x1, x2, #24, #4 287 ubfmw 1 2 31 31 | lsr w1, w2, #31 288 extrx 1 2 3 63 | extr x1, x2, x3, #63 289 cbzx 1 262143 | cbz x1, @+`1048572`