Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make lexing ARM-friendly #21

Open
duck2 opened this issue Jul 21, 2019 · 0 comments
Open

Make lexing ARM-friendly #21

duck2 opened this issue Jul 21, 2019 · 0 comments

Comments

@duck2
Copy link
Member

duck2 commented Jul 21, 2019

The current trie lexer makes use of the fast unaligned 32/64 bit access found in amd64 architectures:

inline enum_pin_type lex_pin_type(const char *in){
	unsigned int len = strlen(in);
	switch(len){
	case 4:
		switch(*((triehash_uu32*)&in[0])){
		case onechar('O', 0, 32) | onechar('P', 8, 32) | onechar('E', 16, 32) | onechar('N', 24, 32):
			return enum_pin_type::OPEN;
[...]
}

This might run slower in other architectures. Add a knob to uxsdcxx to generate "flat" tries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant