Summary: | Use __builtin_expect when compiling using RVCT in GNU mode | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Daniel Bates <dbates> | ||||||||||
Component: | Web Template Framework | Assignee: | Siddharth Mathur <s.mathur> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | commit-queue, joybro201, koshuin, laszlo.gombos, skyul, s.mathur, webkit.review.bot | ||||||||||
Priority: | P2 | ||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||
Hardware: | Other | ||||||||||||
OS: | Other | ||||||||||||
Attachments: |
|
Description
Daniel Bates
2011-01-03 21:14:29 PST
Created attachment 77867 [details]
Patch
Comment on attachment 77867 [details]
Patch
OK
Looks good to me too. A simpler way to express this is to test for defined(__GNUC__), instead of "COMPILER(GCC) || (COMPILER(RVCT) && defined(__GNUC__))". (In reply to comment #3) > Looks good to me too. A simpler way to express this is to test for defined(__GNUC__), instead of "COMPILER(GCC) || (COMPILER(RVCT) && defined(__GNUC__))". Will change before I land. Committed r74973: <http://trac.webkit.org/changeset/74973> Created attachment 78423 [details] Exclude RVCT2.2 from using this intrinsic According to ARM's documentation (http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0202h/Cjabddedbde.html), this GNU-style intrinsic is only available with RVCT 3 and later , so exclude previous major version from using it. Created attachment 78425 [details]
Same patch as above, but with Changelog format issue corrected.
Comment on attachment 78425 [details]
Same patch as above, but with Changelog format issue corrected.
rs=me.
Comment on attachment 77867 [details]
Patch
I'm confused by the status of this bug. Did this get landed?
(In reply to comment #9) > (From update of attachment 77867 [details]) > I'm confused by the status of this bug. Did this get landed? Sorry Eric for the confusion. I reopened a previously closed bug (manually landed by Daniel Bates) to add an amendment, which you just r+ed. Comment on attachment 78425 [details]
Same patch as above, but with Changelog format issue corrected.
Why are we hardcoding __ARMCC_2_2__ instead of checking __ARMCC_VERSION >= 300000?
(In reply to comment #11) > (From update of attachment 78425 [details]) > Why are we hardcoding __ARMCC_2_2__ instead of checking __ARMCC_VERSION >= 300000? I mean checking that __ARMCC_VERSION <= 300000 (In reply to comment #12) > (In reply to comment #11) > > (From update of attachment 78425 [details] [details]) > > Why are we hardcoding __ARMCC_2_2__ instead of checking __ARMCC_VERSION >= 300000? > > I mean checking that __ARMCC_VERSION <= 300000 Disregard this comment. The inequality in the previous comment (comment 11) was correct. That is, we should change the check from: #if defined(__GNUC__) to #if COMPILER(GCC) || (COMPILER(RVCT) && defined(__GNUC__) && __ARMCC_VERSION >= 300000) so that we only use __builtin_expect if we are compiling with GCC or compiling with RVCT version 3.0 or higher in GNU mode. Created attachment 78461 [details]
Patch
Attachment 78461 [details] did not pass style-queue:
Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1
Source/JavaScriptCore/wtf/Platform.h:1016: Missing space after , [whitespace/comma] [3]
Source/JavaScriptCore/wtf/AlwaysInline.h:44: Missing space after , [whitespace/comma] [3]
Source/JavaScriptCore/wtf/AlwaysInline.h:52: Missing space after , [whitespace/comma] [3]
Total errors found: 3 in 3 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 78461 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=78461&action=review > Source/JavaScriptCore/wtf/Platform.h:79 > +/* Define this for !RVCT compilers, just so we can write things like COMPILER(RVCT) && RVCT_VERSION_AT_LEAST(3,0,0,0). */ It occurs to me that this means that you could always just use RVCT_VERSION_AT_LEAST(3,0,0,0) without COMPILER(RVCT); maybe we should. > Source/JavaScriptCore/wtf/Platform.h:91 > -/* define this for !GCC compilers, just so we can write things like COMPILER(GCC) && GCC_VERSION_AT_LEAST(4,1,0) */ > +/* Define this for !GCC compilers, just so we can write things like COMPILER(GCC) && GCC_VERSION_AT_LEAST(4,1,0). */ > #define GCC_VERSION_AT_LEAST(major, minor, patch) 0 It occurs to me that this means that you could always just use GCC_VERSION_AT_LEAST(3,0,0,0) without COMPILER(GCC); maybe we should. (In reply to comment #16) > (From update of attachment 78461 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=78461&action=review > > > Source/JavaScriptCore/wtf/Platform.h:79 > > +/* Define this for !RVCT compilers, just so we can write things like COMPILER(RVCT) && RVCT_VERSION_AT_LEAST(3,0,0,0). */ > > It occurs to me that this means that you could always just use RVCT_VERSION_AT_LEAST(3,0,0,0) without COMPILER(RVCT); maybe we should. Correct. Will change both comment and callsites before landing. > > > Source/JavaScriptCore/wtf/Platform.h:91 > > -/* define this for !GCC compilers, just so we can write things like COMPILER(GCC) && GCC_VERSION_AT_LEAST(4,1,0) */ > > +/* Define this for !GCC compilers, just so we can write things like COMPILER(GCC) && GCC_VERSION_AT_LEAST(4,1,0). */ > > #define GCC_VERSION_AT_LEAST(major, minor, patch) 0 > > It occurs to me that this means that you could always just use GCC_VERSION_AT_LEAST(3,0,0,0) without COMPILER(GCC); maybe we should. Correct. Will change comment before landing. I suggest that we update the callsites in a separate bug. Committed r75447: <http://trac.webkit.org/changeset/75447> (In reply to comment #17) > (In reply to comment #16) > > It occurs to me that this means that you could always just use GCC_VERSION_AT_LEAST(3,0,0,0) without COMPILER(GCC); maybe we should. > > Correct. Will change comment before landing. I suggest that we update the callsites in a separate bug. Filed bug #52178 for this and decided to make the comment change in the patch for this bug. |