Title | MPS doesn't make use of __builtin_readcyclecounter on OS X |
Status | closed |
Priority | nice |
Assigned user | Richard Brooksby |
Organization | Ravenbrook |
Description | Clang provides a cross-platform builtin for a fast timer. We should use this on OS X to implement EVENT_CLOCK (but only if it is available, obviously). |
Analysis | RB wrote the following code in clock.h: /* TODO: Clang supposedly provides a cross-platform builtin for a fast * timer, but it doesn't seem to be present on Mac OS X 10.8. We should * use it if it ever appears. * < http://clang.llvm.org/docs/LanguageExtensions.html#builtins > */#if defined(MPS_BUILD_LL) #if __has_builtin(__builtin_readcyclecounter) #error "__builtin_readcyclecounter is available but not used" #endif /* __has_builtin(__builtin_readcyclecounter) */ #endif The upgrade to XCode 4.6 caused the #error to go off, so presumably this upgrade adds __builtin_readcyclecounter on OS X. We need to: 1. Remove the #error so that the MPS can be built on OS X with XCode 4.6. [DONE] 2. Use this fast counter to implement EVENT_CLOCK. |
How found | manual_test |
Evidence | None. |
Observed in | 1.110.0 |
Created by | Gareth Rees |
Created on | 2013-02-04 16:36:17 |
Last modified by | Gareth Rees |
Last modified on | 2013-05-16 13:37:31 |
History | 2013-02-04 GDR Created. |
Change | Effect | Date | User | Description |
---|---|---|---|---|
181858 | closed | 2013-05-16 13:37:31 | Gareth Rees | Use __builtin_readcyclecounter for EVENT_CLOCK if it's available. |
180917 | open | 2013-02-06 17:03:17 | Richard Brooksby | Temporarily patching detection of __builtin_readcyclecounter so that we can continue to compile with Apple Clang 4.0. |
180903 | open | 2013-02-04 16:40:28 | Gareth Rees | Don't #error if defined(MPS_BUILD_LL) and __has_builtin(__builtin_readcyclecounter). Put a TODO here instead, referencing job003411. |