36 #ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
40 #if defined( __CC_ARM ) || defined( __ARMCC__ )
42 #define FT_MULFIX_ASSEMBLER FT_MulFix_arm
46 static __inline FT_Int32
47 FT_MulFix_arm( FT_Int32
a,
71 #if defined( __arm__ ) && \
72 ( !defined( __thumb__ ) || defined( __thumb2__ ) ) && \
73 !( defined( __CC_ARM ) || defined( __ARMCC__ ) )
75 #define FT_MULFIX_ASSEMBLER FT_MulFix_arm
79 static __inline__ FT_Int32
80 FT_MulFix_arm( FT_Int32
a,
86 __asm__ __volatile__ (
87 "smull %1, %2, %4, %3\n\t"
88 "mov %0, %2, asr #31\n\t"
89 #
if defined( __clang__ ) && defined( __thumb2__ )
90 "add.w %0, %0, #0x8000\n\t"
92 "add %0, %0, #0x8000\n\t"
96 "mov %0, %1, lsr #16\n\t"
97 "orr %0, %0, %2, lsl #16\n\t"
98 :
"=r"(
a),
"=&r"(
t2),
"=&r"(
t)
109 #if defined( __i386__ )
111 #define FT_MULFIX_ASSEMBLER FT_MulFix_i386
115 static __inline__ FT_Int32
116 FT_MulFix_i386( FT_Int32
a,
122 __asm__ __volatile__ (
124 "movl %%edx, %%ecx\n"
126 "addl $0x8000, %%ecx\n"
127 "addl %%ecx, %%eax\n"
131 "addl %%edx, %%eax\n"
147 #define FT_MULFIX_ASSEMBLER FT_MulFix_i386
151 static __inline FT_Int32
152 FT_MulFix_i386( FT_Int32
a,
180 #if defined( __GNUC__ ) && defined( __x86_64__ )
182 #define FT_MULFIX_ASSEMBLER FT_MulFix_x86_64
184 static __inline__ FT_Int32
185 FT_MulFix_x86_64( FT_Int32
a,
190 #if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )
191 #pragma GCC diagnostic push
192 #pragma GCC diagnostic ignored "-Wlong-long"
201 ret = (
long long)
a *
b;
205 return (FT_Int32)(
ret >> 16 );
214 long long wide_a = (
long long)
a;
215 long long wide_b = (
long long)
b;
219 __asm__ __volatile__ (
223 "lea 0x8000(%1, %0), %0\n"
225 :
"=&r"(
result),
"=&r"(wide_a)
232 #if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )
233 #pragma GCC diagnostic pop
242 #ifdef FT_CONFIG_OPTION_INLINE_MULFIX
243 #ifdef FT_MULFIX_ASSEMBLER
244 #define FT_MulFix( a, b ) FT_MULFIX_ASSEMBLER( (FT_Int32)(a), (FT_Int32)(b) )
360 #ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
362 #if defined( __GNUC__ ) && \
363 ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) )
365 #if FT_SIZEOF_INT == 4
367 #define FT_MSB( x ) ( 31 - __builtin_clz( x ) )
369 #elif FT_SIZEOF_LONG == 4
371 #define FT_MSB( x ) ( 31 - __builtin_clzl( x ) )
376 #elif defined( _MSC_VER ) && ( _MSC_VER >= 1400 )
378 #if FT_SIZEOF_INT == 4
381 #pragma intrinsic( _BitScanReverse )
383 static __inline FT_Int32
384 FT_MSB_i386( FT_UInt32
x )
389 _BitScanReverse( &where,
x );
391 return (FT_Int32)where;
394 #define FT_MSB( x ) ( FT_MSB_i386( x ) )
441 FT_SqrtFixed( FT_Int32
x );
446 #define INT_TO_F26DOT6( x ) ( (FT_Long)(x) * 64 )
447 #define INT_TO_F2DOT14( x ) ( (FT_Long)(x) * 16384 )
448 #define INT_TO_FIXED( x ) ( (FT_Long)(x) * 65536 )
449 #define F2DOT14_TO_FIXED( x ) ( (FT_Long)(x) * 4 )
450 #define FIXED_TO_INT( x ) ( FT_RoundFix( x ) >> 16 )
452 #define ROUND_F26DOT6( x ) ( ( (x) + 32 - ( x < 0 ) ) & -64 )
463 #define ADD_INT( a, b ) \
464 (FT_Int)( (FT_UInt)(a) + (FT_UInt)(b) )
465 #define SUB_INT( a, b ) \
466 (FT_Int)( (FT_UInt)(a) - (FT_UInt)(b) )
467 #define MUL_INT( a, b ) \
468 (FT_Int)( (FT_UInt)(a) * (FT_UInt)(b) )
469 #define NEG_INT( a ) \
470 (FT_Int)( (FT_UInt)0 - (FT_UInt)(a) )
472 #define ADD_LONG( a, b ) \
473 (FT_Long)( (FT_ULong)(a) + (FT_ULong)(b) )
474 #define SUB_LONG( a, b ) \
475 (FT_Long)( (FT_ULong)(a) - (FT_ULong)(b) )
476 #define MUL_LONG( a, b ) \
477 (FT_Long)( (FT_ULong)(a) * (FT_ULong)(b) )
478 #define NEG_LONG( a ) \
479 (FT_Long)( (FT_ULong)0 - (FT_ULong)(a) )
481 #define ADD_INT32( a, b ) \
482 (FT_Int32)( (FT_UInt32)(a) + (FT_UInt32)(b) )
483 #define SUB_INT32( a, b ) \
484 (FT_Int32)( (FT_UInt32)(a) - (FT_UInt32)(b) )
485 #define MUL_INT32( a, b ) \
486 (FT_Int32)( (FT_UInt32)(a) * (FT_UInt32)(b) )
487 #define NEG_INT32( a ) \
488 (FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) )
492 #define ADD_INT64( a, b ) \
493 (FT_Int64)( (FT_UInt64)(a) + (FT_UInt64)(b) )
494 #define SUB_INT64( a, b ) \
495 (FT_Int64)( (FT_UInt64)(a) - (FT_UInt64)(b) )
496 #define MUL_INT64( a, b ) \
497 (FT_Int64)( (FT_UInt64)(a) * (FT_UInt64)(b) )
498 #define NEG_INT64( a ) \
499 (FT_Int64)( (FT_UInt64)0 - (FT_UInt64)(a) )
ft_corner_is_flat(FT_Pos in_x, FT_Pos in_y, FT_Pos out_x, FT_Pos out_y)
FT_BEGIN_HEADER FT_MulDiv_No_Round(FT_Long a, FT_Long b, FT_Long c)
FT_Vector_NormLen(FT_Vector *vector)
FT_Vector_Transform_Scaled(FT_Vector *vector, const FT_Matrix *matrix, FT_Long scaling)
FT_Matrix_Multiply_Scaled(const FT_Matrix *a, FT_Matrix *b, FT_Long scaling)
FT_Matrix_Check(const FT_Matrix *matrix)
FT_Hypot(FT_Fixed x, FT_Fixed y)
ft_corner_orientation(FT_Pos in_x, FT_Pos in_y, FT_Pos out_x, FT_Pos out_y)
FT_BEGIN_HEADER typedef signed long FT_Pos
FT_BEGIN_HEADER typedef unsigned char FT_Bool
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld endif[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld SRC pixld MASK if DST_R else pixld DST_R endif if
GLboolean GLboolean GLboolean b
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLfloat GLfloat GLfloat GLfloat h
void add(int &result, const int &sum)