87d6f6032329946cc707838eac9e4950c6ba6f42
[external/binutils.git] / gas / testsuite / gas / aarch64 / ldst-reg-imm-pre-ind.s
1 /* ldst-reg-imm-pre-ind.s Test file for AArch64
2    load-store reg. (imm.pre-ind.) instructions.
3
4    Copyright (C) 2011-2014 Free Software Foundation, Inc.
5    Contributed by ARM Ltd.
6
7    This file is part of GAS.
8
9    GAS is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 3 of the license, or
12    (at your option) any later version.
13
14    GAS is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18
19    You should have received a copy of the GNU General Public License
20    along with this program; see the file COPYING3. If not,
21    see <http://www.gnu.org/licenses/>.  */
22
23         .macro  op2 op, reg, simm
24         \op     \reg\()7, [sp, #\simm]!
25         .endm
26
27         // load to or store from core register
28         .macro ld_or_st op, suffix, reg
29         .irp simm, -256, -171, 0, 2, 4, 8, 16, 85, 255
30                 op2     \op\suffix, \reg, \simm
31         .endr
32         .endm
33
34         // load to or store from FP/SIMD register
35         .macro ld_or_st_v op
36         .irp reg, b, h, s, d, q
37                 .irp simm, -256, -171, 0, 2, 4, 8, 16, 85, 255
38                         op2     \op, \reg, \simm
39                 .endr
40         .endr
41         .endm
42
43 func:
44         // load to or store from FP/SIMD register
45         ld_or_st_v      str
46         ld_or_st_v      ldr
47
48         // load to or store from core register
49         //              op, suffix, reg
50         ld_or_st        str,  b, w
51         ld_or_st        str,  h, w
52         ld_or_st        str,   , w
53         ld_or_st        str,   , x
54         ld_or_st        ldr,  b, w
55         ld_or_st        ldr,  h, w
56         ld_or_st        ldr,   , w
57         ld_or_st        ldr,   , x
58         ld_or_st        ldr, sb, x
59         ld_or_st        ldr, sh, x
60         ld_or_st        ldr, sw, x
61         ld_or_st        ldr, sb, w
62         ld_or_st        ldr, sh, w