freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 311764f: Additional `FT_MSB` macro definitions.


From: Werner Lemberg
Subject: [freetype2] master 311764f: Additional `FT_MSB` macro definitions.
Date: Fri, 1 Oct 2021 11:53:25 -0400 (EDT)

branch: master
commit 311764fabbd9a1e2bcd2cf6a2f557cb3ff4e832b
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    Additional `FT_MSB` macro definitions.
    
    * include/freetype/internal/ftcalc.h [__DECC,_CRAYC]: Use builtins
    and intrinsics.
---
 include/freetype/internal/ftcalc.h | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/include/freetype/internal/ftcalc.h 
b/include/freetype/internal/ftcalc.h
index f249307..a0f6890 100644
--- a/include/freetype/internal/ftcalc.h
+++ b/include/freetype/internal/ftcalc.h
@@ -370,8 +370,7 @@ FT_BEGIN_HEADER
 
 #define FT_MSB( x )  ( 31 - __builtin_clzl( x ) )
 
-#endif /* __GNUC__ */
-
+#endif
 
 #elif defined( _MSC_VER ) && ( _MSC_VER >= 1400 )
 
@@ -395,11 +394,23 @@ FT_BEGIN_HEADER
 
 #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
 
   FT_BASE( FT_Int )



reply via email to

[Prev in Thread] Current Thread [Next in Thread]