- 授权协议: 未知
- 开发语言: C/C++
- 操作系统: 跨平台
- 软件首页: https://github.com/asmjit/asmjit
- 软件文档: https://github.com/asmjit/asmjit/blob/master/README.md
- 官方下载: https://github.com/asmjit/asmjit
软件介绍
AsmJit 是一个完整的 JIT(Just-In-Time,运行时刻)的针对 C++ 语言的汇编器,可以生成兼容 x86 和 x64 架构的原生代码,不仅支持整个 x86/x64 的指令集(包括传统的 MMX 和最新的 AVX2 指令集),而且提供了一套可以在编译时刻进行语义检查的 API。
AsmJit 的使用也没有任何的限制,适用于多媒体,虚拟机的后端,远程代码生成等等。
特性
完全支持 x86/x64 指令集(包括 MMX,SSEx,AVX1/2,BMI,XOP,FMA3 和 FMA4)
底层次和高层次的代码生成概念
内置检测处理器特性功能
实现虚拟内存的管理,类似于 malloc 和 free
强大的日志记录和错误处理能力
体积小,可直接嵌入项目,编译后的体积在150至200kb之间
独立性强,不需要依赖其他任何的库(包括 STL 和 RTTI )
环境
1. 操作系统
BSD系列
Linux
Mac
Windows
2. C++编译器
Borland C++
Clang
GCC
MinGW
MSVC
其他的在”build.h”中文件中定义过的编译器
3. 后端
X86
X64
软件简介引自:http://www.cnblogs.com/lanrenxinxin/p/5021641.html
// Create simple DWORD memory copy function for 32 bit x86 platform:
// (for AsmJit version 0.8+)
//
// void ASMJIT_CDECL memcpy32(UInt32* dst, const UInt32* src, SysUInt len);
// AsmJit library
#include <AsmJit/AsmJitAssembler.h>
#include <AsmJit/AsmJitVM.h>
// C library - printf
#include <stdio.h>
using namespace AsmJit;
// This is type of function we will generate
typedef void (*MemCpy32Fn)(UInt32*, const UInt32*, SysUInt);
int main(int argc, char* argv[])
{
// ==========================================================================
// Part 1:
// Create Assembler
Assembler a;
// Constants
const int arg_offset = 8; // Arguments offset (STDCALL EBP)
const int arg_size = 12; // Arguments size
// Labels
Label L_Loop;
Label L_Exit;
// Prolog
a.push(ebp);
a.mov(ebp, esp);
a.push(esi);
a.push(edi);
// Fetch arguments
a.mov(edi, dword_ptr(ebp, arg_offset + 0)); // get dst
a.mov(esi, dword_ptr(ebp, arg_offset + 4)); // get src
a.mov(ecx, dword_ptr(ebp, arg_offset + 8)); // get len
// exit if length is zero
a.jz(&L_Exit);
// Bind L_Loop label to here
a.bind(&L_Loop);
a.mov(eax, dword_ptr(esi));
a.mov(dword_ptr(edi), eax);
a.add(esi, 4);
a.add(edi, 4);
// Loop until ecx is not zero
a.dec(ecx);
a.jnz(&L_Loop);
// Exit
a.bind(&L_Exit);
// Epilog
a.pop(edi);
a.pop(esi);
a.mov(esp, ebp);
a.pop(ebp);
// Return
a.ret();
// ==========================================================================
// ==========================================================================
// Part 2:
// Make JIT function
MemCpy32Fn fn = function_cast<MemCpy32Fn>(a.make());
// Ensure that everything is ok
if (!fn)
{
printf("Error making jit function (%u).\n", a.error());
return 1;
}
// Create some data
UInt32 dst[128];
UInt32 src[128];
// Call JIT function
fn(dst, src, 128);
// If you don't need the function anymore, it should be freed
MemoryManager::global()->free((void*)fn);
// ==========================================================================
return 0;
}
大数据时代
[英] 维克托•迈尔•舍恩伯格(Viktor Mayer-Schönberger) / 周涛 / 浙江人民出版社 / 2012-12 / 49.90元
《大数据时代》是国外大数据研究的先河之作,本书作者维克托•迈尔•舍恩伯格被誉为“大数据商业应用第一人”,拥有在哈佛大学、牛津大学、耶鲁大学和新加坡国立大学等多个互联网研究重镇任教的经历,早在2010年就在《经济学人》上发布了长达14页对大数据应用的前瞻性研究。 维克托•迈尔•舍恩伯格在书中前瞻性地指出,大数据带来的信息风暴正在变革我们的生活、工作和思维,大数据开启了一次重大的时代转型,并用三......一起来看看 《大数据时代》 这本书的介绍吧!
