22// This software is released under the 2-Clause BSD license, included
33// below.
44//
5- // Copyright (c) 2019, Aous Naman
5+ // Copyright (c) 2019, Aous Naman
66// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
77// Copyright (c) 2019, The University of New South Wales, Australia
8- //
8+ //
99// Redistribution and use in source and binary forms, with or without
1010// modification, are permitted provided that the following conditions are
1111// met:
12- //
12+ //
1313// 1. Redistributions of source code must retain the above copyright
1414// notice, this list of conditions and the following disclaimer.
15- //
15+ //
1616// 2. Redistributions in binary form must reproduce the above copyright
1717// notice, this list of conditions and the following disclaimer in the
1818// documentation and/or other materials provided with the distribution.
19- //
19+ //
2020// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
2121// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2222// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
8484 #else
8585 #define OJPH_ARCH_PPC
8686 #endif
87- #else
87+ #else
8888 #define OJPH_ARCH_UNKNOWN
8989#endif
9090
@@ -188,9 +188,9 @@ namespace ojph {
188188 #endif
189189 }
190190
191- // ///////////////////////////////////////////////////////////////////////////
191+ // ///////////////////////////////////////////////////////////////////////////
192192#ifdef OJPH_COMPILER_MSVC
193- #if (defined OJPH_ARCH_X86_64)
193+ #if (defined OJPH_ARCH_X86_64 || defined OJPH_ARCH_ARM )
194194 #pragma intrinsic(_BitScanReverse64)
195195 #elif (defined OJPH_ARCH_I386)
196196 #pragma intrinsic(_BitScanReverse)
@@ -202,7 +202,7 @@ namespace ojph {
202202 {
203203 #ifdef OJPH_COMPILER_MSVC
204204 unsigned long result = 0 ;
205- #ifdef OJPH_ARCH_X86_64
205+ #if (defined OJPH_ARCH_X86_64) || (defined OJPH_ARCH_ARM)
206206 _BitScanReverse64 (&result, val);
207207 #elif (defined OJPH_ARCH_I386)
208208 ui32 msb = (ui32)(val >> 32 ), lsb = (ui32)val;
@@ -227,7 +227,7 @@ namespace ojph {
227227 val |= (val >> 32 );
228228 return 64 - population_count64 (val);
229229 #endif
230- }
230+ }
231231
232232 // ///////////////////////////////////////////////////////////////////////////
233233#ifdef OJPH_COMPILER_MSVC
0 commit comments