Home | History | Annotate | Download | only in aarch64
      1 /* lse-atomic.s Test file For AArch64 LSE atomic instructions encoding.
      2 
      3    Copyright (C) 2014-2016 Free Software Foundation, Inc.
      4    Contributed by ARM Ltd.
      5 
      6    This file is part of GAS.
      7 
      8    GAS is free software; you can redistribute it and/or modify
      9    it under the terms of the GNU General Public License as published by
     10    the Free Software Foundation; either version 3 of the license, or
     11    (at your option) any later version.
     12 
     13    GAS is distributed in the hope that it will be useful,
     14    but WITHOUT ANY WARRANTY; without even the implied warranty of
     15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16    GNU General Public License for more details.
     17 
     18    You should have received a copy of the GNU General Public License
     19    along with this program; see the file COPYING3. If not,
     20    see <http://www.gnu.org/licenses/>.  */
     21 
     22 
     23 	.macro format_0 op
     24 	.irp suffix, , a, l, al, b, h, ab, lb, alb, ah, lh, alh
     25 		\op\suffix w0, w1, [x2]
     26 		\op\suffix w2, w3, [sp]
     27 	.endr
     28 	.irp suffix, , a, l, al
     29 		\op\suffix x0, x1, [x2]
     30 		\op\suffix x2, x3, [sp]
     31 	.endr
     32 	.endm
     33 
     34 	.macro format_0_no_rt_no_acquire op
     35 	.irp suffix, , l, b, h, lb, lh
     36 		\op\suffix w0, [x2]
     37 		\op\suffix w2, [sp]
     38 	.endr
     39 	.irp suffix, , l
     40 		\op\suffix x0, [x2]
     41 		\op\suffix x2, [sp]
     42 	.endr
     43 	.endm
     44 
     45 	.macro format_1 op
     46 	.irp suffix, , a, l, al
     47 		\op\suffix w0, w1, w2, w3, [x5]
     48 		\op\suffix w4, w5, w6, w7, [sp]
     49 		\op\suffix x0, x1, x2, x3, [x2]
     50 		\op\suffix x4, x5, x6, x7, [sp]
     51 	.endr
     52 	.endm
     53 
     54 	.macro format_2 op
     55 	.irp suffix, add, clr, eor, set, smax, smin, umax, umin
     56 		format_0 \op\suffix
     57 	.endr
     58 	.endm
     59 
     60 	.macro format_3 op
     61 	.irp suffix, add, clr, eor, set, smax, smin, umax, umin
     62 		format_0_no_rt_no_acquire \op\suffix
     63 	.endr
     64 	.endm
     65 
     66 	.text
     67 func:
     68 	format_0 cas
     69 	format_0 swp
     70 	format_1 casp
     71 	format_2 ld
     72 	format_3 st
     73