yzhikan / libyuv

Automatically exported from code.google.com/p/libyuv
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

neon detect for aarch64 #361

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
arm64 has no __ARM__ macro for some compilers, and /proc/cpuinfo does not have 
neon

genericarmv8:~$ more /proc/cpuinfo
Processor   : AArch64 Processor rev 0 (aarch64)
processor   : 0
processor   : 1
processor   : 2
processor   : 3
processor   : 4
processor   : 5
Features    : fp asimd evtstrm aes pmull sha1 sha2 crc32 
CPU implementer : 0x41
CPU architecture: AArch64
CPU variant : 0x0
CPU part    : 0xd07
CPU revision    : 0

Hardware    : Juno

Fix cpu detection code and/or ifdefs

Original issue reported on code.google.com by fbarch...@chromium.org on 18 Sep 2014 at 12:50

GoogleCodeExporter commented 9 years ago
AArch64 Procedure calling standard (aapcs64) mandates all AArch64 CPUs to have 
NEON. Hence NEON can always be enabled in AArch64.

Original comment by ashok.b...@gmail.com on 18 Sep 2014 at 3:43

GoogleCodeExporter commented 9 years ago
A quick test program on juno finds arm macro not detected

genericarmv8:~$ ./cpumacro
sizeof(INT64_C(0)) 8
sizeof long 8
sizeof long long 8
sizeof 0LL 8
__GNUC__ 4
not an x86 or arm compiler
__MMX__
__BYTE_ORDER__ 1234

Original comment by fbarch...@google.com on 19 Sep 2014 at 11:14

GoogleCodeExporter commented 9 years ago
Note: Google Test filter = **Neon*
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from libyuvTest
[ RUN      ] libyuvTest.TestLinuxNeon
d:\src\libyuv\trunk\unit_test\cpu_test.cc(129): error: Value of: 
ArmCpuCaps("../../unit_test/testdata/juno.txt")
  Actual: 0
Expected: kCpuHasNEON
Which is: 4
[  FAILED  ] libyuvTest.TestLinuxNeon (2 ms)
[----------] 1 test from libyuvTest (4 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (12 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] libyuvTest.TestLinuxNeon

 1 FAILED TEST
  YOU HAVE 1 DISABLED TEST

Original comment by fbarch...@google.com on 22 Sep 2014 at 6:01

GoogleCodeExporter commented 9 years ago
Fixed in r1088
d:\src\libyuv\trunk\out\Release>.\libyuv_unittest --gtest_filter=**Neon*
Note: Google Test filter = **Neon*
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from libyuvTest
[ RUN      ] libyuvTest.TestLinuxNeon
[       OK ] libyuvTest.TestLinuxNeon (0 ms)
[----------] 1 test from libyuvTest (4 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (13 ms total)
[  PASSED  ] 1 test.

Original comment by fbarch...@google.com on 22 Sep 2014 at 6:33