(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
aarch64/
sve/
acle/
asm/
cntd.c
       1  /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
       2  
       3  #include "test_sve_acle.h"
       4  
       5  /*
       6  ** cntd_1:
       7  **	cntd	x0
       8  **	ret
       9  */
      10  PROTO (cntd_1, uint64_t, ()) { return svcntd (); }
      11  
      12  /*
      13  ** cntd_2:
      14  **	cntw	x0
      15  **	ret
      16  */
      17  PROTO (cntd_2, uint64_t, ()) { return svcntd () * 2; }
      18  
      19  /*
      20  ** cntd_3:
      21  **	cntd	x0, all, mul #3
      22  **	ret
      23  */
      24  PROTO (cntd_3, uint64_t, ()) { return svcntd () * 3; }
      25  
      26  /*
      27  ** cntd_4:
      28  **	cnth	x0
      29  **	ret
      30  */
      31  PROTO (cntd_4, uint64_t, ()) { return svcntd () * 4; }
      32  
      33  /*
      34  ** cntd_8:
      35  **	cntb	x0
      36  **	ret
      37  */
      38  PROTO (cntd_8, uint64_t, ()) { return svcntd () * 8; }
      39  
      40  /*
      41  ** cntd_15:
      42  **	cntd	x0, all, mul #15
      43  **	ret
      44  */
      45  PROTO (cntd_15, uint64_t, ()) { return svcntd () * 15; }
      46  
      47  /*
      48  ** cntd_16:
      49  **	cntb	x0, all, mul #2
      50  **	ret
      51  */
      52  PROTO (cntd_16, uint64_t, ()) { return svcntd () * 16; }
      53  
      54  /* Other sequences would be OK.  */
      55  /*
      56  ** cntd_17:
      57  **	cntb	x0, all, mul #2
      58  **	incd	x0
      59  **	ret
      60  */
      61  PROTO (cntd_17, uint64_t, ()) { return svcntd () * 17; }
      62  
      63  /*
      64  ** cntd_32:
      65  **	cntb	x0, all, mul #4
      66  **	ret
      67  */
      68  PROTO (cntd_32, uint64_t, ()) { return svcntd () * 32; }
      69  
      70  /*
      71  ** cntd_64:
      72  **	cntb	x0, all, mul #8
      73  **	ret
      74  */
      75  PROTO (cntd_64, uint64_t, ()) { return svcntd () * 64; }
      76  
      77  /*
      78  ** cntd_128:
      79  **	cntb	x0, all, mul #16
      80  **	ret
      81  */
      82  PROTO (cntd_128, uint64_t, ()) { return svcntd () * 128; }
      83  
      84  /*
      85  ** cntd_m1:
      86  **	cntd	(x[0-9]+)
      87  **	neg	x0, \1
      88  **	ret
      89  */
      90  PROTO (cntd_m1, uint64_t, ()) { return -svcntd (); }
      91  
      92  /*
      93  ** cntd_m13:
      94  **	cntd	(x[0-9]+), all, mul #13
      95  **	neg	x0, \1
      96  **	ret
      97  */
      98  PROTO (cntd_m13, uint64_t, ()) { return -svcntd () * 13; }
      99  
     100  /*
     101  ** cntd_m15:
     102  **	cntd	(x[0-9]+), all, mul #15
     103  **	neg	x0, \1
     104  **	ret
     105  */
     106  PROTO (cntd_m15, uint64_t, ()) { return -svcntd () * 15; }
     107  
     108  /*
     109  ** cntd_m16:
     110  **	cntb	(x[0-9]+), all, mul #2
     111  **	neg	x0, \1
     112  **	ret
     113  */
     114  PROTO (cntd_m16, uint64_t, ()) { return -svcntd () * 16; }
     115  
     116  /* Other sequences would be OK.  */
     117  /*
     118  ** cntd_m17:
     119  **	cntb	x0, all, mul #2
     120  **	incd	x0
     121  **	neg	x0, x0
     122  **	ret
     123  */
     124  PROTO (cntd_m17, uint64_t, ()) { return -svcntd () * 17; }
     125  
     126  /*
     127  ** incd_1:
     128  **	incd	x0
     129  **	ret
     130  */
     131  PROTO (incd_1, uint64_t, (uint64_t x0)) { return x0 + svcntd (); }
     132  
     133  /*
     134  ** incd_2:
     135  **	incw	x0
     136  **	ret
     137  */
     138  PROTO (incd_2, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 2; }
     139  
     140  /*
     141  ** incd_3:
     142  **	incd	x0, all, mul #3
     143  **	ret
     144  */
     145  PROTO (incd_3, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 3; }
     146  
     147  /*
     148  ** incd_4:
     149  **	inch	x0
     150  **	ret
     151  */
     152  PROTO (incd_4, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 4; }
     153  
     154  /*
     155  ** incd_7:
     156  **	incd	x0, all, mul #7
     157  **	ret
     158  */
     159  PROTO (incd_7, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 7; }
     160  
     161  /*
     162  ** incd_8:
     163  **	incb	x0
     164  **	ret
     165  */
     166  PROTO (incd_8, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 8; }
     167  
     168  /*
     169  ** incd_9:
     170  **	incd	x0, all, mul #9
     171  **	ret
     172  */
     173  PROTO (incd_9, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 9; }
     174  
     175  /*
     176  ** incd_15:
     177  **	incd	x0, all, mul #15
     178  **	ret
     179  */
     180  PROTO (incd_15, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 15; }
     181  
     182  /*
     183  ** incd_16:
     184  **	incb	x0, all, mul #2
     185  **	ret
     186  */
     187  PROTO (incd_16, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 16; }
     188  
     189  /*
     190  ** incd_18:
     191  **	incw	x0, all, mul #9
     192  **	ret
     193  */
     194  PROTO (incd_18, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 18; }
     195  
     196  /*
     197  ** incd_30:
     198  **	incw	x0, all, mul #15
     199  **	ret
     200  */
     201  PROTO (incd_30, uint64_t, (uint64_t x0)) { return x0 + svcntd () * 30; }
     202  
     203  /*
     204  ** decd_1:
     205  **	decd	x0
     206  **	ret
     207  */
     208  PROTO (decd_1, uint64_t, (uint64_t x0)) { return x0 - svcntd (); }
     209  
     210  /*
     211  ** decd_2:
     212  **	decw	x0
     213  **	ret
     214  */
     215  PROTO (decd_2, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 2; }
     216  
     217  /*
     218  ** decd_3:
     219  **	decd	x0, all, mul #3
     220  **	ret
     221  */
     222  PROTO (decd_3, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 3; }
     223  
     224  /*
     225  ** decd_4:
     226  **	dech	x0
     227  **	ret
     228  */
     229  PROTO (decd_4, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 4; }
     230  
     231  /*
     232  ** decd_7:
     233  **	decd	x0, all, mul #7
     234  **	ret
     235  */
     236  PROTO (decd_7, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 7; }
     237  
     238  /*
     239  ** decd_8:
     240  **	decb	x0
     241  **	ret
     242  */
     243  PROTO (decd_8, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 8; }
     244  
     245  /*
     246  ** decd_9:
     247  **	decd	x0, all, mul #9
     248  **	ret
     249  */
     250  PROTO (decd_9, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 9; }
     251  
     252  /*
     253  ** decd_15:
     254  **	decd	x0, all, mul #15
     255  **	ret
     256  */
     257  PROTO (decd_15, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 15; }
     258  
     259  /*
     260  ** decd_16:
     261  **	decb	x0, all, mul #2
     262  **	ret
     263  */
     264  PROTO (decd_16, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 16; }
     265  
     266  /*
     267  ** decd_18:
     268  **	decw	x0, all, mul #9
     269  **	ret
     270  */
     271  PROTO (decd_18, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 18; }
     272  
     273  /*
     274  ** decd_30:
     275  **	decw	x0, all, mul #15
     276  **	ret
     277  */
     278  PROTO (decd_30, uint64_t, (uint64_t x0)) { return x0 - svcntd () * 30; }