e90a6548aab52741dd819d70537f026db86c8bea
[external/binutils.git] / gas / testsuite / gas / aarch64 / illegal-lse.s
1 /* illegal-lse.s Test file For AArch64 LSE atomic instructions that
2    could be rejected by the assembler.
3
4    Copyright (C) 2014-2018 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
24         .macro format_0_check op
25         .irp suffix, , a, l, al, b, h, ab, lb, alb, ah, lh, alh
26                 \op\suffix w0, x1, [x2]
27                 \op\suffix w2, w3, [w4]
28         .endr
29         .irp suffix, , a, l, al
30                 \op\suffix w0, x1, [x2]
31                 \op\suffix x2, x3, [w4]
32         .endr
33         .endm
34
35         .macro format_0_no_rt_no_acquire_check op
36         .irp suffix, , l, b, h, lb, lh
37                 \op\suffix x0, [x2]
38                 \op\suffix w2, [w3]
39         .endr
40         .irp suffix, , l
41                 \op\suffix x0, [w3]
42         .endr
43         .endm
44
45         .macro format_1_check op
46         .irp suffix, , a, l, al
47                 \op\suffix w1, w1, w2, w3, [x5]
48                 \op\suffix w4, w4, w6, w7, [sp]
49                 \op\suffix w0, x1, x2, x3, [x2]
50                 \op\suffix x4, x5, x6, x7, [w8]
51         .endr
52         .endm
53
54         .macro format_2_check op
55         .irp suffix, add, clr, eor, set, smax, smin, umax, umin
56                 format_0_check \op\suffix
57         .endr
58         .endm
59
60         .macro format_3_check op
61         .irp suffix, add, clr, eor, set, smax, smin, umax, umin
62                 format_0_no_rt_no_acquire_check \op\suffix
63         .endr
64         .endm
65
66         .text
67 func:
68         format_0_check cas
69         format_0_check swp
70         format_1_check casp
71         format_2_check ld
72         format_3_check st