gcc/testsuite/gcc.dg/vect/pr33597.c
raw| 1 | /* { dg-do compile } */ |
| 2 | |
| 3 | typedef unsigned char uint8_t; |
| 4 | typedef unsigned short uint16_t; |
| 5 | |
| 6 | void |
| 7 | rgb15to24_C (const uint8_t * src, uint8_t * dst, long src_size) |
| 8 | { |
| 9 | const uint16_t *end; |
| 10 | const uint16_t *s = (uint16_t *)src; |
| 11 | uint8_t *d = (uint8_t *)dst; |
| 12 | |
| 13 | end = s + src_size/2; |
| 14 | while (s < end) |
| 15 | { |
| 16 | uint16_t bgr = *s++; |
| 17 | |
| 18 | *d++ = (bgr&0x1F)<<3; |
| 19 | *d++ = (bgr&0x3E0)>>2; |
| 20 | *d++ = (bgr&0x7C00)>>7; |
| 21 | } |
| 22 | } |
| 23 |