Home | History | Annotate | Download | only in aarch64
      1 /* ldst-reg-pair.s Test file for AArch64 load-store reg.pair instructions.
      2 
      3    Copyright (C) 2011-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 /* Includes:
     23  *   Load-store reg.pair (offset)
     24  *   Load-store reg.pair (post-ind.)
     25  *   Load-store reg.pair (pre-ind.)
     26  *   Load-store na.pair (pre-ind.)
     27  */
     28 
     29 	// offset format
     30 	.macro	op3_offset op, reg, imm
     31 	\op	\reg\()7, \reg\()15, [sp, #\imm]
     32 	.endm
     33 
     34 	// post-ind. format
     35 	.macro	op3_post_ind op, reg, imm
     36 	\op	\reg\()7, \reg\()15, [sp], #\imm
     37 	.endm
     38 
     39 	// pre-ind. format
     40 	.macro	op3_pre_ind op, reg, imm
     41 	\op	\reg\()7, \reg\()15, [sp, #\imm]!
     42 	.endm
     43 
     44 	.macro	op3 op, reg, size, type
     45 	// a variety of values for the imm7 field
     46 	.irp	imm7, -64, -31, -1, 0, 15, 63
     47 		// offset format
     48 		.ifc \type, 1
     49 		op3_offset	\op, \reg, "(\imm7*\size)"
     50 		.endif
     51 		// post-ind. format
     52 		.ifc \type, 2
     53 		op3_post_ind	\op, \reg, "(\imm7*\size)"
     54 		.endif
     55 		// pre-ind. format
     56 		.ifc \type, 3
     57 		op3_pre_ind	\op, \reg, "(\imm7*\size)"
     58 		.endif
     59 	.endr
     60 	.endm
     61 
     62 	.macro ldst_reg_pair type
     63 	//     	op, reg, size(in byte) of one of the pair, type
     64 	op3	stp, w, 4, \type
     65 	op3	ldp, w, 4, \type
     66 
     67 	op3	ldpsw, x, 4, \type
     68 
     69 	op3	stp, x, 8, \type
     70 	op3	ldp, x, 8, \type
     71 
     72 	op3	stp, s, 4, \type
     73 	op3	ldp, s, 4, \type
     74 
     75 	op3	stp, d, 8, \type
     76 	op3	ldp, d, 8, \type
     77 
     78 	op3	stp, q, 16, \type
     79 	op3	ldp, q, 16, \type
     80 	.endm
     81 
     82 	.macro ldst_reg_na_pair type
     83 	//     	op, reg, size(in byte) of one of the pair, type
     84 	op3	stnp, w, 4, \type
     85 	op3	ldnp, w, 4, \type
     86 
     87 	op3	stnp, x, 8, \type
     88 	op3	ldnp, x, 8, \type
     89 
     90 	op3	stnp, s, 4, \type
     91 	op3	ldnp, s, 4, \type
     92 
     93 	op3	stnp, d, 8, \type
     94 	op3	ldnp, d, 8, \type
     95 
     96 	op3	stnp, q, 16, \type
     97 	op3	ldnp, q, 16, \type
     98 	.endm
     99 
    100 func:
    101 	// Load-store reg.pair (offset)
    102 	ldst_reg_pair	1
    103 
    104 	// Load-store reg.pair (post-ind.)
    105 	ldst_reg_pair	2
    106 
    107 	// Load-store reg.pair (pre-ind.)
    108 	ldst_reg_pair	3
    109 
    110 	// Load-store na.pair (offset)
    111 	ldst_reg_na_pair	1
    112