11/* Automatically generated by
2- SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.3699 uuid: 2952dbcc-35c1-4c63-8bf1-bfac32f0e33d
3- (Compiler-eem.526 )
2+ SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.3721 uuid: f3895c70-5b57-4684-92f6-72aee920c70e
3+ (Compiler-eem.527 )
44 from
5- BitBltSimulation VMMaker.oscog-eem.3699 uuid: 2952dbcc-35c1-4c63-8bf1-bfac32f0e33d
5+ BitBltSimulation VMMaker.oscog-eem.3721 uuid: f3895c70-5b57-4684-92f6-72aee920c70e
66 */
7- static char __buildInfo [] = "BitBltSimulation VMMaker.oscog-eem.3699 uuid: 2952dbcc-35c1-4c63-8bf1-bfac32f0e33d " __DATE__ ;
7+ static char __buildInfo [] = "BitBltSimulation VMMaker.oscog-eem.3721 uuid: f3895c70-5b57-4684-92f6-72aee920c70e " __DATE__ ;
88
99
1010#include "config.h"
@@ -132,6 +132,9 @@ static unsigned int partitionedAddtonBitscomponentMaskcarryOverflowMask(unsigned
132132static unsigned int partitionedANDtonBitsnPartitions (unsigned int word1 , unsigned int word2 , sqInt nBits , sqInt nParts );
133133static unsigned int partitionedMaxwithnBitsnPartitions (unsigned int word1 , unsigned int word2 , sqInt nBits , sqInt nParts );
134134static unsigned int partitionedMinwithnBitsnPartitions (unsigned int word1 , unsigned int word2 , sqInt nBits , sqInt nParts );
135+ #if RGBMul32BitFallBack
136+ static unsigned int partitionedMulwithnBitsnPartitions (unsigned int word1 , unsigned int word2 , sqInt nBits , sqInt nParts );
137+ #endif /* RGBMul32BitFallBack */
135138static unsigned int partitionedMulwithnBitswordBits (unsigned int word1 , unsigned int word2 , sqInt nBits , sqInt wordBits );
136139static unsigned int partitionedSubfromnBitsnPartitions (unsigned int word1 , unsigned int word2 , sqInt nBits , sqInt nParts );
137140static unsigned int pixClearwith (unsigned int sourceWord , unsigned int destinationWord );
@@ -346,7 +349,7 @@ static int maskTable[33] = {
3463490 , 1 , 3 , 0 , 15 , 31 , 0 , 0 , 255 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 65535 ,
3473500 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , -1
348351};
349- static const char * moduleName = "BitBltPlugin VMMaker.oscog-eem.3699 " INT_EXT ;
352+ static const char * moduleName = "BitBltPlugin VMMaker.oscog-eem.3721 " INT_EXT ;
350353static sqInt noHalftone ;
351354static sqInt noSource ;
352355static sqInt numGCsOnInvocation ;
@@ -4065,6 +4068,52 @@ partitionedMinwithnBitsnPartitions(unsigned int word1, unsigned int word2, sqInt
40654068}
40664069
40674070
4071+ /* Multiply word1 with word2 as nParts partitions of nBits each.
4072+ This is useful for packed pixels, or packed colors.
4073+ Bug in loop version when non-white background */
4074+ /* In C, integer multiplication might answer a wrong value if the unsigned
4075+ values are declared as signed.
4076+ This problem does not affect this method, because the most significant bit
4077+ (i.e. the sign bit) will
4078+ always be zero (jmv)
4079+ */
4080+
4081+ /* BitBltSimulation>>#partitionedMul:with:nBits:nPartitions: */
4082+ #if RGBMul32BitFallBack
4083+ static unsigned int
4084+ partitionedMulwithnBitsnPartitions (unsigned int word1 , unsigned int word2 , sqInt nBits , sqInt nParts )
4085+ {
4086+ unsigned int dMask ;
4087+ unsigned int product ;
4088+ unsigned int result ;
4089+ unsigned int sMask ;
4090+
4091+ /* partition mask starts at the right */
4092+ sMask = maskTable [nBits ];
4093+ dMask = (((usqInt )(sMask ) << nBits ));
4094+
4095+ /* optimized first step */
4096+ result = ((usqInt )((((((word1 & sMask ) + 1 ) * ((word2 & sMask ) + 1 )) - 1 ) & dMask ))) >> nBits ;
4097+ if (nParts == 1 ) {
4098+ return result ;
4099+ }
4100+ product = (((((((usqInt )(word1 )) >> nBits ) & sMask ) + 1 ) * (((((usqInt )(word2 )) >> nBits ) & sMask ) + 1 )) - 1 ) & dMask ;
4101+ result = result | product ;
4102+ if (nParts == 2 ) {
4103+ return result ;
4104+ }
4105+ product = (((((((usqInt )(word1 )) >> (2 * nBits )) & sMask ) + 1 ) * (((((usqInt )(word2 )) >> (2 * nBits )) & sMask ) + 1 )) - 1 ) & dMask ;
4106+ result = result | ((((usqInt )(product ) << nBits )));
4107+ if (nParts == 3 ) {
4108+ return result ;
4109+ }
4110+ product = (((((((usqInt )(word1 )) >> (3 * nBits )) & sMask ) + 1 ) * (((((usqInt )(word2 )) >> (3 * nBits )) & sMask ) + 1 )) - 1 ) & dMask ;
4111+ result = result | ((((usqInt )(product ) << (2 * nBits ))));
4112+ return result ;
4113+ }
4114+ #endif /* RGBMul32BitFallBack */
4115+
4116+
40684117/* Multiply each channel of nBits in word1 and word2.
40694118 We assume that for each channel of nBits, we multiply ratios in interval
40704119 [0..1], scaled by (1 << nBits - 1).
@@ -5877,6 +5926,21 @@ rgbMinwith(unsigned int sourceWord, unsigned int destinationWord)
58775926static unsigned int
58785927rgbMulwith (unsigned int sourceWord , unsigned int destinationWord )
58795928{
5929+
5930+ # if RGBMul32BitFallBack
5931+ if (destDepth < 16 ) {
5932+ /* Mul each pixel separately */
5933+ return partitionedMulwithnBitsnPartitions (sourceWord , destinationWord , destDepth , destPPW );
5934+ }
5935+ if (destDepth == 16 ) {
5936+ /* Mul RGB components of each pixel separately */
5937+ return (partitionedMulwithnBitsnPartitions (sourceWord , destinationWord , 5 , 3 )) + ((((usqInt )((partitionedMulwithnBitsnPartitions (((usqInt )(sourceWord )) >> 16 , ((usqInt )(destinationWord )) >> 16 , 5 , 3 ))) << 16 )));
5938+ }
5939+ else {
5940+ /* Mul RGBA components of the pixel separately */
5941+ return partitionedMulwithnBitsnPartitions (sourceWord , destinationWord , 8 , 4 );
5942+ }
5943+ # else // RGBMul32BitFallBack
58805944 if (destDepth < 16 ) {
58815945 /* Mul each pixel separately */
58825946 if (destDepth == 1 ) {
@@ -5892,6 +5956,7 @@ rgbMulwith(unsigned int sourceWord, unsigned int destinationWord)
58925956 /* Mul RGBA components of the pixel separately */
58935957 return partitionedMulwithnBitswordBits (sourceWord , destinationWord , 8 , 32 );
58945958 }
5959+ # endif // RGBMul32BitFallBack
58955960}
58965961
58975962 /* BitBltSimulation>>#rgbSub:with: */
0 commit comments