Merge pull request #3270 from 86Box/feature/checkio_optimize

386_common: Handle IOPB segment limit corner case more like the old code
This commit is contained in:
Miran Grča
2023-04-23 03:59:23 +02:00
committed by GitHub
2 changed files with 25 additions and 14 deletions

View File

@@ -55,6 +55,14 @@
#define BCD16(x) ((((x) / 1000) << 12) | (((x) / 100) << 8) | BCD8(x))
#define BCD32(x) ((((x) / 10000000) << 28) | (((x) / 1000000) << 24) | (((x) / 100000) << 20) | (((x) / 10000) << 16) | BCD16(x))
#if defined(__GNUC__) || defined(__clang__)
# define UNLIKELY(x) __builtin_expect((x), 0)
# define LIKELY(x) __builtin_expect((x), 1)
#else
# define UNLIKELY(x) (x)
# define LIKELY(x) (x)
#endif
#ifdef __cplusplus
extern "C" {
#endif