1  /* { dg-do compile } */
       2  /* { dg-additional-options "-O2 -std=c99" } */
       3  /* { dg-final { check-function-bodies "**" "" "" { target { le } } } } */
       4  
       5  #include <stdint.h>
       6  
       7  /*
       8  ** draw_bitmap1:
       9  ** ...
      10  **	mul	z[0-9]+.h, p[0-9]+/m, z[0-9]+.h, z[0-9]+.h
      11  **	addhnb	z[0-9]+.b, z[0-9]+.h, z[0-9]+.h
      12  **	addhnb	z[0-9]+.b, z[0-9]+.h, z[0-9]+.h
      13  ** ...
      14  */
      15  void draw_bitmap1(uint8_t* restrict pixel, uint8_t level, int n)
      16  {
      17    for (int i = 0; i < (n & -16); i+=1)
      18      pixel[i] = (pixel[i] * level) / 0xff;
      19  }
      20  
      21  void draw_bitmap2(uint8_t* restrict pixel, uint8_t level, int n)
      22  {
      23    for (int i = 0; i < (n & -16); i+=1)
      24      pixel[i] = (pixel[i] * level) / 0xfe;
      25  }
      26  
      27  /*
      28  ** draw_bitmap3:
      29  ** ...
      30  **	mul	z[0-9]+.s, p[0-9]+/m, z[0-9]+.s, z[0-9]+.s
      31  **	addhnb	z[0-9]+.h, z[0-9]+.s, z[0-9]+.s
      32  **	addhnb	z[0-9]+.h, z[0-9]+.s, z[0-9]+.s
      33  ** ...
      34  */
      35  void draw_bitmap3(uint16_t* restrict pixel, uint16_t level, int n)
      36  {
      37    for (int i = 0; i < (n & -16); i+=1)
      38      pixel[i] = (pixel[i] * level) / 0xffffU;
      39  }
      40  
      41  /*
      42  ** draw_bitmap4:
      43  ** ...
      44  **	mul	z[0-9]+.d, p[0-9]+/m, z[0-9]+.d, z[0-9]+.d
      45  **	addhnb	z[0-9]+.s, z[0-9]+.d, z[0-9]+.d
      46  **	addhnb	z[0-9]+.s, z[0-9]+.d, z[0-9]+.d
      47  ** ...
      48  */
      49  void draw_bitmap4(uint32_t* restrict pixel, uint32_t level, int n)
      50  {
      51    for (int i = 0; i < (n & -16); i+=1)
      52      pixel[i] = (pixel[i] * (uint64_t)level) / 0xffffffffUL;
      53  }