1  /* { dg-do compile } */
       2  /* { dg-require-effective-target powerpc_vsx_ok } */
       3  /* { dg-options "-mvsx -O2 -fdump-tree-gimple" } */
       4  
       5  /* Verify that overloaded built-ins for "and", "andc", "nor", "or" and "xor"
       6     do not produce VIEW_CONVERT_EXPR operations on their operands.  Like so:
       7  
       8    _1 = VIEW_CONVERT_EXPR<__vector signed int>(x);
       9    _2 = VIEW_CONVERT_EXPR<__vector signed int>(y);
      10    _3 = __builtin_altivec_vand (_1, _2);
      11    D.3245 = VIEW_CONVERT_EXPR<bcvec_t>(_3);
      12  */
      13  
      14  typedef __attribute__((altivec(vector__))) __attribute__((altivec(bool__))) char bcvec_t;
      15  typedef __attribute__((altivec(vector__))) signed char scvec_t;
      16  typedef __attribute__((altivec(vector__))) unsigned char ucvec_t;
      17  
      18  typedef __attribute__((altivec(vector__))) __attribute__((altivec(bool__))) short bsvec_t;
      19  typedef __attribute__((altivec(vector__))) signed short ssvec_t;
      20  typedef __attribute__((altivec(vector__))) unsigned short usvec_t;
      21  
      22  typedef __attribute__((altivec(vector__))) __attribute__((altivec(bool__))) int bivec_t;
      23  typedef __attribute__((altivec(vector__))) signed int sivec_t;
      24  typedef __attribute__((altivec(vector__))) unsigned int uivec_t;
      25  
      26  typedef __attribute__((altivec(vector__))) __attribute__((altivec(bool__))) long long bllvec_t;
      27  typedef __attribute__((altivec(vector__))) signed long long sllvec_t;
      28  typedef __attribute__((altivec(vector__))) unsigned long long ullvec_t;
      29  
      30  typedef __attribute__((altivec(vector__))) double dvec_t;
      31  typedef __attribute__((altivec(vector__))) float fvec_t;
      32  
      33  bcvec_t
      34  and_0 (bcvec_t x, bcvec_t y)
      35  {
      36    return __builtin_vec_and (x, y);
      37  }
      38  
      39  scvec_t
      40  and_1 (scvec_t x, scvec_t y)
      41  {
      42    return __builtin_vec_and (x, y);
      43  }
      44  
      45  ucvec_t
      46  and_2 (ucvec_t x, ucvec_t y)
      47  {
      48    return __builtin_vec_and (x, y);
      49  }
      50  
      51  bsvec_t
      52  and_3 (bsvec_t x, bsvec_t y)
      53  {
      54    return __builtin_vec_and (x, y);
      55  }
      56  
      57  ssvec_t
      58  and_4 (ssvec_t x, ssvec_t y)
      59  {
      60    return __builtin_vec_and (x, y);
      61  }
      62  
      63  usvec_t
      64  and_5 (usvec_t x, usvec_t y)
      65  {
      66    return __builtin_vec_and (x, y);
      67  }
      68  
      69  bivec_t
      70  and_6 (bivec_t x, bivec_t y)
      71  {
      72    return __builtin_vec_and (x, y);
      73  }
      74  
      75  sivec_t
      76  and_7 (sivec_t x, sivec_t y)
      77  {
      78    return __builtin_vec_and (x, y);
      79  }
      80  
      81  uivec_t
      82  and_8 (uivec_t x, uivec_t y)
      83  {
      84    return __builtin_vec_and (x, y);
      85  }
      86  
      87  bllvec_t
      88  and_9 (bllvec_t x, bllvec_t y)
      89  {
      90    return __builtin_vec_and (x, y);
      91  }
      92  
      93  sllvec_t
      94  and_10 (sllvec_t x, sllvec_t y)
      95  {
      96    return __builtin_vec_and (x, y);
      97  }
      98  
      99  ullvec_t
     100  and_11 (ullvec_t x, ullvec_t y)
     101  {
     102    return __builtin_vec_and (x, y);
     103  }
     104  
     105  dvec_t
     106  and_12 (dvec_t x, dvec_t y)
     107  {
     108    return __builtin_vec_and (x, y);
     109  }
     110  
     111  fvec_t
     112  and_13 (fvec_t x, fvec_t y)
     113  {
     114    return __builtin_vec_and (x, y);
     115  }
     116  
     117  bcvec_t
     118  andc_0 (bcvec_t x, bcvec_t y)
     119  {
     120    return __builtin_vec_andc (x, y);
     121  }
     122  
     123  scvec_t
     124  andc_1 (scvec_t x, scvec_t y)
     125  {
     126    return __builtin_vec_andc (x, y);
     127  }
     128  
     129  ucvec_t
     130  andc_2 (ucvec_t x, ucvec_t y)
     131  {
     132    return __builtin_vec_andc (x, y);
     133  }
     134  
     135  bsvec_t
     136  andc_3 (bsvec_t x, bsvec_t y)
     137  {
     138    return __builtin_vec_andc (x, y);
     139  }
     140  
     141  ssvec_t
     142  andc_4 (ssvec_t x, ssvec_t y)
     143  {
     144    return __builtin_vec_andc (x, y);
     145  }
     146  
     147  usvec_t
     148  andc_5 (usvec_t x, usvec_t y)
     149  {
     150    return __builtin_vec_andc (x, y);
     151  }
     152  
     153  bivec_t
     154  andc_6 (bivec_t x, bivec_t y)
     155  {
     156    return __builtin_vec_andc (x, y);
     157  }
     158  
     159  sivec_t
     160  andc_7 (sivec_t x, sivec_t y)
     161  {
     162    return __builtin_vec_andc (x, y);
     163  }
     164  
     165  uivec_t
     166  andc_8 (uivec_t x, uivec_t y)
     167  {
     168    return __builtin_vec_andc (x, y);
     169  }
     170  
     171  bllvec_t
     172  andc_9 (bllvec_t x, bllvec_t y)
     173  {
     174    return __builtin_vec_andc (x, y);
     175  }
     176  
     177  sllvec_t
     178  andc_10 (sllvec_t x, sllvec_t y)
     179  {
     180    return __builtin_vec_andc (x, y);
     181  }
     182  
     183  ullvec_t
     184  andc_11 (ullvec_t x, ullvec_t y)
     185  {
     186    return __builtin_vec_andc (x, y);
     187  }
     188  
     189  dvec_t
     190  andc_12 (dvec_t x, dvec_t y)
     191  {
     192    return __builtin_vec_andc (x, y);
     193  }
     194  
     195  fvec_t
     196  andc_13 (fvec_t x, fvec_t y)
     197  {
     198    return __builtin_vec_andc (x, y);
     199  }
     200  
     201  bcvec_t
     202  nor_0 (bcvec_t x, bcvec_t y)
     203  {
     204    return __builtin_vec_nor (x, y);
     205  }
     206  
     207  scvec_t
     208  nor_1 (scvec_t x, scvec_t y)
     209  {
     210    return __builtin_vec_nor (x, y);
     211  }
     212  
     213  ucvec_t
     214  nor_2 (ucvec_t x, ucvec_t y)
     215  {
     216    return __builtin_vec_nor (x, y);
     217  }
     218  
     219  bsvec_t
     220  nor_3 (bsvec_t x, bsvec_t y)
     221  {
     222    return __builtin_vec_nor (x, y);
     223  }
     224  
     225  ssvec_t
     226  nor_4 (ssvec_t x, ssvec_t y)
     227  {
     228    return __builtin_vec_nor (x, y);
     229  }
     230  
     231  usvec_t
     232  nor_5 (usvec_t x, usvec_t y)
     233  {
     234    return __builtin_vec_nor (x, y);
     235  }
     236  
     237  bivec_t
     238  nor_6 (bivec_t x, bivec_t y)
     239  {
     240    return __builtin_vec_nor (x, y);
     241  }
     242  
     243  sivec_t
     244  nor_7 (sivec_t x, sivec_t y)
     245  {
     246    return __builtin_vec_nor (x, y);
     247  }
     248  
     249  uivec_t
     250  nor_8 (uivec_t x, uivec_t y)
     251  {
     252    return __builtin_vec_nor (x, y);
     253  }
     254  
     255  bllvec_t
     256  nor_9 (bllvec_t x, bllvec_t y)
     257  {
     258    return __builtin_vec_nor (x, y);
     259  }
     260  
     261  sllvec_t
     262  nor_10 (sllvec_t x, sllvec_t y)
     263  {
     264    return __builtin_vec_nor (x, y);
     265  }
     266  
     267  ullvec_t
     268  nor_11 (ullvec_t x, ullvec_t y)
     269  {
     270    return __builtin_vec_nor (x, y);
     271  }
     272  
     273  dvec_t
     274  nor_12 (dvec_t x, dvec_t y)
     275  {
     276    return __builtin_vec_nor (x, y);
     277  }
     278  
     279  fvec_t
     280  nor_13 (fvec_t x, fvec_t y)
     281  {
     282    return __builtin_vec_nor (x, y);
     283  }
     284  
     285  bcvec_t
     286  or_0 (bcvec_t x, bcvec_t y)
     287  {
     288    return __builtin_vec_or (x, y);
     289  }
     290  
     291  scvec_t
     292  or_1 (scvec_t x, scvec_t y)
     293  {
     294    return __builtin_vec_or (x, y);
     295  }
     296  
     297  ucvec_t
     298  or_2 (ucvec_t x, ucvec_t y)
     299  {
     300    return __builtin_vec_or (x, y);
     301  }
     302  
     303  bsvec_t
     304  or_3 (bsvec_t x, bsvec_t y)
     305  {
     306    return __builtin_vec_or (x, y);
     307  }
     308  
     309  ssvec_t
     310  or_4 (ssvec_t x, ssvec_t y)
     311  {
     312    return __builtin_vec_or (x, y);
     313  }
     314  
     315  usvec_t
     316  or_5 (usvec_t x, usvec_t y)
     317  {
     318    return __builtin_vec_or (x, y);
     319  }
     320  
     321  bivec_t
     322  or_6 (bivec_t x, bivec_t y)
     323  {
     324    return __builtin_vec_or (x, y);
     325  }
     326  
     327  sivec_t
     328  or_7 (sivec_t x, sivec_t y)
     329  {
     330    return __builtin_vec_or (x, y);
     331  }
     332  
     333  uivec_t
     334  or_8 (uivec_t x, uivec_t y)
     335  {
     336    return __builtin_vec_or (x, y);
     337  }
     338  
     339  bllvec_t
     340  or_9 (bllvec_t x, bllvec_t y)
     341  {
     342    return __builtin_vec_or (x, y);
     343  }
     344  
     345  sllvec_t
     346  or_10 (sllvec_t x, sllvec_t y)
     347  {
     348    return __builtin_vec_or (x, y);
     349  }
     350  
     351  ullvec_t
     352  or_11 (ullvec_t x, ullvec_t y)
     353  {
     354    return __builtin_vec_or (x, y);
     355  }
     356  
     357  dvec_t
     358  or_12 (dvec_t x, dvec_t y)
     359  {
     360    return __builtin_vec_or (x, y);
     361  }
     362  
     363  fvec_t
     364  or_13 (fvec_t x, fvec_t y)
     365  {
     366    return __builtin_vec_or (x, y);
     367  }
     368  
     369  bcvec_t
     370  xor_0 (bcvec_t x, bcvec_t y)
     371  {
     372    return __builtin_vec_xor (x, y);
     373  }
     374  
     375  scvec_t
     376  xor_1 (scvec_t x, scvec_t y)
     377  {
     378    return __builtin_vec_xor (x, y);
     379  }
     380  
     381  ucvec_t
     382  xor_2 (ucvec_t x, ucvec_t y)
     383  {
     384    return __builtin_vec_xor (x, y);
     385  }
     386  
     387  bsvec_t
     388  xor_3 (bsvec_t x, bsvec_t y)
     389  {
     390    return __builtin_vec_xor (x, y);
     391  }
     392  
     393  ssvec_t
     394  xor_4 (ssvec_t x, ssvec_t y)
     395  {
     396    return __builtin_vec_xor (x, y);
     397  }
     398  
     399  usvec_t
     400  xor_5 (usvec_t x, usvec_t y)
     401  {
     402    return __builtin_vec_xor (x, y);
     403  }
     404  
     405  bivec_t
     406  xor_6 (bivec_t x, bivec_t y)
     407  {
     408    return __builtin_vec_xor (x, y);
     409  }
     410  
     411  sivec_t
     412  xor_7 (sivec_t x, sivec_t y)
     413  {
     414    return __builtin_vec_xor (x, y);
     415  }
     416  
     417  uivec_t
     418  xor_8 (uivec_t x, uivec_t y)
     419  {
     420    return __builtin_vec_xor (x, y);
     421  }
     422  
     423  bllvec_t
     424  xor_9 (bllvec_t x, bllvec_t y)
     425  {
     426    return __builtin_vec_xor (x, y);
     427  }
     428  
     429  sllvec_t
     430  xor_10 (sllvec_t x, sllvec_t y)
     431  {
     432    return __builtin_vec_xor (x, y);
     433  }
     434  
     435  ullvec_t
     436  xor_11 (ullvec_t x, ullvec_t y)
     437  {
     438    return __builtin_vec_xor (x, y);
     439  }
     440  
     441  dvec_t
     442  xor_12 (dvec_t x, dvec_t y)
     443  {
     444    return __builtin_vec_xor (x, y);
     445  }
     446  
     447  fvec_t
     448  xor_13 (fvec_t x, fvec_t y)
     449  {
     450    return __builtin_vec_xor (x, y);
     451  }
     452  
     453  /* { dg-final { scan-tree-dump-not "VIEW_CONVERT_EXPR" "gimple" } } */