; RUN: llvm-mc -triple arm64-apple-darwin -show-encoding < %s | FileCheck %s
foo:
;-----------------------------------------------------------------------------
; Indexed loads
;-----------------------------------------------------------------------------
ldr w5, [x4, ldr x4, [x3]
ldr x2, [sp, ldr b5, [sp, ldr h6, [sp, ldr s7, [sp, ldr d8, [sp, ldr q9, [sp, ldrb w4, [x3]
ldrb w5, [x4, ldrb w2, [x3, _foo@pageoff]
ldrb w3, [x2, "+[Test method].var"@PAGEOFF]
ldrsb w9, [x3]
ldrsb x2, [sp, ldrh w2, [sp, ldrsh w3, [sp, ldrsh x5, [x9, ldrsw x9, [sp,
prfm prfm prfm pldl1keep, [x2]
prfm pldl1strm, [x2]
prfm pldl2keep, [x2]
prfm pldl2strm, [x2]
prfm pldl3keep, [x2]
prfm pldl3strm, [x2]
prfm pstl1keep, [x2]
prfm pstl1strm, [x2]
prfm pstl2keep, [x2]
prfm pstl2strm, [x2]
prfm pstl3keep, [x2]
prfm pstl3strm, [x2]
prfm pstl3strm, [x4, x5, lsl
; CHECK: ldr w5, [x4, ; CHECK: ldr x4, [x3] ; encoding: [0x64,0x00,0x40,0xf9]
; CHECK: ldr x2, [sp, ; CHECK: ldr b5, [sp, ; CHECK: ldr h6, [sp, ; CHECK: ldr s7, [sp, ; CHECK: ldr d8, [sp, ; CHECK: ldr q9, [sp, ; CHECK: ldrb w4, [x3] ; encoding: [0x64,0x00,0x40,0x39]
; CHECK: ldrb w5, [x4, ; CHECK: ldrb w2, [x3, _foo@PAGEOFF] ; encoding: [0x62,0bAAAAAA00,0b01AAAAAA,0x39]
; CHECK: ldrb w3, [x2, "+[Test method].var"@PAGEOFF] ; encoding: [0x43,0bAAAAAA00,0b01AAAAAA,0x39]
; CHECK: ldrsb w9, [x3] ; encoding: [0x69,0x00,0xc0,0x39]
; CHECK: ldrsb x2, [sp, ; CHECK: ldrh w2, [sp, ; CHECK: ldrsh w3, [sp, ; CHECK: ldrsh x5, [x9, ; CHECK: ldrsw x9, [sp, ; CHECK: prfm pldl3strm, [sp, ; CHECK: prfm ; CHECK: prfm pldl1keep, [x2] ; encoding: [0x40,0x00,0x80,0xf9]
; CHECK: prfm pldl1strm, [x2] ; encoding: [0x41,0x00,0x80,0xf9]
; CHECK: prfm pldl2keep, [x2] ; encoding: [0x42,0x00,0x80,0xf9]
; CHECK: prfm pldl2strm, [x2] ; encoding: [0x43,0x00,0x80,0xf9]
; CHECK: prfm pldl3keep, [x2] ; encoding: [0x44,0x00,0x80,0xf9]
; CHECK: prfm pldl3strm, [x2] ; encoding: [0x45,0x00,0x80,0xf9]
; CHECK: prfm pstl1keep, [x2] ; encoding: [0x50,0x00,0x80,0xf9]
; CHECK: prfm pstl1strm, [x2] ; encoding: [0x51,0x00,0x80,0xf9]
; CHECK: prfm pstl2keep, [x2] ; encoding: [0x52,0x00,0x80,0xf9]
; CHECK: prfm pstl2strm, [x2] ; encoding: [0x53,0x00,0x80,0xf9]
; CHECK: prfm pstl3keep, [x2] ; encoding: [0x54,0x00,0x80,0xf9]
; CHECK: prfm pstl3strm, [x2] ; encoding: [0x55,0x00,0x80,0xf9]
; CHECK: prfm pstl3strm, [x4, x5, lsl
;-----------------------------------------------------------------------------
; Indexed stores
;-----------------------------------------------------------------------------
str x4, [x3]
str x2, [sp, str w5, [x4, str b5, [sp, str h6, [sp, str s7, [sp, str d8, [sp, str q9, [sp, strb w4, [x3]
strb w5, [x4, strh w2, [sp,
; CHECK: str x4, [x3] ; encoding: [0x64,0x00,0x00,0xf9]
; CHECK: str x2, [sp, ; CHECK: str w5, [x4, ; CHECK: str b5, [sp, ; CHECK: str h6, [sp, ; CHECK: str s7, [sp, ; CHECK: str d8, [sp, ; CHECK: str q9, [sp, ; CHECK: strb w4, [x3] ; encoding: [0x64,0x00,0x00,0x39]
; CHECK: strb w5, [x4, ; CHECK: strh w2, [sp,
;-----------------------------------------------------------------------------
; Unscaled immediate loads and stores
;-----------------------------------------------------------------------------
ldur w2, [x3]
ldur w2, [sp, ldur x2, [x3]
ldur x2, [sp, ldur b5, [sp, ldur h6, [sp, ldur s7, [sp, ldur d8, [sp, ldur q9, [sp, ldursb w9, [x3]
ldursb x2, [sp, ldursh w3, [sp, ldursh x5, [x9, ldursw x9, [sp,
; CHECK: ldur w2, [x3] ; encoding: [0x62,0x00,0x40,0xb8]
; CHECK: ldur w2, [sp, ; CHECK: ldur x2, [x3] ; encoding: [0x62,0x00,0x40,0xf8]
; CHECK: ldur x2, [sp, ; CHECK: ldur b5, [sp, ; CHECK: ldur h6, [sp, ; CHECK: ldur s7, [sp, ; CHECK: ldur d8, [sp, ; CHECK: ldur q9, [sp, ; CHECK: ldursb w9, [x3] ; encoding: [0x69,0x00,0xc0,0x38]
; CHECK: ldursb x2, [sp, ; CHECK: ldursh w3, [sp, ; CHECK: ldursh x5, [x9, ; CHECK: ldursw x9, [sp,
stur w4, [x3]
stur w2, [sp, stur x4, [x3]
stur x2, [sp, stur w5, [x4, stur b5, [sp, stur h6, [sp, stur s7, [sp, stur d8, [sp, stur q9, [sp, sturb w4, [x3]
sturb w5, [x4, sturh w2, [sp, prfum
; CHECK: stur w4, [x3] ; encoding: [0x64,0x00,0x00,0xb8]
; CHECK: stur w2, [sp, ; CHECK: stur x4, [x3] ; encoding: [0x64,0x00,0x00,0xf8]
; CHECK: stur x2, [sp, ; CHECK: stur w5, [x4, ; CHECK: stur b5, [sp, ; CHECK: stur h6, [sp, ; CHECK: stur s7, [sp, ; CHECK: stur d8, [sp, ; CHECK: stur q9, [sp, ; CHECK: sturb w4, [x3] ; encoding: [0x64,0x00,0x00,0x38]
; CHECK: sturb w5, [x4, ; CHECK: sturh w2, [sp, ; CHECK: prfum pldl3strm, [sp,
;-----------------------------------------------------------------------------
; Unprivileged loads and stores
;-----------------------------------------------------------------------------
ldtr w3, [x4, ldtr x3, [x4, ldtrb w3, [x4, ldtrsb w9, [x3]
ldtrsb x2, [sp, ldtrh w3, [x4, ldtrsh w3, [sp, ldtrsh x5, [x9, ldtrsw x9, [sp,
; CHECK: ldtr w3, [x4, ; CHECK: ldtr x3, [x4, ; CHECK: ldtrb w3, [x4, ; CHECK: ldtrsb w9, [x3] ; encoding: [0x69,0x08,0xc0,0x38]
; CHECK: ldtrsb x2, [sp, ; CHECK: ldtrh w3, [x4, ; CHECK: ldtrsh w3, [sp, ; CHECK: ldtrsh x5, [x9, ; CHECK: ldtrsw x9, [sp,
sttr w5, [x4, sttr x4, [x3]
sttr x2, [sp, sttrb w4, [x3]
sttrb w5, [x4, sttrh w2, [sp,
; CHECK: sttr w5, [x4, ; CHECK: sttr x4, [x3] ; encoding: [0x64,0x08,0x00,0xf8]
; CHECK: sttr x2, [sp, ; CHECK: sttrb w4, [x3] ; encoding: [0x64,0x08,0x00,0x38]
; CHECK: sttrb w5, [x4, ; CHECK: sttrh w2, [sp,
;-----------------------------------------------------------------------------
; Pre-indexed loads and stores
;-----------------------------------------------------------------------------
ldr x29, [x7, ldr x30, [x7, ldr b5, [x0, ldr h6, [x0, ldr s7, [x0, ldr d8, [x0, ldr q9, [x0,
str x30, [x7, str x29, [x7, str b5, [x0, str h6, [x0,