alexjbest / ajs Goto Github PK
View Code? Open in Web Editor NEWAsmjit superoptimiser
Asmjit superoptimiser
For example
add %rax,%rbx
adc %rcx,%rdx
add %r8,%r9
ret
should also have a valid reordering with the 3rd line at the start, but currently this is not possible as there is a dependency chain.
Should be possible for tryPerms
to be parallelised for quicker optimisation.
Useful for doing bulk testing runs (without getting stuck on popcount
...)
lea %rax,(%rax,2)
inc %rax
For example
add $1,%rax
add $1,%rbx
add $1,%rcx
jnc end
end:
ret
should have two rearrangements.
by incrementing indices rather than recalculating
For example in mpn/store there is lea lp(%rax)
.
Or use some existing library one
For example div instructions probably have some
So that changing them will cause make to remake things (useful for asmjit options)
Otherwise these can tend to accumulate when automatically adding global definitions
Make the output have original label names, as opposed to L1
, L2
, etc.
This will require changes to alexjbest/asmjit also
g++ -c -I. -I/home/x/asmjit/src/ -I/home/x/sources/gmp-6.1.1/ -I/home/x/build/gmp-6.1.1/ -o line.o line.cpp -g -O2 --std=c++0x -Wall
In file included from line.cpp:2:0:
line.h:32:26: error: ‘kInstIdNone’ is not a member of ‘asmjit’
Line(uint32_t inst = asmjit::kInstIdNone):
^~~~~~
line.h: In constructor ‘Line::Line(uint32_t)’:
line.h:34:14: error: ‘noOperand’ is not a member of ‘asmjit’
ops({asmjit::noOperand, asmjit::noOperand, asmjit::noOperand}),
^~~~~~
line.h:34:33: error: ‘noOperand’ is not a member of ‘asmjit’
ops({asmjit::noOperand, asmjit::noOperand, asmjit::noOperand}),
^~~~~~
line.h:34:52: error: ‘noOperand’ is not a member of ‘asmjit’
ops({asmjit::noOperand, asmjit::noOperand, asmjit::noOperand}),
^~~~~~
line.h:41:46: error: invalid initializer for array member ‘asmjit::Operand Line::ops [4]’
regsOut(std::vector<asmjit::X86Reg>()) {
^
line.cpp: In member function ‘int Line::isInstruction() const’:
line.cpp:59:25: error: ‘kInstIdNone’ is not a member of ‘asmjit’
return instruction != asmjit::kInstIdNone;
^~~~~~
line.cpp: In member function ‘int Line::isLabel() const’:
line.cpp:63:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
return label != -1;
~~~~~~^~~~~
line.cpp: In member function ‘void Line::setLabel(uint32_t)’:
line.cpp:94:17: error: ‘kInstIdNone’ is not a member of ‘asmjit’
instruction = asmjit::kInstIdNone;
^~~~~~
line.cpp: In member function ‘void Line::setAlign(uint8_t)’:
line.cpp:101:17: error: ‘kInstIdNone’ is not a member of ‘asmjit’
instruction = asmjit::kInstIdNone;
^~~~~~
line.cpp: In member function ‘void Line::setByte(uint8_t)’:
line.cpp:108:17: error: ‘kInstIdNone’ is not a member of ‘asmjit’
instruction = asmjit::kInstIdNone;
^~~~~~
line.cpp: In member function ‘void Line::addRegIn(asmjit::X86Reg)’:
line.cpp:122:11: error: ‘X86GpReg’ is not a member of ‘asmjit’
reg = asmjit::X86GpReg(asmjit::kX86RegTypeGpq, reg.getRegIndex(), 8);
^~~~~~
line.cpp:122:28: error: ‘kX86RegTypeGpq’ is not a member of ‘asmjit’
reg = asmjit::X86GpReg(asmjit::kX86RegTypeGpq, reg.getRegIndex(), 8);
^~~~~~
line.cpp:122:56: error: ‘class asmjit::X86Reg’ has no member named ‘getRegIndex’
reg = asmjit::X86GpReg(asmjit::kX86RegTypeGpq, reg.getRegIndex(), 8);
^~~~~~~~~~~
line.cpp:125:11: error: ‘X86ZmmReg’ is not a member of ‘asmjit’
reg = asmjit::X86ZmmReg(asmjit::kX86RegTypeZmm, reg.getRegIndex(), 64);
^~~~~~
line.cpp:125:29: error: ‘kX86RegTypeZmm’ is not a member of ‘asmjit’
reg = asmjit::X86ZmmReg(asmjit::kX86RegTypeZmm, reg.getRegIndex(), 64);
^~~~~~
line.cpp:125:57: error: ‘class asmjit::X86Reg’ has no member named ‘getRegIndex’
reg = asmjit::X86ZmmReg(asmjit::kX86RegTypeZmm, reg.getRegIndex(), 64);
^~~~~~~~~~~
line.cpp: In member function ‘void Line::addRegOut(asmjit::X86Reg)’:
line.cpp:132:11: error: ‘X86GpReg’ is not a member of ‘asmjit’
reg = asmjit::X86GpReg(asmjit::kX86RegTypeGpq, reg.getRegIndex(), 8);
^~~~~~
line.cpp:132:28: error: ‘kX86RegTypeGpq’ is not a member of ‘asmjit’
reg = asmjit::X86GpReg(asmjit::kX86RegTypeGpq, reg.getRegIndex(), 8);
^~~~~~
line.cpp:132:56: error: ‘class asmjit::X86Reg’ has no member named ‘getRegIndex’
reg = asmjit::X86GpReg(asmjit::kX86RegTypeGpq, reg.getRegIndex(), 8);
^~~~~~~~~~~
line.cpp:135:11: error: ‘X86ZmmReg’ is not a member of ‘asmjit’
reg = asmjit::X86ZmmReg(asmjit::kX86RegTypeZmm, reg.getRegIndex(), 64);
^~~~~~
line.cpp:135:29: error: ‘kX86RegTypeZmm’ is not a member of ‘asmjit’
reg = asmjit::X86ZmmReg(asmjit::kX86RegTypeZmm, reg.getRegIndex(), 64);
^~~~~~
line.cpp:135:57: error: ‘class asmjit::X86Reg’ has no member named ‘getRegIndex’
reg = asmjit::X86ZmmReg(asmjit::kX86RegTypeZmm, reg.getRegIndex(), 64);
^~~~~~~~~~~
Makefile:44: recipe for target 'line.o' failed
make: *** [line.o] Error 1
I.e. inc %rax
and mov (%rax),%rbx
should be swappable, but with the second instruction changing.
I.e. for sub_n
we have lea rdi,[rdi+(8*(1 << 4))]
.
This may or may not be useful.
Could be used to determine if dependencies are real or not e.g.
mov $1,%rax
mov $2,%rax
ret
can be rearranged if %rax
is not part of the output.
This is broken for (at least) intel syntax mode
Such as:
E.g. binary
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.