aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/movbe-5.c
blob: b1ab1215268cfeb3e1ea7adea0a9cdc858404560 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* PR tree-optimization/78821 */
/* { dg-do compile } */
/* { dg-options "-O2 -mmovbe" } */

unsigned short
foo (unsigned short *buf)
{
  unsigned short a = buf[0];
  return ((unsigned short) (a >> 8)) | (unsigned short) (a << 8);
}

void
bar (char *buf, unsigned int data)
{
  buf[0] = data >> 8;
  buf[1] = data;
}

/* { dg-final { scan-assembler-times "movbew\[ \t\]" 2 } } */