草庐IT

c++ - 错误 : operand out of range (64 is not between 0 and 31)

我在PowerPC上遇到GCC内联汇编。该程序使用-g2-O3编译良好,但使用-g3-O0编译失败。问题是,我需要在调试器下观察它,所以我需要没有优化的符号。程序如下:$cattest.cxx#include#undefvectortypedef__vectorunsignedcharuint8x16_p;uint8x16_pVectorFastLoad8(constvoid*p){longoffset=0;uint8x16_pres;__asm("lxvd2x%x0,%1,%2\n\t":"=wa"(res):"g"(p),"g"(offset/4),"Z"(*(constchar(

c++ - 如何使用 Altivec 将 vector 存储到内存中未对齐的位置

我从tutorial知道未对齐的加载和存储看起来像://Loadavectorfromanunalignedlocationinmemory__vectorunsignedcharLoadUnaligned(constunsignedchar*src){__vectorunsignedcharpermuteVector=vec_lvsl(0,src);__vectorunsignedcharlow=vec_ld(0,src);__vectorunsignedcharhigh=vec_ld(16,src);returnvec_perm(low,high,permuteVector);}/