X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fops.expect.c;h=834007fd539f9c362a75d9416285e22bfbc038c2;hb=ee554c95296119b6b8d82856fbb09ffb8c9dc419;hp=3b59db124d666a61ceaf70aa3396021301ebb4fb;hpb=3947cf245e051c129e15fda46120c93154b804c4;p=ia32rtools.git diff --git a/tests/ops.expect.c b/tests/ops.expect.c index 3b59db1..834007f 100644 --- a/tests/ops.expect.c +++ b/tests/ops.expect.c @@ -6,7 +6,9 @@ int sub_test() u32 edx; u32 esi; u32 edi; + u32 cond_c; u32 cond_z; + u64 tmp64; ebx = 0x10000; esi = 0x20000; @@ -31,7 +33,28 @@ loop: *(u16 *)edi = eax; edi -= 2; // stos *(u32 *)edi = eax; edi -= 4; // stos edx = (s32)eax >> 31; // cdq - eax = ecx ? __builtin_ffs(ecx) - 1 : 0; // bsf + if (ecx) eax = __builtin_ffs(ecx) - 1; // bsf + tmp64 = ((u64)edx << 32) | eax; + tmp64 = (s64)tmp64 << LOBYTE(ecx); + edx = tmp64 >> 32; eax = tmp64; // allshl + edi = eax; + tmp64 = ((u64)edx << 32) | eax; + tmp64 = (s64)tmp64 >> LOBYTE(ecx); + edx = tmp64 >> 32; eax = tmp64; // allshr + eax = __builtin_bswap32(eax); + ecx ^= eax; + tmp64 = (u64)eax + ecx; + cond_c = tmp64 >> 32; + eax = (u32)tmp64; + cond_z = (eax == 0); // add64 + while (ecx != 0) { + cond_c = *(u8 *)esi < *(u8 *)edi; + cond_z = (*(u8 *)esi == *(u8 *)edi); esi += 1, edi += 1; + ecx--; + if (cond_z != 0) break; + } // repne cmps + LOBYTE(ecx) = (!cond_z); + LOBYTE(ecx) += (u8)ecx + cond_c; eax = 1; return eax; }