Skip to content

Conversation

showlabor
Copy link
Contributor

Currently there are tests for ARMV3 and ARMV6 in cycleclock.h which are not
defined using gcc on ARM. Since there is also a cast to the unknown type
int64 I assume that the ARM code has not been tested. Therefore this patch
replaces the checks for ARMV3 and ARMV6 by checks for __ARM_ARCH. Also, the
cast to int64 is fixed by casting to int64_t.

Currently there are tests for ARMV3 and ARMV6 in cycleclock.h which are not
defined using gcc on ARM. Since there is also a cast to the unknown type
int64 I assume that the ARM code has not been tested. Therefore this patch
replaces the checks for ARMV3 and ARMV6 by checks for __ARM_ARCH. Also, the
cast to int64 is fixed by casting to int64_t.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should be able to combine this into one check:

#if (__ARM_ARCH >= 6) will not be true if __ARM_ARCH is not defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just briefly glimpsed in the code again: There's code specific for __ARM_ARCH >= 6 and code for __ARM_ARCH. The latter of which includes the return statement. It's not possible to combine these into a single check.
Maybe the first check should be altered to #if (__ARM_ARCH >= 3) to be more in line with the origianl version. But since I don't know where or when the original ARMV3 would appear I just leave it this way.

@pphaneuf
Copy link
Contributor

Could you take a look at the instructions in the CONTRIBUTING.md file regarding the contributor license agreement? I couldn't find you in either the CONTRIBUTORS, AUTHORS, or our internal list of agreement signatories.

Thanks!

@showlabor
Copy link
Contributor Author

@pphaneuf: I just signed the individual CLA electronically. I don't know how long it will take to process.

@ckennelly
Copy link
Contributor

@showlabor Add a commit to this pull request adding yourself to the AUTHORS and CONTRIBUTORS file (see #10 for an example) and one of us can go ahead and merge this.

@showlabor
Copy link
Contributor Author

@ckennelly I had just been at it ;-)

@pphaneuf
Copy link
Contributor

@showlabor Thanks, I just confirmed that your electronic signature is registered correctly!

I'm just around for this kind of verification, I'll let @dominichamon finish the code review and merge in the pull request as appropriate.

dmah42 pushed a commit that referenced this pull request Mar 20, 2014
Fix cycleclock.h for gcc/ARM.
@dmah42 dmah42 merged commit ef1ccf4 into google:master Mar 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants