Changeset 48954 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Sep 30, 2009, 6:13:02 PM (16 years ago)
Author:
[email protected]
Message:

2009-09-30 Gabor Loki <[email protected]>

Reviewed by George Staikos.

Defines two pseudo-platforms for ARM and Thumb-2 instruction set.
https://bugs.webkit.org/show_bug.cgi?id=29122

Introduces WTF_PLATFORM_ARM_TRADITIONAL and WTF_PLATFORM_ARM_THUMB2
macros on ARM platforms. The PLATFORM(ARM_THUMB2) should be used
when Thumb-2 instruction set is the required target. The
PLATFORM(ARM_TRADITIONAL) is for generic ARM instruction set. In
case where the code is common the PLATFORM(ARM) have to be used.

Modified by George Wright <[email protected]> to correctly work
with the RVCT-defined TARGET_ARCH_ARM and TARGET_ARCH_THUMB
compiler macros, as well as adding readability changes.

  • wtf/Platform.h:
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r48948 r48954  
     12009-09-30  Gabor Loki  <[email protected]>
     2
     3        Reviewed by George Staikos.
     4
     5        Defines two pseudo-platforms for ARM and Thumb-2 instruction set.
     6        https://bugs.webkit.org/show_bug.cgi?id=29122
     7
     8        Introduces WTF_PLATFORM_ARM_TRADITIONAL and WTF_PLATFORM_ARM_THUMB2
     9        macros on ARM platforms. The PLATFORM(ARM_THUMB2) should be used
     10        when Thumb-2 instruction set is the required target. The
     11        PLATFORM(ARM_TRADITIONAL) is for generic ARM instruction set. In
     12        case where the code is common the PLATFORM(ARM) have to be used.
     13
     14        Modified by George Wright  <[email protected]> to correctly work
     15        with the RVCT-defined __TARGET_ARCH_ARM and __TARGET_ARCH_THUMB
     16        compiler macros, as well as adding readability changes.
     17
     18        * wtf/Platform.h:
     19
    1202009-09-30  Oliver Hunt  <[email protected]>
    221
  • trunk/JavaScriptCore/wtf/Platform.h

    r48826 r48954  
    232232   || defined(__arm__)
    233233#define WTF_PLATFORM_ARM 1
     234
    234235#if defined(__ARMEB__)
    235236#define WTF_PLATFORM_BIG_ENDIAN 1
    236 #elif !defined(__ARM_EABI__) && !defined(__EABI__) && !defined(__VFP_FP__)
     237
     238#elif !defined(__ARM_EABI__) \
     239   && !defined(__EABI__) \
     240   && !defined(__VFP_FP__)
    237241#define WTF_PLATFORM_MIDDLE_ENDIAN 1
    238 #endif
    239 #define ARM_ARCH_VERSION 3
    240 #if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || defined(__MARM_ARMV4__) \
    241     || defined(_ARMV4I_)
    242 #undef ARM_ARCH_VERSION
     242
     243#endif
     244
     245/* Set ARM_ARCH_VERSION */
     246#if   defined(__ARM_ARCH_4__) \
     247   || defined(__ARM_ARCH_4T__) \
     248   || defined(__MARM_ARMV4__) \
     249   || defined(_ARMV4I_)
    243250#define ARM_ARCH_VERSION 4
    244 #endif
    245 #if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \
    246         || defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) \
    247         || defined(__ARM_ARCH_5TEJ__) || defined(__MARM_ARMV5__)
    248 #undef ARM_ARCH_VERSION
     251
     252#elif defined(__ARM_ARCH_5__) \
     253   || defined(__ARM_ARCH_5T__) \
     254   || defined(__ARM_ARCH_5E__) \
     255   || defined(__ARM_ARCH_5TE__) \
     256   || defined(__ARM_ARCH_5TEJ__) \
     257   || defined(__MARM_ARMV5__)
    249258#define ARM_ARCH_VERSION 5
    250 #endif
    251 #if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
    252      || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
    253      || defined(__ARM_ARCH_6ZK__) || defined(__ARMV6__)
    254 #undef ARM_ARCH_VERSION
     259
     260#elif defined(__ARM_ARCH_6__) \
     261   || defined(__ARM_ARCH_6J__) \
     262   || defined(__ARM_ARCH_6K__) \
     263   || defined(__ARM_ARCH_6Z__) \
     264   || defined(__ARM_ARCH_6ZK__) \
     265   || defined(__ARM_ARCH_6T2__) \
     266   || defined(__ARMV6__)
    255267#define ARM_ARCH_VERSION 6
    256 #endif
    257 #if defined(__ARM_ARCH_7A__)
    258 #undef ARM_ARCH_VERSION
     268
     269#elif defined(__ARM_ARCH_7A__) \
     270   || defined(__ARM_ARCH_7R__)
    259271#define ARM_ARCH_VERSION 7
    260 #endif
     272
     273/* RVCT sets _TARGET_ARCH_ARM */
     274#elif defined(__TARGET_ARCH_ARM)
     275#define ARM_ARCH_VERSION __TARGET_ARCH_ARM
     276
     277#else
     278#define ARM_ARCH_VERSION 0
     279
     280#endif
     281
     282/* Set THUMB_ARM_VERSION */
     283#if   defined(__ARM_ARCH_4T__)
     284#define THUMB_ARCH_VERSION 1
     285
     286#elif defined(__ARM_ARCH_5T__) \
     287   || defined(__ARM_ARCH_5TE__) \
     288   || defined(__ARM_ARCH_5TEJ__)
     289#define THUMB_ARCH_VERSION 2
     290
     291#elif defined(__ARM_ARCH_6J__) \
     292   || defined(__ARM_ARCH_6K__) \
     293   || defined(__ARM_ARCH_6Z__) \
     294   || defined(__ARM_ARCH_6ZK__) \
     295   || defined(__ARM_ARCH_6M__)
     296#define THUMB_ARCH_VERSION 3
     297
     298#elif defined(__ARM_ARCH_6T2__) \
     299   || defined(__ARM_ARCH_7__) \
     300   || defined(__ARM_ARCH_7A__) \
     301   || defined(__ARM_ARCH_7R__) \
     302   || defined(__ARM_ARCH_7M__)
     303#define THUMB_ARCH_VERSION 4
     304
     305/* RVCT sets __TARGET_ARCH_THUMB */
     306#elif defined(__TARGET_ARCH_THUMB)
     307#define THUMB_ARCH_VERSION __TARGET_ARCH_THUMB
     308
     309#else
     310#define THUMB_ARCH_VERSION 0
     311#endif
     312
    261313/* On ARMv5 and below the natural alignment is required. */
    262314#if !defined(ARM_REQUIRE_NATURAL_ALIGNMENT) && ARM_ARCH_VERSION <= 5
    263315#define ARM_REQUIRE_NATURAL_ALIGNMENT 1
    264316#endif
     317
    265318/* Defines two pseudo-platforms for ARM and Thumb-2 instruction set. */
    266319#if !defined(WTF_PLATFORM_ARM_TRADITIONAL) && !defined(WTF_PLATFORM_ARM_THUMB2)
    267 #  if defined(thumb2) || defined(__thumb2__)
     320#  if defined(thumb2) || defined(__thumb2__) \
     321  || ((defined(__thumb) || defined(__thumb__)) && THUMB_ARCH_VERSION == 4)
    268322#    define WTF_PLATFORM_ARM_TRADITIONAL 0
    269323#    define WTF_PLATFORM_ARM_THUMB2 1
Note: See TracChangeset for help on using the changeset viewer.