1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_p8vector_ok } */
4 /* { dg-options "-mdejagnu-cpu=power7 -mtune=power8 -O3 -dp" } */
5
6 #define LARGE 0x12345
7
fusion_uchar(unsigned char * p)8 int fusion_uchar (unsigned char *p){ return p[LARGE]; }
fusion_schar(signed char * p)9 int fusion_schar (signed char *p){ return p[LARGE]; }
fusion_ushort(unsigned short * p)10 int fusion_ushort (unsigned short *p){ return p[LARGE]; }
fusion_short(short * p)11 int fusion_short (short *p){ return p[LARGE]; }
fusion_int(int * p)12 int fusion_int (int *p){ return p[LARGE]; }
fusion_uns(unsigned * p)13 unsigned fusion_uns (unsigned *p){ return p[LARGE]; }
14
15 /* { dg-final { scan-assembler-times "fusion_gpr_load" 6 } } */
16 /* { dg-final { scan-assembler-times "lbz" 2 } } */
17 /* { dg-final { scan-assembler-times "extsb" 1 } } */
18 /* { dg-final { scan-assembler-times "lhz" 2 } } */
19 /* { dg-final { scan-assembler-times "extsh" 1 } } */
20 /* { dg-final { scan-assembler-times "lwz" 2 } } */
21