xref: /aosp_15_r20/external/llvm/test/MC/Sparc/sparc-mem-instructions.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker! RUN: llvm-mc %s -arch=sparc   -show-encoding | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker! RUN: llvm-mc %s -arch=sparcv9 -show-encoding | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker        ! CHECK: ldsb [%i0+%l6], %o2  ! encoding: [0xd4,0x4e,0x00,0x16]
5*9880d681SAndroid Build Coastguard Worker        ldsb [%i0 + %l6], %o2
6*9880d681SAndroid Build Coastguard Worker        ! CHECK: ldsb [%i0+32], %o2   ! encoding: [0xd4,0x4e,0x20,0x20]
7*9880d681SAndroid Build Coastguard Worker        ldsb [%i0 + 32], %o2
8*9880d681SAndroid Build Coastguard Worker        ! CHECK: ldsb [%g1], %o4      ! encoding: [0xd8,0x48,0x40,0x00]
9*9880d681SAndroid Build Coastguard Worker        ldsb [%g1], %o4
10*9880d681SAndroid Build Coastguard Worker        ! CHECK: ldsba [%i0+%l6] 131, %o2  ! encoding: [0xd4,0xce,0x10,0x76]
11*9880d681SAndroid Build Coastguard Worker        ldsba [%i0 + %l6] 131, %o2
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker        ! CHECK: ldsh [%i0+%l6], %o2  ! encoding: [0xd4,0x56,0x00,0x16]
14*9880d681SAndroid Build Coastguard Worker        ldsh [%i0 + %l6], %o2
15*9880d681SAndroid Build Coastguard Worker        ! CHECK: ldsh [%i0+32], %o2   ! encoding: [0xd4,0x56,0x20,0x20]
16*9880d681SAndroid Build Coastguard Worker        ldsh [%i0 + 32], %o2
17*9880d681SAndroid Build Coastguard Worker        ! CHECK: ldsh [%g1], %o4      ! encoding: [0xd8,0x50,0x40,0x00]
18*9880d681SAndroid Build Coastguard Worker        ldsh [%g1], %o4
19*9880d681SAndroid Build Coastguard Worker        ! CHECK: ldsha [%i0+%l6] 131, %o2 ! encoding: [0xd4,0xd6,0x10,0x76]
20*9880d681SAndroid Build Coastguard Worker        ldsha [%i0 + %l6] 131, %o2
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker        ! CHECK: ldub [%i0+%l6], %o2  ! encoding: [0xd4,0x0e,0x00,0x16]
23*9880d681SAndroid Build Coastguard Worker        ldub [%i0 + %l6], %o2
24*9880d681SAndroid Build Coastguard Worker        ! CHECK: ldub [%i0+32], %o2   ! encoding: [0xd4,0x0e,0x20,0x20]
25*9880d681SAndroid Build Coastguard Worker        ldub [%i0 + 32], %o2
26*9880d681SAndroid Build Coastguard Worker        ! CHECK: ldub [%g1], %o2      ! encoding: [0xd4,0x08,0x40,0x00]
27*9880d681SAndroid Build Coastguard Worker        ldub [%g1], %o2
28*9880d681SAndroid Build Coastguard Worker        ! CHECK: lduba [%i0+%l6] 131, %o2 ! encoding: [0xd4,0x8e,0x10,0x76]
29*9880d681SAndroid Build Coastguard Worker        lduba [%i0 + %l6] 131, %o2
30*9880d681SAndroid Build Coastguard Worker
31*9880d681SAndroid Build Coastguard Worker        ! CHECK: lduh [%i0+%l6], %o2  ! encoding: [0xd4,0x16,0x00,0x16]
32*9880d681SAndroid Build Coastguard Worker        lduh [%i0 + %l6], %o2
33*9880d681SAndroid Build Coastguard Worker        ! CHECK: lduh [%i0+32], %o2   ! encoding: [0xd4,0x16,0x20,0x20]
34*9880d681SAndroid Build Coastguard Worker        lduh [%i0 + 32], %o2
35*9880d681SAndroid Build Coastguard Worker        ! CHECK: lduh [%g1], %o2      ! encoding: [0xd4,0x10,0x40,0x00]
36*9880d681SAndroid Build Coastguard Worker        lduh [%g1], %o2
37*9880d681SAndroid Build Coastguard Worker        ! CHECK: lduha [%i0+%l6] 131, %o2 ! encoding: [0xd4,0x96,0x10,0x76]
38*9880d681SAndroid Build Coastguard Worker        lduha [%i0 + %l6] 131, %o2
39*9880d681SAndroid Build Coastguard Worker
40*9880d681SAndroid Build Coastguard Worker        ! CHECK: ld [%i0+%l6], %o2    ! encoding: [0xd4,0x06,0x00,0x16]
41*9880d681SAndroid Build Coastguard Worker        ld [%i0 + %l6], %o2
42*9880d681SAndroid Build Coastguard Worker        ! CHECK: ld [%i0+32], %o2     ! encoding: [0xd4,0x06,0x20,0x20]
43*9880d681SAndroid Build Coastguard Worker        ld [%i0 + 32], %o2
44*9880d681SAndroid Build Coastguard Worker        ! CHECK: ld [%g1], %o2        ! encoding: [0xd4,0x00,0x40,0x00]
45*9880d681SAndroid Build Coastguard Worker        ld [%g1], %o2
46*9880d681SAndroid Build Coastguard Worker        ! CHECK: lda [%i0+%l6] 131, %o2 ! encoding: [0xd4,0x86,0x10,0x76]
47*9880d681SAndroid Build Coastguard Worker        lda [%i0 + %l6] 131, %o2
48*9880d681SAndroid Build Coastguard Worker
49*9880d681SAndroid Build Coastguard Worker        ! CHECK: ldd [%i0+%l6], %o2    ! encoding: [0xd4,0x1e,0x00,0x16]
50*9880d681SAndroid Build Coastguard Worker        ldd [%i0 + %l6], %o2
51*9880d681SAndroid Build Coastguard Worker        ! CHECK: ldd [%i0+32], %o2     ! encoding: [0xd4,0x1e,0x20,0x20]
52*9880d681SAndroid Build Coastguard Worker        ldd [%i0 + 32], %o2
53*9880d681SAndroid Build Coastguard Worker        ! CHECK: ldd [%g1], %o2        ! encoding: [0xd4,0x18,0x40,0x00]
54*9880d681SAndroid Build Coastguard Worker        ldd [%g1], %o2
55*9880d681SAndroid Build Coastguard Worker        ! CHECK: ldda [%i0+%l6] 131, %o2 ! encoding: [0xd4,0x9e,0x10,0x76]
56*9880d681SAndroid Build Coastguard Worker        ldda [%i0 + %l6] 131, %o2
57*9880d681SAndroid Build Coastguard Worker
58*9880d681SAndroid Build Coastguard Worker        ! CHECK: stb %o2, [%i0+%l6]   ! encoding: [0xd4,0x2e,0x00,0x16]
59*9880d681SAndroid Build Coastguard Worker        stb %o2, [%i0 + %l6]
60*9880d681SAndroid Build Coastguard Worker        ! CHECK: stb %o2, [%i0+32]    ! encoding: [0xd4,0x2e,0x20,0x20]
61*9880d681SAndroid Build Coastguard Worker        stb %o2, [%i0 + 32]
62*9880d681SAndroid Build Coastguard Worker        ! CHECK: stb %o2, [%g1]       ! encoding: [0xd4,0x28,0x40,0x00]
63*9880d681SAndroid Build Coastguard Worker        stb %o2, [%g1]
64*9880d681SAndroid Build Coastguard Worker        ! CHECK: stba %o2, [%i0+%l6] 131 ! encoding: [0xd4,0xae,0x10,0x76]
65*9880d681SAndroid Build Coastguard Worker        stba %o2, [%i0 + %l6] 131
66*9880d681SAndroid Build Coastguard Worker
67*9880d681SAndroid Build Coastguard Worker        ! CHECK: sth %o2, [%i0+%l6]   ! encoding: [0xd4,0x36,0x00,0x16]
68*9880d681SAndroid Build Coastguard Worker        sth %o2, [%i0 + %l6]
69*9880d681SAndroid Build Coastguard Worker        ! CHECK: sth %o2, [%i0+32]    ! encoding: [0xd4,0x36,0x20,0x20]
70*9880d681SAndroid Build Coastguard Worker        sth %o2, [%i0 + 32]
71*9880d681SAndroid Build Coastguard Worker        ! CHECK: sth %o2, [%g1]       ! encoding: [0xd4,0x30,0x40,0x00]
72*9880d681SAndroid Build Coastguard Worker        sth %o2, [%g1]
73*9880d681SAndroid Build Coastguard Worker        ! CHECK: stha %o2, [%i0+%l6] 131 ! encoding: [0xd4,0xb6,0x10,0x76]
74*9880d681SAndroid Build Coastguard Worker        stha %o2, [%i0 + %l6] 131
75*9880d681SAndroid Build Coastguard Worker
76*9880d681SAndroid Build Coastguard Worker        ! CHECK: st %o2, [%i0+%l6]    ! encoding: [0xd4,0x26,0x00,0x16]
77*9880d681SAndroid Build Coastguard Worker        st %o2, [%i0 + %l6]
78*9880d681SAndroid Build Coastguard Worker        ! CHECK: st %o2, [%i0+32]     ! encoding: [0xd4,0x26,0x20,0x20]
79*9880d681SAndroid Build Coastguard Worker        st %o2, [%i0 + 32]
80*9880d681SAndroid Build Coastguard Worker        ! CHECK: st %o2, [%g1]        ! encoding: [0xd4,0x20,0x40,0x00]
81*9880d681SAndroid Build Coastguard Worker        st %o2, [%g1]
82*9880d681SAndroid Build Coastguard Worker        ! CHECK: sta %o2, [%i0+%l6] 131 ! encoding: [0xd4,0xa6,0x10,0x76]
83*9880d681SAndroid Build Coastguard Worker        sta %o2, [%i0 + %l6] 131
84*9880d681SAndroid Build Coastguard Worker
85*9880d681SAndroid Build Coastguard Worker        ! CHECK: std %o2, [%i0+%l6]    ! encoding: [0xd4,0x3e,0x00,0x16]
86*9880d681SAndroid Build Coastguard Worker        std %o2, [%i0 + %l6]
87*9880d681SAndroid Build Coastguard Worker        ! CHECK: std %o2, [%i0+32]     ! encoding: [0xd4,0x3e,0x20,0x20]
88*9880d681SAndroid Build Coastguard Worker        std %o2, [%i0 + 32]
89*9880d681SAndroid Build Coastguard Worker        ! CHECK: std %o2, [%g1]        ! encoding: [0xd4,0x38,0x40,0x00]
90*9880d681SAndroid Build Coastguard Worker        std %o2, [%g1]
91*9880d681SAndroid Build Coastguard Worker        ! CHECK: stda %o2, [%i0+%l6] 131 ! encoding: [0xd4,0xbe,0x10,0x76]
92*9880d681SAndroid Build Coastguard Worker        stda %o2, [%i0 + %l6] 131
93*9880d681SAndroid Build Coastguard Worker
94*9880d681SAndroid Build Coastguard Worker        ! CHECK:  flush %g1+%g2         ! encoding: [0x81,0xd8,0x40,0x02]
95*9880d681SAndroid Build Coastguard Worker        flush %g1 + %g2
96*9880d681SAndroid Build Coastguard Worker        ! CHECK:  flush %g1+8           ! encoding: [0x81,0xd8,0x60,0x08]
97*9880d681SAndroid Build Coastguard Worker        flush %g1 + 8
98*9880d681SAndroid Build Coastguard Worker        ! CHECK:  flush %g1             ! encoding: [0x81,0xd8,0x40,0x00]
99*9880d681SAndroid Build Coastguard Worker        flush %g1
100*9880d681SAndroid Build Coastguard Worker        ! Not specified in manual, but accepted by gas.
101*9880d681SAndroid Build Coastguard Worker        ! CHECK:  flush %g0             ! encoding: [0x81,0xd8,0x00,0x00]
102*9880d681SAndroid Build Coastguard Worker        flush
103