Merge branch 'blender-v3.1-release'

This commit is contained in:
Sergey Sharybin 2022-02-11 15:36:05 +01:00
commit 41ef1ac2da
1 changed files with 7 additions and 1 deletions

View File

@ -935,9 +935,15 @@ ccl_device_inline uint prev_power_of_two(uint x)
ccl_device_inline uint32_t reverse_integer_bits(uint32_t x)
{
/* Use a native instruction if it exists. */
#if defined(__arm__) || defined(__aarch64__)
#if defined(__aarch64__) || defined(_M_ARM64)
/* Assume the rbit is always available on 64bit ARM architecture. */
__asm__("rbit %w0, %w1" : "=r"(x) : "r"(x));
return x;
#elif defined(__arm__) && ((__ARM_ARCH > 7) || __ARM_ARCH == 6 && __ARM_ARCH_ISA_THUMB >= 2)
/* This ARM instruction is available in ARMv6T2 and above.
* This 32-bit Thumb instruction is available in ARMv6T2 and above. */
__asm__("rbit %0, %1" : "=r"(x) : "r"(x));
return x;
#elif defined(__KERNEL_CUDA__)
return __brev(x);
#elif defined(__KERNEL_METAL__)