(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
aarch64/
movk_3.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2 --save-temps" } */
       3  
       4  
       5  /* 2 MOV */
       6  void f16 (long *p)
       7  {
       8    p[0] = 0x1234;
       9    p[2] = 0x1235;
      10  }
      11  
      12  /* MOV, MOVK and ADD */
      13  void f32_1 (long *p)
      14  {
      15    p[0] = 0x12345678;
      16    p[2] = 0x12345678 + 0xfff;
      17  }
      18  
      19  /* 2 MOV, 2 MOVK */
      20  void f32_2 (long *p)
      21  {
      22    p[0] = 0x12345678;
      23    p[2] = 0x12345678 + 0x555555;
      24  }
      25  
      26  /* MOV, MOVK and ADD */
      27  void f32_3 (long *p)
      28  {
      29    p[0] = 0x12345678;
      30    p[2] = 0x12345678 + 0x999000;
      31  }
      32  
      33  /* MOV, 2 MOVK and ADD */
      34  void f48_1 (long *p)
      35  {
      36    p[0] = 0x123456789abc;
      37    p[2] = 0x123456789abc + 0xfff;
      38  }
      39  
      40  /* MOV, 2 MOVK and 2 ADD */
      41  void f48_2 (long *p)
      42  {
      43    p[0] = 0x123456789abc;
      44    p[2] = 0x123456789abc + 0x666666;
      45  }
      46  
      47  /* 2 MOV, 4 MOVK */
      48  void f48_3 (long *p)
      49  {
      50    p[0] = 0x123456789abc;
      51    p[2] = 0x123456789abc + 0x1666666;
      52  }
      53  
      54  /* { dg-final { scan-assembler-times "mov\tx\[0-9\]+, \[0-9\]+" 10 } } */
      55  /* { dg-final { scan-assembler-times "movk\tx\[0-9\]+, 0x\[0-9a-f\]+" 12 } } */
      56  /* { dg-final { scan-assembler-times "add\tx\[0-9\]+, x\[0-9\]+, \[0-9\]+" 5 } } */