File: arm64_gen_vreg.c

package info (click to toggle)
capstone 5.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie, trixie-proposed-updates
  • size: 58,188 kB
  • sloc: ansic: 96,086; cpp: 67,489; cs: 29,510; python: 25,829; pascal: 24,412; java: 15,582; ml: 14,473; makefile: 1,275; sh: 479; ruby: 386
file content (38 lines) | stat: -rw-r--r-- 766 bytes parent folder | download | duplicates (3)
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;
}