seven zip源代码

源代码在线查看: branchia64.c

软件大小: 1260 K
上传用户: lwsnsfp17
关键词: seven zip 源代码
下载地址: 免注册下载 普通下载 VIP

相关代码

				/* BranchIA64.c */
				
				#include "BranchIA64.h"
				
				const Byte kBranchTable[32] = 
				{ 
				  0, 0, 0, 0, 0, 0, 0, 0,
				  0, 0, 0, 0, 0, 0, 0, 0,
				  4, 4, 6, 6, 0, 0, 7, 7,
				  4, 4, 0, 0, 4, 4, 0, 0 
				};
				
				UInt32 IA64_Convert(Byte *data, UInt32 size, UInt32 nowPos, int encoding)
				{
				  UInt32 i;
				  for (i = 0; i + 16 				  {
				    UInt32 instrTemplate = data[i] & 0x1F;
				    UInt32 mask = kBranchTable[instrTemplate];
				    UInt32 bitPos = 5;
				    int slot;
				    for (slot = 0; slot < 3; slot++, bitPos += 41)
				    {
				      UInt32 bytePos, bitRes;
				      UInt64 instruction, instNorm;
				      int j;
				      if (((mask >> slot) & 1) == 0)
				        continue;
				      bytePos = (bitPos >> 3);
				      bitRes = bitPos & 0x7;
				      instruction = 0;
				      for (j = 0; j < 6; j++)
				        instruction += (UInt64)(data[i + j + bytePos]) 				
				      instNorm = instruction >> bitRes;
				      if (((instNorm >> 37) & 0xF) == 0x5 
				        &&  ((instNorm >> 9) & 0x7) == 0 
				        /* &&  (instNorm & 0x3F)== 0 */
				        )
				      {
				        UInt32 src = (UInt32)((instNorm >> 13) & 0xFFFFF);
				        UInt32 dest;
				        src |= ((UInt32)(instNorm >> 36) & 1) 				        
				        src 				        
				        if (encoding)
				          dest = nowPos + i + src;
				        else
				          dest = src - (nowPos + i);
				        
				        dest >>= 4;
				        
				        instNorm &= ~((UInt64)(0x8FFFFF) 				        instNorm |= ((UInt64)(dest & 0xFFFFF) 				        instNorm |= ((UInt64)(dest & 0x100000) 				        
				        instruction &= (1 				        instruction |= (instNorm 				        for (j = 0; j < 6; j++)
				          data[i + j + bytePos] = (Byte)(instruction >> (8 * j));
				      }
				    }
				  }
				  return i;
				}
							

相关资源