这是Skyeye 0.9 版本的源代码

源代码在线查看: arm2x86_mul.c

软件大小: 373 K
上传用户: liyueyuan2011
关键词: Skyeye 0.9 版本 源代码
下载地址: 免注册下载 普通下载 VIP

相关代码

				#include "armdefs.h"
				#include "arm2x86_self.h"
				
				uint8_t *
				get_op_mul_T0_T1(int *len)
				{
					unsigned int	begin=0, end=0;
				
					OP_BEGIN("get_op_mul_T0_T1");
					T0 = T0 * T1;
					OP_END("get_op_mul_T0_T1");
					*len = end - begin;
				
					return((uint8_t *)begin);
				}
				
				uint8_t *
				get_op_umull_T0_T1(int *len)
				{
					unsigned int	begin=0, end=0;
				
					OP_BEGIN("get_op_umull_T0_T1");
					__asm__ __volatile__ ("movl	%"AREG_T0", %eax");
					__asm__ __volatile__ ("mull	%"AREG_T1);
					__asm__ __volatile__ ("movl	%eax, %"AREG_T0);
					__asm__ __volatile__ ("movl	%edx, %"AREG_T1);
					OP_END("get_op_umull_T0_T1");
					*len = end - begin;
				
					return((uint8_t *)begin);
				}
				
				uint8_t *
				get_op_smull_T0_T1(int *len)
				{
					unsigned int	begin=0, end=0;
				
					OP_BEGIN("get_op_smull_T0_T1");
					__asm__ __volatile__ ("movl	%"AREG_T0", %eax");
					__asm__ __volatile__ ("imull	%"AREG_T1);
					__asm__ __volatile__ ("movl	%eax, %"AREG_T0);
					__asm__ __volatile__ ("movl	%edx, %"AREG_T1);
					OP_END("get_op_smull_T0_T1");
					*len = end - begin;
				
					return((uint8_t *)begin);
				}
				
				op_table_t	op_mul_T0_T1;
				op_table_t	op_umull_T0_T1;
				op_table_t	op_smull_T0_T1;
				int
				arm2x86_mul_init()
				{
					op_mul_T0_T1.op = get_op_mul_T0_T1(&op_mul_T0_T1.len);
					if (op_mul_T0_T1.len 						return(-1);
				
					op_umull_T0_T1.op = get_op_umull_T0_T1(&op_umull_T0_T1.len);
					if (op_umull_T0_T1.len 						return(-1);
				
					op_smull_T0_T1.op = get_op_smull_T0_T1(&op_smull_T0_T1.len);
					if (op_smull_T0_T1.len 						return(-1);
				
					return(0);
				}
							

相关资源