📄 testvmx.c
字号:
printf("Function vec_andc [type char] ===> Error\n"); else printf("Function vec_andc [type char] ===> OK\n"); err = 0; UCaux1.v = vec_andc( UCcons1, UCcons2 ); UCaux2.v = UCcons1; UCaux3.v = UCcons2; for( i=0; i< 16; i++ ) if (UCaux1.e[i] != (UCaux2.e[i] & ~UCaux3.e[i])) err++; if (err) printf("Function vec_andc [type unsigned char] ===> Error\n"); else printf("Function vec_andc [type unsigned char] ===> OK\n"); err = 0; Saux1.v = vec_andc( Scons1, Scons2 ); Saux2.v = Scons1; Saux3.v = Scons2; for( i=0; i< 8; i++ ) if (Saux1.e[i] != (Saux2.e[i] & ~Saux3.e[i])) err++; if (err) printf("Function vec_andc [type short] ===> Error\n"); else printf("Function vec_andc [type short] ===> OK\n"); err = 0; USaux1.v = vec_andc( UScons1, UScons2 ); USaux2.v = UScons1; USaux3.v = UScons2; for( i=0; i< 8; i++ ) if (USaux1.e[i] != (USaux2.e[i] & ~USaux3.e[i])) err++; if (err) printf("Function vec_andc [type unsigned short] ===> Error\n"); else printf("Function vec_andc [type unsigned short] ===> OK\n"); err = 0; Iaux1.v = vec_andc( Icons1, Icons2 ); Iaux2.v = Icons1; Iaux3.v = Icons2; for( i=0; i< 4; i++ ) if (Iaux1.e[i] != (Iaux2.e[i] & ~Iaux3.e[i])) err++; if (err) printf("Function vec_andc [type integer] ===> Error\n"); else printf("Function vec_andc [type integer] ===> OK\n"); err = 0; UIaux1.v = vec_andc( UIcons1, UIcons2 ); UIaux2.v = UIcons1; UIaux3.v = UIcons2; for( i=0; i< 4; i++ ) if (UIaux1.e[i] != (UIaux2.e[i] & ~UIaux3.e[i])) err++; if (err) printf("Function vec_andc [type unsigned int] ===> Error\n"); else printf("Function vec_andc [type unsigned int] ===> OK\n");#if defined TEST_FLOATS err = 0; Faux1.v = vec_andc( Fcons1, Fcons2 ); Faux2.v = Fcons1; Faux3.v = Fcons2; for( i=0; i< 4; i++ ) { Ivec1 = Faux1.i[i]; Ivec2 = Faux2.i[i]; Ivec3 = Faux3.i[i]; if ((Ivec1) != ((Ivec2) & ~(Ivec3))) err++; } if (err) printf("Function vec_andc [type float] ===> Error\n"); else printf("Function vec_andc [type float] ===> OK\n");#endif/* Function vec_avg */ printf("\n:::::::::::::::::::::::::::::::::::::::\n"); err = 0; Caux1.v = vec_avg( Ccons1, Ccons2 ); Caux2.v = Ccons1; Caux3.v = Ccons2; for( i=0; i< 16; i++ ) { j = (Caux2.e[i]+Caux3.e[i]+1) >> 1; if (Caux1.e[i] != j) err++; } if (err) printf("Function vec_avg [type char] ===> Error\n"); else printf("Function vec_avg [type char] ===> OK\n"); err = 0; UCaux1.v = vec_avg( UCcons1, UCcons2 ); UCaux2.v = UCcons1; UCaux3.v = UCcons2; for( i=0; i< 16; i++ ) { j = (UCaux2.e[i]+UCaux3.e[i]+1) >> 1; if (UCaux1.e[i] != j) err++; } if (err) printf("Function vec_avg [type unsigned char] ===> Error\n"); else printf("Function vec_avg [type unsigned char] ===> OK\n"); err = 0; Saux1.v = vec_avg( Scons1, Scons2 ); Saux2.v = Scons1; Saux3.v = Scons2; for( i=0; i< 8; i++ ) { j = (Saux2.e[i]+Saux3.e[i]+1) >> 1; if (Saux1.e[i] != j) err++; } if (err) printf("Function vec_avg [type short] ===> Error\n"); else printf("Function vec_avg [type short] ===> OK\n"); err = 0; USaux1.v = vec_avg( UScons1, UScons2 ); USaux2.v = UScons1; USaux3.v = UScons2; for( i=0; i< 8; i++ ) { j = (USaux2.e[i]+USaux3.e[i]+1) >> 1; if (USaux1.e[i] != j) err++; } if (err) printf("Function vec_avg [type unsigned short] ===> Error\n"); else printf("Function vec_avg [type unsigned short] ===> OK\n"); err = 0; Iaux1.v = vec_avg( Icons1, Icons2 ); Iaux2.v = Icons1; Iaux3.v = Icons2; for( i=0; i< 4; i++ ) { Iaux = Iaux2.e[i]%2; if (Iaux2.e[i]<0) Iaux = -Iaux; if (Iaux3.e[i]<0) Iaux = (Iaux - Iaux3.e[i]%2 + 1)>>1; else Iaux = (Iaux + Iaux3.e[i]%2 + 1)>>1; Iaux = (Iaux2.e[i] >> 1) + (Iaux3.e[i] >> 1) + Iaux; if (Iaux1.e[i] != Iaux) err++; } if (err) printf("Function vec_avg [type integer] ===> Error\n"); else printf("Function vec_avg [type integer] ===> OK\n"); err = 0; UIaux1.v = vec_avg( UIcons1, UIcons2 ); UIaux2.v = UIcons1; UIaux3.v = UIcons2; for( i=0; i< 4; i++ ) { UIaux = (UIaux2.e[i] >> 1) + (UIaux3.e[i] >> 1) + ((UIaux2.e[i]%2 + UIaux3.e[i]%2 + 1 )>>1); if (UIaux1.e[i] != UIaux) err++; } if (err) printf("Function vec_avg [type unsigned int] ===> Error\n"); else printf("Function vec_avg [type unsigned int] ===> OK\n");#if defined TEST_FLOATS/* Function vec_ceil */ printf("\n:::::::::::::::::::::::::::::::::::::::\n"); err = 0; Faux1.v = vec_ceil( Fcons1 ); Faux2.v = Fcons1; for( i=0; i< 4; i++ ) if (Faux1.e[i] != ceil(Faux2.e[i])) err++; if (err) printf("Function vec_ceil [type float] ===> Error\n"); else printf("Function vec_ceil [type float] ===> OK\n");#endif#if defined TEST_FLOATS/* Function vec_cmpb */ printf("\n:::::::::::::::::::::::::::::::::::::::\n"); err = 0; Iaux1.v = vec_cmpb( Fcons1, Fcons2 ); Faux2.v = Fcons1; Faux3.v = Fcons2; for( i=0; i< 4; i++ ) { j = 0; if (Faux2.e[i]>Faux3.e[i]) j+=(1 << 31); if (Faux2.e[i]<-Faux3.e[i]) j+=(1 << 30); if (Iaux1.e[i] != j) err++; } if (err) printf("Function vec_cmpb [type float] ===> Error\n"); else printf("Function vec_cmpb [type float] ===> OK\n");#endif/* Function vec_cmpeq */ printf("\n:::::::::::::::::::::::::::::::::::::::\n"); err = 0; BCaux1.v = vec_cmpeq( Ccons1, Ccons2 ); Caux2.v = Ccons1; Caux3.v = Ccons2; for( i=0; i< 16; i++ ) { if (Caux2.e[i] == Caux3.e[i]) BCaux = 0xFF; else BCaux = 0; if (BCaux1.e[i] != BCaux) err++; } if (err) printf("Function vec_cmpeq [type char] ===> Error\n"); else printf("Function vec_cmpeq [type char] ===> OK\n"); err = 0; BCaux1.v = vec_cmpeq( UCcons1, UCcons2 ); UCaux2.v = UCcons1; UCaux3.v = UCcons2; for( i=0; i< 16; i++ ) { if (UCaux2.e[i] == UCaux3.e[i]) BCaux = 0xFF; else BCaux = 0; if (BCaux1.e[i] != BCaux) err++; } if (err) printf("Function vec_cmpeq [type unsigned char] ===> Error\n"); else printf("Function vec_cmpeq [type unsigned char] ===> OK\n"); err = 0; BSaux1.v = vec_cmpeq( Scons1, Scons2 ); Saux2.v = Scons1; Saux3.v = Scons2; for( i=0; i< 8; i++ ) { if (Saux2.e[i] == Saux3.e[i]) BSaux = 0xFFFF; else BSaux = 0; if (BSaux1.e[i] != BSaux) err++; } if (err) printf("Function vec_cmpeq [type short] ===> Error\n"); else printf("Function vec_cmpeq [type short] ===> OK\n"); err = 0; BSaux1.v = vec_cmpeq( UScons1, UScons2 ); USaux2.v = UScons1; USaux3.v = UScons2; for( i=0; i< 8; i++ ) { if (USaux2.e[i] == USaux3.e[i]) BSaux = 0xFFFF; else BSaux = 0; if (BSaux1.e[i] != BSaux) err++; } if (err) printf("Function vec_cmpeq [type unsigned short] ===> Error\n"); else printf("Function vec_cmpeq [type unsigned short] ===> OK\n"); err = 0; BIaux1.v = vec_cmpeq( Icons1, Icons2 ); Iaux2.v = Icons1; Iaux3.v = Icons2; for( i=0; i< 4; i++ ) { if (Iaux2.e[i] == Iaux3.e[i]) BIaux = 0xFFFFFFFF; else BIaux = 0; if (BIaux1.e[i] != BIaux) err++; } if (err) printf("Function vec_cmpeq [type integer] ===> Error\n"); else printf("Function vec_cmpeq [type integer] ===> OK\n"); err = 0; BIaux1.v = vec_cmpeq( UIcons1, UIcons2 ); UIaux2.v = UIcons1; UIaux3.v = UIcons2; for( i=0; i< 4; i++ ) { if (UIaux2.e[i] == UIaux3.e[i]) BIaux = 0xFFFFFFFF; else BIaux = 0; if (BIaux1.e[i] != BIaux) err++; } if (err) printf("Function vec_cmpeq [type unsigned int] ===> Error\n"); else printf("Function vec_cmpeq [type unsigned int] ===> OK\n");#if defined TEST_FLOATS err = 0; BIaux1.v = vec_cmpeq( Fcons1, Fcons2 ); Faux2.v = Fcons1; Faux3.v = Fcons2; for( i=0; i< 4; i++ ) { if (Faux2.e[i] == Faux3.e[i]) BIaux = 0xFFFFFFFF; else BIaux = 0; if (BIaux1.e[i] != BIaux) err++; } if (err) printf("Function vec_cmpeq [type float] ===> Error\n"); else printf("Function vec_cmpeq [type float] ===> OK\n");#endif#if defined TEST_FLOATS/* Function vec_cmpge */ printf("\n:::::::::::::::::::::::::::::::::::::::\n"); err = 0; BIaux1.v = vec_cmpge( Fcons1, Fcons2 ); Faux2.v = Fcons1; Faux3.v = Fcons2; for( i=0; i< 4; i++ ) { if (Faux2.e[i] >= Faux3.e[i]) BIaux = 0xFFFFFFFF; else BIaux = 0; if (BIaux1.e[i] != BIaux) err++; } if (err) printf("Function vec_cmpge [type float] ===> Error\n"); else printf("Function vec_cmpge [type float] ===> OK\n");#endif/* Function vec_cmpgt */ printf("\n:::::::::::::::::::::::::::::::::::::::\n"); err = 0; BCaux1.v = vec_cmpgt( Ccons1, Ccons2 ); Caux2.v = Ccons1; Caux3.v = Ccons2; for( i=0; i< 16; i++ ) { if (Caux2.e[i] > Caux3.e[i]) BCaux = 0xFF; else BCaux = 0; if (BCaux1.e[i] != BCaux) err++; } if (err) printf("Function vec_cmpgt [type char] ===> Error\n"); else printf("Function vec_cmpgt [type char] ===> OK\n"); err = 0; BCaux1.v = vec_cmpgt( UCcons1, UCcons2 ); UCaux2.v = UCcons1; UCaux3.v = UCcons2; for( i=0; i< 16; i++ ) { if (UCaux2.e[i] > UCaux3.e[i]) BCaux = 0xFF; else BCaux = 0; if (BCaux1.e[i] != BCaux) err++; } if (err) printf("Function vec_cmpgt [type unsigned char] ===> Error\n"); else printf("Function vec_cmpgt [type unsigned char] ===> OK\n"); err = 0; BSaux1.v = vec_cmpgt( Scons1, Scons2 ); Saux2.v = Scons1; Saux3.v = Scons2; for( i=0; i< 8; i++ ) { if (Saux2.e[i] > Saux3.e[i]) BSaux = 0xFFFF; else BSaux = 0; if (BSaux1.e[i] != BSaux) err++; } if (err) printf("Function vec_cmpgt [type short] ===> Error\n"); else printf("Function vec_cmpgt [type short] ===> OK\n"); err = 0; BSaux1.v = vec_cmpgt( UScons1, UScons2 ); USaux2.v = UScons1; USaux3.v = UScons2; for( i=0; i< 8; i++ ) { if (USaux2.e[i] > USaux3.e[i]) BSaux = 0xFFFF; else BSaux = 0; if (BSaux1.e[i] != BSaux) err++; } if (err) printf("Function vec_cmpgt [type unsigned short] ===> Error\n"); else printf("Function vec_cmpgt [type unsigned short] ===> OK\n"); err = 0; BIaux1.v = vec_cmpgt( Icons1, Icons2 ); Iaux2.v = Icons1; Iaux3.v = Icons2; for( i=0; i< 4; i++ ) { if (Iaux2.e[i] > Iaux3.e[i]) BIaux = 0xFFFFFFFF; else BIaux = 0; if (BIaux1.e[i] != BIaux) err++; } if (err) printf("Function vec_cmpgt [type integer] ===> Error\n");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -