Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
jmp_table.cpp File Reference
#include <stdio.h>
#include <xbyak/xbyak.h>
Include dependency graph for jmp_table.cpp:

Go to the source code of this file.

Classes

struct  Code
 

Macros

#define XBYAK_NO_OP_NAMES
 

Functions

int main ()
 

Variables

const int expectTbl []
 

Macro Definition Documentation

◆ XBYAK_NO_OP_NAMES

#define XBYAK_NO_OP_NAMES

Definition at line 5 of file jmp_table.cpp.

Function Documentation

◆ main()

int main ( void )

Definition at line 105 of file jmp_table.cpp.

107{
108 for (int mode = 0; mode < 3; mode++) {
109 printf("mode=%d\n", mode);
110 for (int grow = 0; grow < 2; grow++) {
111 printf("auto grow=%s\n", grow ? "on" : "off");
112 Code c(mode, grow ? 30 : 4096, grow ? Xbyak::AutoGrow : 0);
113 int (*f)(int) = c.getCode<int (*)(int)>();
114 c.ready();
115 for (int i = 0; i < 3; i++) {
116 const int a = expectTbl[i];
117 const int b = f(i);
118 if (a != b) {
119 printf("ERR i=%d, a=%d, b=%d\n", i, a, b);
120 exit(1);
121 }
122 }
123 }
124 }
125 puts("ok");
126} catch (std::exception& e) {
127 printf("ERR %s\n", e.what());
128}
const int expectTbl[]
Definition jmp_table.cpp:8
LOGGING_API void printf(Category category, const char *format,...)
Definition Logging.cpp:30
void *const AutoGrow
Definition xbyak.h:788
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
Definition bench.cpp:18
Here is the call graph for this function:

Variable Documentation

◆ expectTbl

const int expectTbl[]
Initial value:
= {
5, 9, 12
}

Definition at line 8 of file jmp_table.cpp.

8 {
9 5, 9, 12
10};