ref: 311764fabbd9a1e2bcd2cf6a2f557cb3ff4e832b
parent: 68fae526c447f646df0a4058fd5bc651eb38ce71
author: Alexei Podtelezhnikov <[email protected]>
date: Fri Oct 1 07:50:12 EDT 2021
Additional `FT_MSB` macro definitions. * include/freetype/internal/ftcalc.h [__DECC,_CRAYC]: Use builtins and intrinsics.
--- a/include/freetype/internal/ftcalc.h
+++ b/include/freetype/internal/ftcalc.h
@@ -370,9 +370,8 @@
#define FT_MSB( x ) ( 31 - __builtin_clzl( x ) )
-#endif /* __GNUC__ */
+#endif
-
#elif defined( _MSC_VER ) && ( _MSC_VER >= 1400 )
#if FT_SIZEOF_INT == 4
@@ -395,10 +394,22 @@
#endif
-#endif /* _MSC_VER */
+#elif defined( __DECC ) || defined( __DECCXX )
+#include <builtins.h>
+#define FT_MSB( x ) (FT_Int)( 63 - _leadz( x ) )
+
+#elif defined( _CRAYC )
+
+#include <intrinsics.h>
+
+#define FT_MSB( x ) (FT_Int)( 31 - _leadz32( x ) )
+
+#endif /* FT_MSB macro definitions */
+
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
+
#ifndef FT_MSB