From: Philipp K. K. <pk...@sp...> - 2014-02-14 08:53:02
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 14.02.2014 04:06, schrieb Ben Shi: > Hello, > > I found that the current implementation of comparason in STM8 is > comparing two operands from LSB to MSB. Could it be more efficient > if their MSBs can determine the final result and omitting other > bytes ? > > Ben While this might happen in some specific cases, I do not believe it to be common: Various empirical studies have shown that most variables have zero as their MSB most of the time. Also, most integer contants in programs are small. Compariong the MSBs of two values will be comparing zero to zero very often. So we should be more likely to find an inequality early when comparing from LSB to MSB. Philipp -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iEYEARECAAYFAlL92WEACgkQbtUV+xsoLprScwCcDFYE9aUZIBVd1NzapsCj28MI 1aUAoOxioEtDdgyYrhCyaTmCWvjq31mx =pNfm -----END PGP SIGNATURE----- |