Optimize multiplication by zero

This commit is contained in:
Colin Leroy-Mira
2023-11-05 21:03:06 +01:00
parent fe115fb621
commit cff611711b
2 changed files with 14 additions and 1 deletions

View File

@@ -55,6 +55,7 @@ void m3(unsigned char uc)
/* testing literal multiply with same source and destination */
vuc = uc;
uc2 = 0;
uc1 = vuc; uc1 = uc1*0; if( uc1 != 0 ) failures++;
uc1 = vuc; uc1 = uc1*1; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*2; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*3; if( uc1 != (uc2+=TESTLIT) ) failures++;