mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-17 12:34:35 +03:00
[ABI] Added CpuFeatures to Target and CodeHolder, improved test_perf
This commit is contained in:
@@ -645,42 +645,50 @@ static void benchmarkA64Function(Arch arch, uint32_t numIterations, const char*
|
||||
CodeHolder code;
|
||||
printf("%s:\n", description);
|
||||
|
||||
bench<a64::Assembler>(code, arch, numIterations, "[raw]", [&](a64::Assembler& cc) {
|
||||
uint32_t instCount = 0;
|
||||
|
||||
#ifndef ASMJIT_NO_BUILDER
|
||||
instCount = asmjit_perf_utils::calculateInstructionCount<a64::Builder>(code, arch, [&](a64::Builder& cc) {
|
||||
emitterFn(cc, false);
|
||||
});
|
||||
#endif
|
||||
|
||||
asmjit_perf_utils::bench<a64::Assembler>(code, arch, numIterations, "[raw]", instCount, [&](a64::Assembler& cc) {
|
||||
emitterFn(cc, false);
|
||||
});
|
||||
|
||||
bench<a64::Assembler>(code, arch, numIterations, "[validated]", [&](a64::Assembler& cc) {
|
||||
asmjit_perf_utils::bench<a64::Assembler>(code, arch, numIterations, "[validated]", instCount, [&](a64::Assembler& cc) {
|
||||
cc.addDiagnosticOptions(DiagnosticOptions::kValidateAssembler);
|
||||
emitterFn(cc, false);
|
||||
});
|
||||
|
||||
bench<a64::Assembler>(code, arch, numIterations, "[prolog/epilog]", [&](a64::Assembler& cc) {
|
||||
asmjit_perf_utils::bench<a64::Assembler>(code, arch, numIterations, "[prolog/epilog]", instCount, [&](a64::Assembler& cc) {
|
||||
cc.addDiagnosticOptions(DiagnosticOptions::kValidateAssembler);
|
||||
emitterFn(cc, true);
|
||||
});
|
||||
|
||||
#ifndef ASMJIT_NO_BUILDER
|
||||
bench<a64::Builder>(code, arch, numIterations, "[no-asm]", [&](a64::Builder& cc) {
|
||||
asmjit_perf_utils::bench<a64::Builder>(code, arch, numIterations, "[no-asm]", instCount, [&](a64::Builder& cc) {
|
||||
emitterFn(cc, false);
|
||||
});
|
||||
|
||||
bench<a64::Builder>(code, arch, numIterations, "[finalized]", [&](a64::Builder& cc) {
|
||||
asmjit_perf_utils::bench<a64::Builder>(code, arch, numIterations, "[finalized]", instCount, [&](a64::Builder& cc) {
|
||||
emitterFn(cc, false);
|
||||
cc.finalize();
|
||||
});
|
||||
|
||||
bench<a64::Builder>(code, arch, numIterations, "[prolog/epilog]", [&](a64::Builder& cc) {
|
||||
asmjit_perf_utils::bench<a64::Builder>(code, arch, numIterations, "[prolog/epilog]", instCount, [&](a64::Builder& cc) {
|
||||
emitterFn(cc, true);
|
||||
cc.finalize();
|
||||
});
|
||||
#endif
|
||||
|
||||
#ifndef ASMJIT_NO_COMPILER
|
||||
bench<a64::Compiler>(code, arch, numIterations, "[no-asm]", [&](a64::Compiler& cc) {
|
||||
asmjit_perf_utils::bench<a64::Compiler>(code, arch, numIterations, "[no-asm]", instCount, [&](a64::Compiler& cc) {
|
||||
emitterFn(cc, true);
|
||||
});
|
||||
|
||||
bench<a64::Compiler>(code, arch, numIterations, "[finalized]", [&](a64::Compiler& cc) {
|
||||
asmjit_perf_utils::bench<a64::Compiler>(code, arch, numIterations, "[finalized]", instCount, [&](a64::Compiler& cc) {
|
||||
emitterFn(cc, true);
|
||||
cc.finalize();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user