aboutsummaryrefslogtreecommitdiffstats
path: root/capstone/suite/synctools/arm64_gen_vreg.c
blob: 9b7a9383516642ba55561665577a0cdc7edb294d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// $ make arm64_gen_vreg 
// $ ./arm64_gen_vreg > AArch64GenRegisterV.inc

#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <ctype.h>

#undef CAPSTONE_DIET
#define GET_REGINFO_ENUM

#include "AArch64GenRegisterInfo.inc"
#include "AArch64GenRegisterName.inc"

int main()
{
	unsigned int i;
	size_t size = (size_t)getRegisterName(i, 100);

	printf("// size = %zu\n", size);

	for(i = 1; i < size; i++) {
		unsigned int j;
		const char *name = getRegisterName(i, AArch64_vreg);
		//printf("%u: ARM64_REG_%s, ", i, getRegisterName(i, AArch64_vreg));
		if (strlen(name) == 0) {
			printf("0,\n");
		} else {
			printf("ARM64_REG_");
			for(j = 0; j < strlen(name); j++) {
				printf("%c", toupper(name[j]));
			}
			printf(",\n");
		}
	}

	return 0;
}