(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
aarch64/
sve/
acle/
asm/
cnth.c
       1  /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
       2  
       3  #include "test_sve_acle.h"
       4  
       5  /*
       6  ** cnth_1:
       7  **	cnth	x0
       8  **	ret
       9  */
      10  PROTO (cnth_1, uint64_t, ()) { return svcnth (); }
      11  
      12  /*
      13  ** cnth_2:
      14  **	cntb	x0
      15  **	ret
      16  */
      17  PROTO (cnth_2, uint64_t, ()) { return svcnth () * 2; }
      18  
      19  /*
      20  ** cnth_3:
      21  **	cnth	x0, all, mul #3
      22  **	ret
      23  */
      24  PROTO (cnth_3, uint64_t, ()) { return svcnth () * 3; }
      25  
      26  /*
      27  ** cnth_4:
      28  **	cntb	x0, all, mul #2
      29  **	ret
      30  */
      31  PROTO (cnth_4, uint64_t, ()) { return svcnth () * 4; }
      32  
      33  /*
      34  ** cnth_8:
      35  **	cntb	x0, all, mul #4
      36  **	ret
      37  */
      38  PROTO (cnth_8, uint64_t, ()) { return svcnth () * 8; }
      39  
      40  /*
      41  ** cnth_15:
      42  **	cnth	x0, all, mul #15
      43  **	ret
      44  */
      45  PROTO (cnth_15, uint64_t, ()) { return svcnth () * 15; }
      46  
      47  /*
      48  ** cnth_16:
      49  **	cntb	x0, all, mul #8
      50  **	ret
      51  */
      52  PROTO (cnth_16, uint64_t, ()) { return svcnth () * 16; }
      53  
      54  /* Other sequences would be OK.  */
      55  /*
      56  ** cnth_17:
      57  **	cntb	x0, all, mul #8
      58  **	inch	x0
      59  **	ret
      60  */
      61  PROTO (cnth_17, uint64_t, ()) { return svcnth () * 17; }
      62  
      63  /*
      64  ** cnth_32:
      65  **	cntb	x0, all, mul #16
      66  **	ret
      67  */
      68  PROTO (cnth_32, uint64_t, ()) { return svcnth () * 32; }
      69  
      70  /*
      71  ** cnth_64:
      72  **	cntd	(x[0-9]+)
      73  **	lsl	x0, \1, 8
      74  **	ret
      75  */
      76  PROTO (cnth_64, uint64_t, ()) { return svcnth () * 64; }
      77  
      78  /*
      79  ** cnth_128:
      80  **	cntd	(x[0-9]+)
      81  **	lsl	x0, \1, 9
      82  **	ret
      83  */
      84  PROTO (cnth_128, uint64_t, ()) { return svcnth () * 128; }
      85  
      86  /*
      87  ** cnth_m1:
      88  **	cnth	(x[0-9]+)
      89  **	neg	x0, \1
      90  **	ret
      91  */
      92  PROTO (cnth_m1, uint64_t, ()) { return -svcnth (); }
      93  
      94  /*
      95  ** cnth_m13:
      96  **	cnth	(x[0-9]+), all, mul #13
      97  **	neg	x0, \1
      98  **	ret
      99  */
     100  PROTO (cnth_m13, uint64_t, ()) { return -svcnth () * 13; }
     101  
     102  /*
     103  ** cnth_m15:
     104  **	cnth	(x[0-9]+), all, mul #15
     105  **	neg	x0, \1
     106  **	ret
     107  */
     108  PROTO (cnth_m15, uint64_t, ()) { return -svcnth () * 15; }
     109  
     110  /*
     111  ** cnth_m16:
     112  **	cntb	(x[0-9]+), all, mul #8
     113  **	neg	x0, \1
     114  **	ret
     115  */
     116  PROTO (cnth_m16, uint64_t, ()) { return -svcnth () * 16; }
     117  
     118  /* Other sequences would be OK.  */
     119  /*
     120  ** cnth_m17:
     121  **	cntb	x0, all, mul #8
     122  **	inch	x0
     123  **	neg	x0, x0
     124  **	ret
     125  */
     126  PROTO (cnth_m17, uint64_t, ()) { return -svcnth () * 17; }
     127  
     128  /*
     129  ** inch_1:
     130  **	inch	x0
     131  **	ret
     132  */
     133  PROTO (inch_1, uint64_t, (uint64_t x0)) { return x0 + svcnth (); }
     134  
     135  /*
     136  ** inch_2:
     137  **	incb	x0
     138  **	ret
     139  */
     140  PROTO (inch_2, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 2; }
     141  
     142  /*
     143  ** inch_3:
     144  **	inch	x0, all, mul #3
     145  **	ret
     146  */
     147  PROTO (inch_3, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 3; }
     148  
     149  /*
     150  ** inch_4:
     151  **	incb	x0, all, mul #2
     152  **	ret
     153  */
     154  PROTO (inch_4, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 4; }
     155  
     156  /*
     157  ** inch_7:
     158  **	inch	x0, all, mul #7
     159  **	ret
     160  */
     161  PROTO (inch_7, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 7; }
     162  
     163  /*
     164  ** inch_8:
     165  **	incb	x0, all, mul #4
     166  **	ret
     167  */
     168  PROTO (inch_8, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 8; }
     169  
     170  /*
     171  ** inch_9:
     172  **	inch	x0, all, mul #9
     173  **	ret
     174  */
     175  PROTO (inch_9, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 9; }
     176  
     177  /*
     178  ** inch_15:
     179  **	inch	x0, all, mul #15
     180  **	ret
     181  */
     182  PROTO (inch_15, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 15; }
     183  
     184  /*
     185  ** inch_16:
     186  **	incb	x0, all, mul #8
     187  **	ret
     188  */
     189  PROTO (inch_16, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 16; }
     190  
     191  /*
     192  ** inch_18:
     193  **	incb	x0, all, mul #9
     194  **	ret
     195  */
     196  PROTO (inch_18, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 18; }
     197  
     198  /*
     199  ** inch_30:
     200  **	incb	x0, all, mul #15
     201  **	ret
     202  */
     203  PROTO (inch_30, uint64_t, (uint64_t x0)) { return x0 + svcnth () * 30; }
     204  
     205  /*
     206  ** dech_1:
     207  **	dech	x0
     208  **	ret
     209  */
     210  PROTO (dech_1, uint64_t, (uint64_t x0)) { return x0 - svcnth (); }
     211  
     212  /*
     213  ** dech_2:
     214  **	decb	x0
     215  **	ret
     216  */
     217  PROTO (dech_2, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 2; }
     218  
     219  /*
     220  ** dech_3:
     221  **	dech	x0, all, mul #3
     222  **	ret
     223  */
     224  PROTO (dech_3, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 3; }
     225  
     226  /*
     227  ** dech_4:
     228  **	decb	x0, all, mul #2
     229  **	ret
     230  */
     231  PROTO (dech_4, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 4; }
     232  
     233  /*
     234  ** dech_7:
     235  **	dech	x0, all, mul #7
     236  **	ret
     237  */
     238  PROTO (dech_7, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 7; }
     239  
     240  /*
     241  ** dech_8:
     242  **	decb	x0, all, mul #4
     243  **	ret
     244  */
     245  PROTO (dech_8, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 8; }
     246  
     247  /*
     248  ** dech_9:
     249  **	dech	x0, all, mul #9
     250  **	ret
     251  */
     252  PROTO (dech_9, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 9; }
     253  
     254  /*
     255  ** dech_15:
     256  **	dech	x0, all, mul #15
     257  **	ret
     258  */
     259  PROTO (dech_15, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 15; }
     260  
     261  /*
     262  ** dech_16:
     263  **	decb	x0, all, mul #8
     264  **	ret
     265  */
     266  PROTO (dech_16, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 16; }
     267  
     268  /*
     269  ** dech_18:
     270  **	decb	x0, all, mul #9
     271  **	ret
     272  */
     273  PROTO (dech_18, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 18; }
     274  
     275  /*
     276  ** dech_30:
     277  **	decb	x0, all, mul #15
     278  **	ret
     279  */
     280  PROTO (dech_30, uint64_t, (uint64_t x0)) { return x0 - svcnth () * 30; }