tinycodinglm / asm /arm64-instructions.jsonl
winapiadmin's picture
Upload folder using huggingface_hub
1f3a244 verified
|
Raw History Blame Contribute Delete
2.7 kB
{"type": "session", "harness": "opencode", "id": "arm64-instructions", "name": "ARM64 Instruction Set Deep"}
{"type": "message", "message": {"role": "system", "content": "You are an expert software engineer."}}
{"type": "message", "message": {"role": "user", "content": "Explain ARM64 instructions in detail"}}
{"type": "message", "message": {"role": "assistant", "content": "Data movement: MOV (register), MOVZ/MOVK (move with zero/keep, for building immediates in 16-bit chunks: MOVZ X0, #0x1234; MOVK X0, #0x5678, LSL #16). MVN (bitwise NOT). MRS/MSR (move to/from system registers).\n\nLoad/Store: LDR/STR (64-bit), LDRB/LDRH (byte/halfword), LDRSB/LDRSH/LDRSW (sign-extend). LDP/STP (load/store pair - efficient for push/pop of two registers). LDXR/STXR (exclusive load/store for atomics). LDAR/STAR (acquire/release semantics for ordered memory).\n\nAddressing modes: [Xn, #imm] (base+offset), [Xn, Xm] (base+register), [Xn, #imm]! (pre-indexed, writeback), [Xn], #imm (post-indexed). Unsigned offset scaled by access size: LDR X0, [X1, #8*8] for X1+64.\n\nArithmetic: ADD/SUB (register, immediate, shifted register, extended register). ADDS/SUBS (set flags). ADC/SBC (add/subtract with carry). MADD/MSUB (multiply-add/subtract: Xd = Xn * Xm + Xd or - Xd). MUL (alias for MADD Xd, Xn, Xm, XZR). SDIV/UDIV (signed/unsigned divide, 12-20 cycles). SDIV/UDIV by power-of-2 optimized by compiler to shift.\n\nLogic: AND/ORR/EOR (register, immediate, shifted). ANDS (set flags). TST (ANDS alias, discards result). LSL/LSR/ASR/ROR (shifts, also available as aliases for EXT).\n\nShift: LSL Xd, Xn, #imm (immediate) or LSL Xd, Xn, Xm (register). ROR (rotate right). ExT: extract bits from two registers.\n\nCompare: CMP (SUBS alias), CMN (ADDS alias), TST (ANDS alias). CCMP/CCMN (conditional compare: if condition then compare else set flags to immediate).\n\nConditional: CSEL (conditional select: Xd = cond ? Xn : Xm). CSET/CSETM (conditional set/mask: Xd = cond ? 1 : 0 or all-ones).\n\nBranch: B (unconditional), BL (branch and link = call, saves return in X30), BR/BLR (indirect branch via register). B.cond (conditional: B.EQ, B.NE, B.LT, B.GT, B.LE, B.GE, B.CC, B.CS, B.MI, B.PL, B.VS, B.VC, B.HI, B.LS). CBZ/CBNZ (compare and branch if zero/nonzero, no flags needed). TBZ/TBNZ (test and branch if bit set/clear, useful for flag checking).\n\nSystem: SVC (supervisor call = syscall, X0=num, X0-X7=args, X0=return). HVC (hypervisor call). SMC (secure monitor call). BRK (breakpoint). WFI/WFE (wait for interrupt/event). DMB/DSB/ISB (memory barriers).\n\nAtomic: LDXR/STXR (exclusive), LDADD/LDCLR/LDEOR/LDSET/SWP (atomic read-modify-write, ARMv8.1+). CAS (compare-and-swap, ARMv8.1+)."}}