Debian Codegraph @

arch/AArch64/AArch64BaseInfo.c

raw symbols SCIP
1 //===-- AArch64BaseInfo.cpp - AArch64 Base encoding information------------===//cxx . . $ `<file>/arch/AArch64/AArch64BaseInfo.c`/
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file provides basic encoding and assembly information for AArch64.
11 //
12 //===----------------------------------------------------------------------===//
13
14 /* Capstone Disassembly Engine */
15 /* By Nguyen Anh Quynh <[email protected]>, 2013-2019 */
16
17 #ifdef CAPSTONE_HAS_ARM64cxx . . $ `<built-in>:413:9`!
18
19 #if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)
20 #pragma warning(disable:4996) // disable MSVC's warning on strcpy()
21 #pragma warning(disable:28719) // disable MSVC's warning on strcpy()
22 #endif
23
24 #include "../../utils.h"cxx . . $ `<file>/utils.h`/
25
26 #include <stdio.h>
27 #include <stdlib.h>
28
29 #include "AArch64BaseInfo.h"cxx . . $ `<file>/arch/AArch64/AArch64BaseInfo.h`/
30
31 #include "AArch64GenSystemOperands.inc"cxx . . $ `<file>/arch/AArch64/AArch64GenSystemOperands.inc`/
32
33 // return a string representing the number X
34 // NOTE: result must be big enough to contain the data
35 static void utostrcxx . . $ utostr(eca333cde54c87ae).(uint64_tcxx . . $ uint64_t# X, boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! isNeg, char *result)
36 {
37 char Buffer[22];
38 char *BufPtr = Buffer + 21;
39
40 Buffer[21] = '\0';
41 if (X == 0) *--BufPtr = '0'; // Handle special case...
42
43 while (X) {
44 *--BufPtr = X % 10 + '0';
45 X /= 10;
46 }
47
48 if (isNeg) *--BufPtr = '-'; // Add negative sign...
49
50 // suppose that result is big enough
51 strncpycxx . . $ strncpy(255158a415b673b0).(result, BufPtr, sizeof(Buffer));
52 }
53
54 // NOTE: result must be big enough to contain the result
55 void AArch64SysReg_genericRegisterStringcxx . . $ AArch64SysReg_genericRegisterString(89dc35c058952b03).(uint32_tcxx . . $ uint32_t# Bits, char *result)
56 {
57 // assert(Bits < 0x10000);
58 char Op0Str[32], Op1Str[32], CRnStr[32], CRmStr[32], Op2Str[32];
59 int dummy;
60 uint32_tcxx . . $ uint32_t# Op0 = (Bits >> 14) & 0x3;
61 uint32_tcxx . . $ uint32_t# Op1 = (Bits >> 11) & 0x7;
62 uint32_tcxx . . $ uint32_t# CRn = (Bits >> 7) & 0xf;
63 uint32_tcxx . . $ uint32_t# CRm = (Bits >> 3) & 0xf;
64 uint32_tcxx . . $ uint32_t# Op2 = Bits & 0x7;
65
66 utostrcxx . . $ utostr(eca333cde54c87ae).(Op0, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!, Op0Str);
67 utostrcxx . . $ utostr(eca333cde54c87ae).(Op1, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!, Op1Str);
68 utostrcxx . . $ utostr(eca333cde54c87ae).(Op2, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!, Op2Str);
69 utostrcxx . . $ utostr(eca333cde54c87ae).(CRn, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!, CRnStr);
70 utostrcxx . . $ utostr(eca333cde54c87ae).(CRm, falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!, CRmStr);
71
72 dummy = cs_snprintfcxx . . $ cs_snprintf(ea502d73e74c754c).(result, 128, "s%s_%s_c%s_c%s_%s",
73 Op0Str, Op1Str, CRnStr, CRmStr, Op2Str);
74 (void)dummy;
75 }
76
77 #endif