apple-altivec-1.c
来自「Mac OS X 10.4.9 for x86 Source Code gcc」· C语言 代码 · 共 44 行
C
44 行
/* APPLE LOCAL file AltiVec *//* Additional AltiVec PIM argument type combinations. *//* { dg-do compile { target powerpc*-*-darwin* } } *//* { dg-options "-faltivec -Wall" } */vector signed intLoadUnalignedSI( signed int *p){ vector signed int vload1 = vec_ld( 0, (vector signed int *)p); if ( ((long)p) * 0xF){ vector signed int vload2 = vec_ld( 16, (vector signed int *)p); vector unsigned char vperm = vec_ldl( 0, p); vload1 = vec_perm(vload1, vload2, vperm); } return vload1;}inline vector float Reciprocal( vector float v ){ vector float estimate = vec_re( v ); return vec_madd( vec_nmsub( estimate, v, (vector float) (1.0) ), estimate, estimate );}void foo(void) { vector bool char vbc1 = (vector bool char)(255); vector pixel vp1, vp2; vector float vf1, vf2; vector unsigned char vuc1; vector unsigned short vus1, vus2; vector bool short vbs1, vbs2; vector signed short vss1; vector signed int vsi1, vsi2; vbc1 = vec_splat (vbc1, 9); vp2 = vec_splat (vp1, 7); vf1 = vec_splat (vf2, 31); vuc1 = vec_pack (vus1, vus2); vbc1 = vec_pack (vbs1, vbs2); vss1 = vec_pack (vsi1, vsi2);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?