asmjit 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/Rakefile +5 -3
  4. data/asmjit.gemspec +1 -3
  5. data/ext/asmjit/asmjit/.editorconfig +10 -0
  6. data/ext/asmjit/asmjit/.github/FUNDING.yml +1 -0
  7. data/ext/asmjit/asmjit/.github/workflows/build-config.json +47 -0
  8. data/ext/asmjit/asmjit/.github/workflows/build.yml +156 -0
  9. data/ext/asmjit/asmjit/.gitignore +6 -0
  10. data/ext/asmjit/asmjit/CMakeLists.txt +611 -0
  11. data/ext/asmjit/asmjit/LICENSE.md +17 -0
  12. data/ext/asmjit/asmjit/README.md +69 -0
  13. data/ext/asmjit/asmjit/src/asmjit/a64.h +62 -0
  14. data/ext/asmjit/asmjit/src/asmjit/arm/a64archtraits_p.h +81 -0
  15. data/ext/asmjit/asmjit/src/asmjit/arm/a64assembler.cpp +5115 -0
  16. data/ext/asmjit/asmjit/src/asmjit/arm/a64assembler.h +72 -0
  17. data/ext/asmjit/asmjit/src/asmjit/arm/a64builder.cpp +51 -0
  18. data/ext/asmjit/asmjit/src/asmjit/arm/a64builder.h +57 -0
  19. data/ext/asmjit/asmjit/src/asmjit/arm/a64compiler.cpp +60 -0
  20. data/ext/asmjit/asmjit/src/asmjit/arm/a64compiler.h +247 -0
  21. data/ext/asmjit/asmjit/src/asmjit/arm/a64emithelper.cpp +464 -0
  22. data/ext/asmjit/asmjit/src/asmjit/arm/a64emithelper_p.h +50 -0
  23. data/ext/asmjit/asmjit/src/asmjit/arm/a64emitter.h +1228 -0
  24. data/ext/asmjit/asmjit/src/asmjit/arm/a64formatter.cpp +298 -0
  25. data/ext/asmjit/asmjit/src/asmjit/arm/a64formatter_p.h +59 -0
  26. data/ext/asmjit/asmjit/src/asmjit/arm/a64func.cpp +189 -0
  27. data/ext/asmjit/asmjit/src/asmjit/arm/a64func_p.h +33 -0
  28. data/ext/asmjit/asmjit/src/asmjit/arm/a64globals.h +1894 -0
  29. data/ext/asmjit/asmjit/src/asmjit/arm/a64instapi.cpp +278 -0
  30. data/ext/asmjit/asmjit/src/asmjit/arm/a64instapi_p.h +41 -0
  31. data/ext/asmjit/asmjit/src/asmjit/arm/a64instdb.cpp +1957 -0
  32. data/ext/asmjit/asmjit/src/asmjit/arm/a64instdb.h +74 -0
  33. data/ext/asmjit/asmjit/src/asmjit/arm/a64instdb_p.h +876 -0
  34. data/ext/asmjit/asmjit/src/asmjit/arm/a64operand.cpp +85 -0
  35. data/ext/asmjit/asmjit/src/asmjit/arm/a64operand.h +312 -0
  36. data/ext/asmjit/asmjit/src/asmjit/arm/a64rapass.cpp +852 -0
  37. data/ext/asmjit/asmjit/src/asmjit/arm/a64rapass_p.h +105 -0
  38. data/ext/asmjit/asmjit/src/asmjit/arm/a64utils.h +179 -0
  39. data/ext/asmjit/asmjit/src/asmjit/arm/armformatter.cpp +143 -0
  40. data/ext/asmjit/asmjit/src/asmjit/arm/armformatter_p.h +44 -0
  41. data/ext/asmjit/asmjit/src/asmjit/arm/armglobals.h +21 -0
  42. data/ext/asmjit/asmjit/src/asmjit/arm/armoperand.h +621 -0
  43. data/ext/asmjit/asmjit/src/asmjit/arm.h +62 -0
  44. data/ext/asmjit/asmjit/src/asmjit/asmjit-scope-begin.h +17 -0
  45. data/ext/asmjit/asmjit/src/asmjit/asmjit-scope-end.h +9 -0
  46. data/ext/asmjit/asmjit/src/asmjit/asmjit.h +33 -0
  47. data/ext/asmjit/asmjit/src/asmjit/core/api-build_p.h +55 -0
  48. data/ext/asmjit/asmjit/src/asmjit/core/api-config.h +613 -0
  49. data/ext/asmjit/asmjit/src/asmjit/core/archcommons.h +229 -0
  50. data/ext/asmjit/asmjit/src/asmjit/core/archtraits.cpp +160 -0
  51. data/ext/asmjit/asmjit/src/asmjit/core/archtraits.h +290 -0
  52. data/ext/asmjit/asmjit/src/asmjit/core/assembler.cpp +406 -0
  53. data/ext/asmjit/asmjit/src/asmjit/core/assembler.h +129 -0
  54. data/ext/asmjit/asmjit/src/asmjit/core/builder.cpp +889 -0
  55. data/ext/asmjit/asmjit/src/asmjit/core/builder.h +1391 -0
  56. data/ext/asmjit/asmjit/src/asmjit/core/codebuffer.h +113 -0
  57. data/ext/asmjit/asmjit/src/asmjit/core/codeholder.cpp +1149 -0
  58. data/ext/asmjit/asmjit/src/asmjit/core/codeholder.h +1035 -0
  59. data/ext/asmjit/asmjit/src/asmjit/core/codewriter.cpp +175 -0
  60. data/ext/asmjit/asmjit/src/asmjit/core/codewriter_p.h +179 -0
  61. data/ext/asmjit/asmjit/src/asmjit/core/compiler.cpp +582 -0
  62. data/ext/asmjit/asmjit/src/asmjit/core/compiler.h +737 -0
  63. data/ext/asmjit/asmjit/src/asmjit/core/compilerdefs.h +173 -0
  64. data/ext/asmjit/asmjit/src/asmjit/core/constpool.cpp +363 -0
  65. data/ext/asmjit/asmjit/src/asmjit/core/constpool.h +250 -0
  66. data/ext/asmjit/asmjit/src/asmjit/core/cpuinfo.cpp +1162 -0
  67. data/ext/asmjit/asmjit/src/asmjit/core/cpuinfo.h +813 -0
  68. data/ext/asmjit/asmjit/src/asmjit/core/emithelper.cpp +323 -0
  69. data/ext/asmjit/asmjit/src/asmjit/core/emithelper_p.h +58 -0
  70. data/ext/asmjit/asmjit/src/asmjit/core/emitter.cpp +333 -0
  71. data/ext/asmjit/asmjit/src/asmjit/core/emitter.h +741 -0
  72. data/ext/asmjit/asmjit/src/asmjit/core/emitterutils.cpp +129 -0
  73. data/ext/asmjit/asmjit/src/asmjit/core/emitterutils_p.h +89 -0
  74. data/ext/asmjit/asmjit/src/asmjit/core/environment.cpp +46 -0
  75. data/ext/asmjit/asmjit/src/asmjit/core/environment.h +508 -0
  76. data/ext/asmjit/asmjit/src/asmjit/core/errorhandler.cpp +14 -0
  77. data/ext/asmjit/asmjit/src/asmjit/core/errorhandler.h +228 -0
  78. data/ext/asmjit/asmjit/src/asmjit/core/formatter.cpp +584 -0
  79. data/ext/asmjit/asmjit/src/asmjit/core/formatter.h +247 -0
  80. data/ext/asmjit/asmjit/src/asmjit/core/formatter_p.h +34 -0
  81. data/ext/asmjit/asmjit/src/asmjit/core/func.cpp +286 -0
  82. data/ext/asmjit/asmjit/src/asmjit/core/func.h +1445 -0
  83. data/ext/asmjit/asmjit/src/asmjit/core/funcargscontext.cpp +293 -0
  84. data/ext/asmjit/asmjit/src/asmjit/core/funcargscontext_p.h +199 -0
  85. data/ext/asmjit/asmjit/src/asmjit/core/globals.cpp +133 -0
  86. data/ext/asmjit/asmjit/src/asmjit/core/globals.h +393 -0
  87. data/ext/asmjit/asmjit/src/asmjit/core/inst.cpp +113 -0
  88. data/ext/asmjit/asmjit/src/asmjit/core/inst.h +772 -0
  89. data/ext/asmjit/asmjit/src/asmjit/core/jitallocator.cpp +1242 -0
  90. data/ext/asmjit/asmjit/src/asmjit/core/jitallocator.h +261 -0
  91. data/ext/asmjit/asmjit/src/asmjit/core/jitruntime.cpp +80 -0
  92. data/ext/asmjit/asmjit/src/asmjit/core/jitruntime.h +89 -0
  93. data/ext/asmjit/asmjit/src/asmjit/core/logger.cpp +69 -0
  94. data/ext/asmjit/asmjit/src/asmjit/core/logger.h +198 -0
  95. data/ext/asmjit/asmjit/src/asmjit/core/misc_p.h +33 -0
  96. data/ext/asmjit/asmjit/src/asmjit/core/operand.cpp +132 -0
  97. data/ext/asmjit/asmjit/src/asmjit/core/operand.h +1611 -0
  98. data/ext/asmjit/asmjit/src/asmjit/core/osutils.cpp +84 -0
  99. data/ext/asmjit/asmjit/src/asmjit/core/osutils.h +61 -0
  100. data/ext/asmjit/asmjit/src/asmjit/core/osutils_p.h +68 -0
  101. data/ext/asmjit/asmjit/src/asmjit/core/raassignment_p.h +418 -0
  102. data/ext/asmjit/asmjit/src/asmjit/core/rabuilders_p.h +612 -0
  103. data/ext/asmjit/asmjit/src/asmjit/core/radefs_p.h +1204 -0
  104. data/ext/asmjit/asmjit/src/asmjit/core/ralocal.cpp +1166 -0
  105. data/ext/asmjit/asmjit/src/asmjit/core/ralocal_p.h +254 -0
  106. data/ext/asmjit/asmjit/src/asmjit/core/rapass.cpp +1969 -0
  107. data/ext/asmjit/asmjit/src/asmjit/core/rapass_p.h +1183 -0
  108. data/ext/asmjit/asmjit/src/asmjit/core/rastack.cpp +184 -0
  109. data/ext/asmjit/asmjit/src/asmjit/core/rastack_p.h +171 -0
  110. data/ext/asmjit/asmjit/src/asmjit/core/string.cpp +559 -0
  111. data/ext/asmjit/asmjit/src/asmjit/core/string.h +372 -0
  112. data/ext/asmjit/asmjit/src/asmjit/core/support.cpp +494 -0
  113. data/ext/asmjit/asmjit/src/asmjit/core/support.h +1773 -0
  114. data/ext/asmjit/asmjit/src/asmjit/core/target.cpp +14 -0
  115. data/ext/asmjit/asmjit/src/asmjit/core/target.h +53 -0
  116. data/ext/asmjit/asmjit/src/asmjit/core/type.cpp +74 -0
  117. data/ext/asmjit/asmjit/src/asmjit/core/type.h +419 -0
  118. data/ext/asmjit/asmjit/src/asmjit/core/virtmem.cpp +722 -0
  119. data/ext/asmjit/asmjit/src/asmjit/core/virtmem.h +242 -0
  120. data/ext/asmjit/asmjit/src/asmjit/core/zone.cpp +353 -0
  121. data/ext/asmjit/asmjit/src/asmjit/core/zone.h +615 -0
  122. data/ext/asmjit/asmjit/src/asmjit/core/zonehash.cpp +309 -0
  123. data/ext/asmjit/asmjit/src/asmjit/core/zonehash.h +186 -0
  124. data/ext/asmjit/asmjit/src/asmjit/core/zonelist.cpp +163 -0
  125. data/ext/asmjit/asmjit/src/asmjit/core/zonelist.h +209 -0
  126. data/ext/asmjit/asmjit/src/asmjit/core/zonestack.cpp +176 -0
  127. data/ext/asmjit/asmjit/src/asmjit/core/zonestack.h +239 -0
  128. data/ext/asmjit/asmjit/src/asmjit/core/zonestring.h +120 -0
  129. data/ext/asmjit/asmjit/src/asmjit/core/zonetree.cpp +99 -0
  130. data/ext/asmjit/asmjit/src/asmjit/core/zonetree.h +380 -0
  131. data/ext/asmjit/asmjit/src/asmjit/core/zonevector.cpp +356 -0
  132. data/ext/asmjit/asmjit/src/asmjit/core/zonevector.h +690 -0
  133. data/ext/asmjit/asmjit/src/asmjit/core.h +1861 -0
  134. data/ext/asmjit/asmjit/src/asmjit/x86/x86archtraits_p.h +148 -0
  135. data/ext/asmjit/asmjit/src/asmjit/x86/x86assembler.cpp +5110 -0
  136. data/ext/asmjit/asmjit/src/asmjit/x86/x86assembler.h +685 -0
  137. data/ext/asmjit/asmjit/src/asmjit/x86/x86builder.cpp +52 -0
  138. data/ext/asmjit/asmjit/src/asmjit/x86/x86builder.h +351 -0
  139. data/ext/asmjit/asmjit/src/asmjit/x86/x86compiler.cpp +61 -0
  140. data/ext/asmjit/asmjit/src/asmjit/x86/x86compiler.h +721 -0
  141. data/ext/asmjit/asmjit/src/asmjit/x86/x86emithelper.cpp +619 -0
  142. data/ext/asmjit/asmjit/src/asmjit/x86/x86emithelper_p.h +60 -0
  143. data/ext/asmjit/asmjit/src/asmjit/x86/x86emitter.h +4315 -0
  144. data/ext/asmjit/asmjit/src/asmjit/x86/x86formatter.cpp +944 -0
  145. data/ext/asmjit/asmjit/src/asmjit/x86/x86formatter_p.h +58 -0
  146. data/ext/asmjit/asmjit/src/asmjit/x86/x86func.cpp +503 -0
  147. data/ext/asmjit/asmjit/src/asmjit/x86/x86func_p.h +33 -0
  148. data/ext/asmjit/asmjit/src/asmjit/x86/x86globals.h +2169 -0
  149. data/ext/asmjit/asmjit/src/asmjit/x86/x86instapi.cpp +1732 -0
  150. data/ext/asmjit/asmjit/src/asmjit/x86/x86instapi_p.h +41 -0
  151. data/ext/asmjit/asmjit/src/asmjit/x86/x86instdb.cpp +4427 -0
  152. data/ext/asmjit/asmjit/src/asmjit/x86/x86instdb.h +563 -0
  153. data/ext/asmjit/asmjit/src/asmjit/x86/x86instdb_p.h +311 -0
  154. data/ext/asmjit/asmjit/src/asmjit/x86/x86opcode_p.h +436 -0
  155. data/ext/asmjit/asmjit/src/asmjit/x86/x86operand.cpp +231 -0
  156. data/ext/asmjit/asmjit/src/asmjit/x86/x86operand.h +1085 -0
  157. data/ext/asmjit/asmjit/src/asmjit/x86/x86rapass.cpp +1509 -0
  158. data/ext/asmjit/asmjit/src/asmjit/x86/x86rapass_p.h +94 -0
  159. data/ext/asmjit/asmjit/src/asmjit/x86.h +93 -0
  160. data/ext/asmjit/asmjit/src/asmjit.natvis +245 -0
  161. data/ext/asmjit/asmjit/test/asmjit_test_assembler.cpp +84 -0
  162. data/ext/asmjit/asmjit/test/asmjit_test_assembler.h +85 -0
  163. data/ext/asmjit/asmjit/test/asmjit_test_assembler_a64.cpp +4006 -0
  164. data/ext/asmjit/asmjit/test/asmjit_test_assembler_x64.cpp +17833 -0
  165. data/ext/asmjit/asmjit/test/asmjit_test_assembler_x86.cpp +8300 -0
  166. data/ext/asmjit/asmjit/test/asmjit_test_compiler.cpp +253 -0
  167. data/ext/asmjit/asmjit/test/asmjit_test_compiler.h +73 -0
  168. data/ext/asmjit/asmjit/test/asmjit_test_compiler_a64.cpp +690 -0
  169. data/ext/asmjit/asmjit/test/asmjit_test_compiler_x86.cpp +4317 -0
  170. data/ext/asmjit/asmjit/test/asmjit_test_emitters.cpp +197 -0
  171. data/ext/asmjit/asmjit/test/asmjit_test_instinfo.cpp +181 -0
  172. data/ext/asmjit/asmjit/test/asmjit_test_misc.h +257 -0
  173. data/ext/asmjit/asmjit/test/asmjit_test_perf.cpp +62 -0
  174. data/ext/asmjit/asmjit/test/asmjit_test_perf.h +61 -0
  175. data/ext/asmjit/asmjit/test/asmjit_test_perf_a64.cpp +699 -0
  176. data/ext/asmjit/asmjit/test/asmjit_test_perf_x86.cpp +5032 -0
  177. data/ext/asmjit/asmjit/test/asmjit_test_unit.cpp +172 -0
  178. data/ext/asmjit/asmjit/test/asmjit_test_x86_sections.cpp +172 -0
  179. data/ext/asmjit/asmjit/test/asmjitutils.h +38 -0
  180. data/ext/asmjit/asmjit/test/broken.cpp +312 -0
  181. data/ext/asmjit/asmjit/test/broken.h +148 -0
  182. data/ext/asmjit/asmjit/test/cmdline.h +61 -0
  183. data/ext/asmjit/asmjit/test/performancetimer.h +41 -0
  184. data/ext/asmjit/asmjit/tools/configure-makefiles.sh +13 -0
  185. data/ext/asmjit/asmjit/tools/configure-ninja.sh +13 -0
  186. data/ext/asmjit/asmjit/tools/configure-sanitizers.sh +13 -0
  187. data/ext/asmjit/asmjit/tools/configure-vs2019-x64.bat +2 -0
  188. data/ext/asmjit/asmjit/tools/configure-vs2019-x86.bat +2 -0
  189. data/ext/asmjit/asmjit/tools/configure-vs2022-x64.bat +2 -0
  190. data/ext/asmjit/asmjit/tools/configure-vs2022-x86.bat +2 -0
  191. data/ext/asmjit/asmjit/tools/configure-xcode.sh +8 -0
  192. data/ext/asmjit/asmjit/tools/enumgen.js +417 -0
  193. data/ext/asmjit/asmjit/tools/enumgen.sh +3 -0
  194. data/ext/asmjit/asmjit/tools/tablegen-arm.js +365 -0
  195. data/ext/asmjit/asmjit/tools/tablegen-arm.sh +3 -0
  196. data/ext/asmjit/asmjit/tools/tablegen-x86.js +2638 -0
  197. data/ext/asmjit/asmjit/tools/tablegen-x86.sh +3 -0
  198. data/ext/asmjit/asmjit/tools/tablegen.js +947 -0
  199. data/ext/asmjit/asmjit/tools/tablegen.sh +4 -0
  200. data/ext/asmjit/asmjit.cc +167 -30
  201. data/ext/asmjit/extconf.rb +9 -9
  202. data/lib/asmjit/version.rb +1 -1
  203. data/lib/asmjit.rb +14 -4
  204. metadata +198 -17
@@ -0,0 +1,699 @@
1
+ // This file is part of AsmJit project <https://asmjit.com>
2
+ //
3
+ // See asmjit.h or LICENSE.md for license and copyright information
4
+ // SPDX-License-Identifier: Zlib
5
+
6
+ #include <asmjit/core.h>
7
+
8
+ #if !defined(ASMJIT_NO_AARCH64)
9
+ #include <asmjit/a64.h>
10
+
11
+ #include <limits>
12
+ #include <stdio.h>
13
+ #include <string.h>
14
+
15
+ #include "asmjit_test_perf.h"
16
+
17
+ using namespace asmjit;
18
+
19
+ // Generates a long sequence of GP instructions.
20
+ template<typename Emitter>
21
+ static void generateGpSequenceInternal(
22
+ Emitter& cc,
23
+ const a64::Gp& a, const a64::Gp& b, const a64::Gp& c, const a64::Gp& d) {
24
+
25
+ using namespace asmjit::a64;
26
+
27
+ Gp wA = a.w();
28
+ Gp wB = b.w();
29
+ Gp wC = c.w();
30
+ Gp wD = d.w();
31
+
32
+ Gp xA = a.x();
33
+ Gp xB = b.x();
34
+ Gp xC = c.x();
35
+ Gp xD = d.x();
36
+
37
+ Mem m = ptr(xD);
38
+
39
+ cc.mov(wA, 0);
40
+ cc.mov(wB, 1);
41
+ cc.mov(wC, 2);
42
+ cc.mov(wD, 3);
43
+
44
+ cc.adc(wA, wB, wC);
45
+ cc.adc(xA, xB, xC);
46
+ cc.adc(wA, wzr, wC);
47
+ cc.adc(xA, xzr, xC);
48
+ cc.adc(wzr, wB, wC);
49
+ cc.adc(xzr, xB, xC);
50
+ cc.adcs(wA, wB, wC);
51
+ cc.adcs(xA, xB, xC);
52
+ cc.add(wA, wB, wC);
53
+ cc.add(xA, xB, xC);
54
+ cc.add(wA, wB, wC, lsl(3));
55
+ cc.add(xA, xB, xC, lsl(3));
56
+ cc.add(wA, wzr, wC);
57
+ cc.add(xA, xzr, xC);
58
+ cc.add(wzr, wB, wC);
59
+ cc.add(xzr, xB, xC);
60
+ cc.add(wC, wD, 0, lsl(12));
61
+ cc.add(xC, xD, 0, lsl(12));
62
+ cc.add(wC, wD, 1024, lsl(12));
63
+ cc.add(xC, xD, 1024, lsl(12));
64
+ cc.add(wC, wD, 1024, lsl(12));
65
+ cc.add(xC, xD, 1024, lsl(12));
66
+ cc.adds(wA, wB, wC);
67
+ cc.adds(xA, xB, xC);
68
+ cc.adr(xA, 0);
69
+ cc.adr(xA, 256);
70
+ cc.adrp(xA, 4096);
71
+ cc.and_(wA, wB, wC);
72
+ cc.and_(xA, xB, xC);
73
+ cc.and_(wA, wB, 1);
74
+ cc.and_(xA, xB, 1);
75
+ cc.and_(wA, wB, 15);
76
+ cc.and_(xA, xB, 15);
77
+ cc.and_(wA, wzr, wC);
78
+ cc.and_(xA, xzr, xC);
79
+ cc.and_(wzr, wB, wC);
80
+ cc.and_(xzr, xB, xC);
81
+ cc.and_(wA, wB, 0x1);
82
+ cc.and_(xA, xB, 0x1);
83
+ cc.and_(wA, wB, 0xf);
84
+ cc.and_(xA, xB, 0xf);
85
+ cc.ands(wA, wB, wC);
86
+ cc.ands(xA, xB, xC);
87
+ cc.ands(wA, wzr, wC);
88
+ cc.ands(xA, xzr, xC);
89
+ cc.ands(wzr, wB, wC);
90
+ cc.ands(xzr, xB, xC);
91
+ cc.ands(wA, wB, 0x1);
92
+ cc.ands(xA, xB, 0x1);
93
+ cc.ands(wA, wB, 0xf);
94
+ cc.ands(xA, xB, 0xf);
95
+ cc.asr(wA, wB, 15);
96
+ cc.asr(xA, xB, 15);
97
+ cc.asrv(wA, wB, wC);
98
+ cc.asrv(xA, xB, xC);
99
+ cc.bfc(wA, 8, 16);
100
+ cc.bfc(xA, 8, 16);
101
+ cc.bfi(wA, wB, 8, 16);
102
+ cc.bfi(xA, xB, 8, 16);
103
+ cc.bfm(wA, wB, 8, 16);
104
+ cc.bfm(xA, xB, 8, 16);
105
+ cc.bfxil(wA, wB, 8, 16);
106
+ cc.bfxil(xA, xB, 8, 16);
107
+ cc.bic(wA, wB, wC, lsl(4));
108
+ cc.bic(xA, xB, xC, lsl(4));
109
+ cc.bic(wA, wzr, wC);
110
+ cc.bic(xA, xzr, xC);
111
+ cc.bics(wA, wB, wC, lsl(4));
112
+ cc.bics(xA, xB, xC, lsl(4));
113
+ cc.bics(wA, wzr, wC);
114
+ cc.bics(xA, xzr, xC);
115
+ cc.cas(wA, wB, m);
116
+ cc.cas(xA, xB, m);
117
+ cc.casa(wA, wB, m);
118
+ cc.casa(xA, xB, m);
119
+ cc.casab(wA, wB, m);
120
+ cc.casah(wA, wB, m);
121
+ cc.casal(wA, wB, m);
122
+ cc.casal(xA, xB, m);
123
+ cc.casalb(wA, wB, m);
124
+ cc.casalh(wA, wB, m);
125
+ cc.casb(wA, wB, m);
126
+ cc.cash(wA, wB, m);
127
+ cc.casl(wA, wB, m);
128
+ cc.casl(xA, xB, m);
129
+ cc.caslb(wA, wB, m);
130
+ cc.caslh(wA, wB, m);
131
+ cc.casp(wA, wB, wC, wD, m);
132
+ cc.casp(xA, xB, xC, xD, m);
133
+ cc.caspa(wA, wB, wC, wD, m);
134
+ cc.caspa(xA, xB, xC, xD, m);
135
+ cc.caspal(wA, wB, wC, wD, m);
136
+ cc.caspal(xA, xB, xC, xD, m);
137
+ cc.caspl(wA, wB, wC, wD, m);
138
+ cc.caspl(xA, xB, xC, xD, m);
139
+ cc.ccmn(wA, wB, 3, CondCode::kEQ);
140
+ cc.ccmn(xA, xB, 3, CondCode::kEQ);
141
+ cc.ccmn(wA, 2, 3, CondCode::kEQ);
142
+ cc.ccmn(xA, 2, 3, CondCode::kEQ);
143
+ cc.ccmn(wA, wzr, 3, CondCode::kEQ);
144
+ cc.ccmn(xA, xzr, 3, CondCode::kEQ);
145
+ cc.ccmp(wA, wB, 3, CondCode::kEQ);
146
+ cc.ccmp(xA, xB, 3, CondCode::kEQ);
147
+ cc.ccmp(wA, 2, 3, CondCode::kEQ);
148
+ cc.ccmp(xA, 2, 3, CondCode::kEQ);
149
+ cc.ccmp(wA, wzr, 3, CondCode::kEQ);
150
+ cc.ccmp(xA, xzr, 3, CondCode::kEQ);
151
+ cc.cinc(wA, wB, CondCode::kEQ);
152
+ cc.cinc(xA, xB, CondCode::kEQ);
153
+ cc.cinc(wzr, wB, CondCode::kEQ);
154
+ cc.cinc(wA, wzr, CondCode::kEQ);
155
+ cc.cinc(xzr, xB, CondCode::kEQ);
156
+ cc.cinc(xA, xzr, CondCode::kEQ);
157
+ cc.cinv(wA, wB, CondCode::kEQ);
158
+ cc.cinv(xA, xB, CondCode::kEQ);
159
+ cc.cinv(wzr, wB, CondCode::kEQ);
160
+ cc.cinv(wA, wzr, CondCode::kEQ);
161
+ cc.cinv(xzr, xB, CondCode::kEQ);
162
+ cc.cinv(xA, xzr, CondCode::kEQ);
163
+ cc.cls(wA, wB);
164
+ cc.cls(xA, xB);
165
+ cc.cls(wA, wzr);
166
+ cc.cls(xA, xzr);
167
+ cc.cls(wzr, wB);
168
+ cc.cls(xzr, xB);
169
+ cc.clz(wA, wB);
170
+ cc.clz(xA, xB);
171
+ cc.clz(wA, wzr);
172
+ cc.clz(xA, xzr);
173
+ cc.clz(wzr, wB);
174
+ cc.clz(xzr, xB);
175
+ cc.cmn(wA, 33);
176
+ cc.cmn(xA, 33);
177
+ cc.cmn(wA, wB);
178
+ cc.cmn(xA, xB);
179
+ cc.cmn(wA, wB, uxtb(2));
180
+ cc.cmn(xA, xB, uxtb(2));
181
+ cc.cmp(wA, 33);
182
+ cc.cmp(xA, 33);
183
+ cc.cmp(wA, wB);
184
+ cc.cmp(xA, xB);
185
+ cc.cmp(wA, wB, uxtb(2));
186
+ cc.cmp(xA, xB, uxtb(2));
187
+ cc.crc32b(wA, wB, wC);
188
+ cc.crc32b(wzr, wB, wC);
189
+ cc.crc32b(wA, wzr, wC);
190
+ cc.crc32b(wA, wB, wzr);
191
+ cc.crc32cb(wA, wB, wC);
192
+ cc.crc32cb(wzr, wB, wC);
193
+ cc.crc32cb(wA, wzr, wC);
194
+ cc.crc32cb(wA, wB, wzr);
195
+ cc.crc32ch(wA, wB, wC);
196
+ cc.crc32ch(wzr, wB, wC);
197
+ cc.crc32ch(wA, wzr, wC);
198
+ cc.crc32ch(wA, wB, wzr);
199
+ cc.crc32cw(wA, wB, wC);
200
+ cc.crc32cw(wzr, wB, wC);
201
+ cc.crc32cw(wA, wzr, wC);
202
+ cc.crc32cw(wA, wB, wzr);
203
+ cc.crc32cx(wA, wB, xC);
204
+ cc.crc32cx(wzr, wB, xC);
205
+ cc.crc32cx(wA, wzr, xC);
206
+ cc.crc32cx(wA, wB, xzr);
207
+ cc.crc32h(wA, wB, wC);
208
+ cc.crc32h(wzr, wB, wC);
209
+ cc.crc32h(wA, wzr, wC);
210
+ cc.crc32h(wA, wB, wzr);
211
+ cc.crc32w(wA, wB, wC);
212
+ cc.crc32w(wzr, wB, wC);
213
+ cc.crc32w(wA, wzr, wC);
214
+ cc.crc32w(wA, wB, wzr);
215
+ cc.crc32x(wA, wB, xC);
216
+ cc.crc32x(wzr, wB, xC);
217
+ cc.crc32x(wA, wzr, xC);
218
+ cc.crc32x(wA, wB, xzr);
219
+ cc.csel(wA, wB, wC, CondCode::kEQ);
220
+ cc.csel(xA, xB, xC, CondCode::kEQ);
221
+ cc.cset(wA, CondCode::kEQ);
222
+ cc.cset(xA, CondCode::kEQ);
223
+ cc.cset(wA, CondCode::kEQ);
224
+ cc.cset(xA, CondCode::kEQ);
225
+ cc.csetm(wA, CondCode::kEQ);
226
+ cc.csetm(xA, CondCode::kEQ);
227
+ cc.csinc(wA, wB, wC, CondCode::kEQ);
228
+ cc.csinc(xA, xB, xC, CondCode::kEQ);
229
+ cc.csinv(wA, wB, wC, CondCode::kEQ);
230
+ cc.csinv(xA, xB, xC, CondCode::kEQ);
231
+ cc.csneg(wA, wB, wC, CondCode::kEQ);
232
+ cc.csneg(xA, xB, xC, CondCode::kEQ);
233
+ cc.eon(wA, wB, wC);
234
+ cc.eon(wzr, wB, wC);
235
+ cc.eon(wA, wzr, wC);
236
+ cc.eon(wA, wB, wzr);
237
+ cc.eon(wA, wB, wC, lsl(4));
238
+ cc.eon(xA, xB, xC);
239
+ cc.eon(xzr, xB, xC);
240
+ cc.eon(xA, xzr, xC);
241
+ cc.eon(xA, xB, xzr);
242
+ cc.eon(xA, xB, xC, lsl(4));
243
+ cc.eor(wA, wB, wC);
244
+ cc.eor(wzr, wB, wC);
245
+ cc.eor(wA, wzr, wC);
246
+ cc.eor(wA, wB, wzr);
247
+ cc.eor(xA, xB, xC);
248
+ cc.eor(xzr, xB, xC);
249
+ cc.eor(xA, xzr, xC);
250
+ cc.eor(xA, xB, xzr);
251
+ cc.eor(wA, wB, wC, lsl(4));
252
+ cc.eor(xA, xB, xC, lsl(4));
253
+ cc.eor(wA, wB, 0x4000);
254
+ cc.eor(xA, xB, 0x8000);
255
+ cc.extr(wA, wB, wC, 15);
256
+ cc.extr(wzr, wB, wC, 15);
257
+ cc.extr(wA, wzr, wC, 15);
258
+ cc.extr(wA, wB, wzr, 15);
259
+ cc.extr(xA, xB, xC, 15);
260
+ cc.extr(xzr, xB, xC, 15);
261
+ cc.extr(xA, xzr, xC, 15);
262
+ cc.extr(xA, xB, xzr, 15);
263
+ cc.ldadd(wA, wB, m);
264
+ cc.ldadd(xA, xB, m);
265
+ cc.ldadda(wA, wB, m);
266
+ cc.ldadda(xA, xB, m);
267
+ cc.ldaddab(wA, wB, m);
268
+ cc.ldaddah(wA, wB, m);
269
+ cc.ldaddal(wA, wB, m);
270
+ cc.ldaddal(xA, xB, m);
271
+ cc.ldaddalb(wA, wB, m);
272
+ cc.ldaddalh(wA, wB, m);
273
+ cc.ldaddb(wA, wB, m);
274
+ cc.ldaddh(wA, wB, m);
275
+ cc.ldaddl(wA, wB, m);
276
+ cc.ldaddl(xA, xB, m);
277
+ cc.ldaddlb(wA, wB, m);
278
+ cc.ldaddlh(wA, wB, m);
279
+ cc.ldclr(wA, wB, m);
280
+ cc.ldclr(xA, xB, m);
281
+ cc.ldclra(wA, wB, m);
282
+ cc.ldclra(xA, xB, m);
283
+ cc.ldclrab(wA, wB, m);
284
+ cc.ldclrah(wA, wB, m);
285
+ cc.ldclral(wA, wB, m);
286
+ cc.ldclral(xA, xB, m);
287
+ cc.ldclralb(wA, wB, m);
288
+ cc.ldclralh(wA, wB, m);
289
+ cc.ldclrb(wA, wB, m);
290
+ cc.ldclrh(wA, wB, m);
291
+ cc.ldclrl(wA, wB, m);
292
+ cc.ldclrl(xA, xB, m);
293
+ cc.ldclrlb(wA, wB, m);
294
+ cc.ldclrlh(wA, wB, m);
295
+ cc.ldeor(wA, wB, m);
296
+ cc.ldeor(xA, xB, m);
297
+ cc.ldeora(wA, wB, m);
298
+ cc.ldeora(xA, xB, m);
299
+ cc.ldeorab(wA, wB, m);
300
+ cc.ldeorah(wA, wB, m);
301
+ cc.ldeoral(wA, wB, m);
302
+ cc.ldeoral(xA, xB, m);
303
+ cc.ldeoralb(wA, wB, m);
304
+ cc.ldeoralh(wA, wB, m);
305
+ cc.ldeorb(wA, wB, m);
306
+ cc.ldeorh(wA, wB, m);
307
+ cc.ldeorl(wA, wB, m);
308
+ cc.ldeorl(xA, xB, m);
309
+ cc.ldeorlb(wA, wB, m);
310
+ cc.ldeorlh(wA, wB, m);
311
+ cc.ldlar(wA, m);
312
+ cc.ldlar(xA, m);
313
+ cc.ldlarb(wA, m);
314
+ cc.ldlarh(wA, m);
315
+ cc.ldnp(wA, wB, m);
316
+ cc.ldnp(xA, xB, m);
317
+ cc.ldp(wA, wB, m);
318
+ cc.ldp(xA, xB, m);
319
+ cc.ldpsw(xA, xB, m);
320
+ cc.ldr(wA, m);
321
+ cc.ldr(xA, m);
322
+ cc.ldrb(wA, m);
323
+ cc.ldrh(wA, m);
324
+ cc.ldrsw(xA, m);
325
+ cc.ldraa(xA, m);
326
+ cc.ldrab(xA, m);
327
+ cc.ldset(wA, wB, m);
328
+ cc.ldset(xA, xB, m);
329
+ cc.ldseta(wA, wB, m);
330
+ cc.ldseta(xA, xB, m);
331
+ cc.ldsetab(wA, wB, m);
332
+ cc.ldsetah(wA, wB, m);
333
+ cc.ldsetal(wA, wB, m);
334
+ cc.ldsetal(xA, xB, m);
335
+ cc.ldsetalh(wA, wB, m);
336
+ cc.ldsetalb(wA, wB, m);
337
+ cc.ldsetb(wA, wB, m);
338
+ cc.ldseth(wA, wB, m);
339
+ cc.ldsetl(wA, wB, m);
340
+ cc.ldsetl(xA, xB, m);
341
+ cc.ldsetlb(wA, wB, m);
342
+ cc.ldsetlh(wA, wB, m);
343
+ cc.ldsmax(wA, wB, m);
344
+ cc.ldsmax(xA, xB, m);
345
+ cc.ldsmaxa(wA, wB, m);
346
+ cc.ldsmaxa(xA, xB, m);
347
+ cc.ldsmaxab(wA, wB, m);
348
+ cc.ldsmaxah(wA, wB, m);
349
+ cc.ldsmaxal(wA, wB, m);
350
+ cc.ldsmaxal(xA, xB, m);
351
+ cc.ldsmaxalb(wA, wB, m);
352
+ cc.ldsmaxalh(wA, wB, m);
353
+ cc.ldsmaxb(wA, wB, m);
354
+ cc.ldsmaxh(wA, wB, m);
355
+ cc.ldsmaxl(wA, wB, m);
356
+ cc.ldsmaxl(xA, xB, m);
357
+ cc.ldsmaxlb(wA, wB, m);
358
+ cc.ldsmaxlh(wA, wB, m);
359
+ cc.ldsmin(wA, wB, m);
360
+ cc.ldsmin(xA, xB, m);
361
+ cc.ldsmina(wA, wB, m);
362
+ cc.ldsmina(xA, xB, m);
363
+ cc.ldsminab(wA, wB, m);
364
+ cc.ldsminah(wA, wB, m);
365
+ cc.ldsminal(wA, wB, m);
366
+ cc.ldsminal(xA, xB, m);
367
+ cc.ldsminalb(wA, wB, m);
368
+ cc.ldsminalh(wA, wB, m);
369
+ cc.ldsminb(wA, wB, m);
370
+ cc.ldsminh(wA, wB, m);
371
+ cc.ldsminl(wA, wB, m);
372
+ cc.ldsminl(xA, xB, m);
373
+ cc.ldsminlb(wA, wB, m);
374
+ cc.ldsminlh(wA, wB, m);
375
+ cc.ldtr(wA, m);
376
+ cc.ldtr(xA, m);
377
+ cc.ldtrb(wA, m);
378
+ cc.ldtrh(wA, m);
379
+ cc.ldtrsb(wA, m);
380
+ cc.ldtrsh(wA, m);
381
+ cc.ldtrsw(xA, m);
382
+ cc.ldumax(wA, wB, m);
383
+ cc.ldumax(xA, xB, m);
384
+ cc.ldumaxa(wA, wB, m);
385
+ cc.ldumaxa(xA, xB, m);
386
+ cc.ldumaxab(wA, wB, m);
387
+ cc.ldumaxah(wA, wB, m);
388
+ cc.ldumaxal(wA, wB, m);
389
+ cc.ldumaxal(xA, xB, m);
390
+ cc.ldumaxalb(wA, wB, m);
391
+ cc.ldumaxalh(wA, wB, m);
392
+ cc.ldumaxb(wA, wB, m);
393
+ cc.ldumaxh(wA, wB, m);
394
+ cc.ldumaxl(wA, wB, m);
395
+ cc.ldumaxl(xA, xB, m);
396
+ cc.ldumaxlb(wA, wB, m);
397
+ cc.ldumaxlh(wA, wB, m);
398
+ cc.ldumin(wA, wB, m);
399
+ cc.ldumin(xA, xB, m);
400
+ cc.ldumina(wA, wB, m);
401
+ cc.ldumina(xA, xB, m);
402
+ cc.lduminab(wA, wB, m);
403
+ cc.lduminah(wA, wB, m);
404
+ cc.lduminal(wA, wB, m);
405
+ cc.lduminal(xA, xB, m);
406
+ cc.lduminalb(wA, wB, m);
407
+ cc.lduminalh(wA, wB, m);
408
+ cc.lduminb(wA, wB, m);
409
+ cc.lduminh(wA, wB, m);
410
+ cc.lduminl(wA, wB, m);
411
+ cc.lduminl(xA, xB, m);
412
+ cc.lduminlb(wA, wB, m);
413
+ cc.lduminlh(wA, wB, m);
414
+ cc.ldur(wA, m);
415
+ cc.ldur(xA, m);
416
+ cc.ldurb(wA, m);
417
+ cc.ldurh(wA, m);
418
+ cc.ldursb(wA, m);
419
+ cc.ldursh(wA, m);
420
+ cc.ldursw(xA, m);
421
+ cc.ldxp(wA, wB, m);
422
+ cc.ldxp(xA, xB, m);
423
+ cc.ldxr(wA, m);
424
+ cc.ldxr(xA, m);
425
+ cc.ldxrb(wA, m);
426
+ cc.ldxrh(wA, m);
427
+ cc.lsl(wA, wB, wC);
428
+ cc.lsl(xA, xB, xC);
429
+ cc.lsl(wA, wB, 15);
430
+ cc.lsl(xA, xB, 15);
431
+ cc.lslv(wA, wB, wC);
432
+ cc.lslv(xA, xB, xC);
433
+ cc.lsr(wA, wB, wC);
434
+ cc.lsr(xA, xB, xC);
435
+ cc.lsr(wA, wB, 15);
436
+ cc.lsr(xA, xB, 15);
437
+ cc.lsrv(wA, wB, wC);
438
+ cc.lsrv(xA, xB, xC);
439
+ cc.madd(wA, wB, wC, wD);
440
+ cc.madd(xA, xB, xC, xD);
441
+ cc.mneg(wA, wB, wC);
442
+ cc.mneg(xA, xB, xC);
443
+ cc.mov(wA, wB);
444
+ cc.mov(xA, xB);
445
+ cc.mov(wA, 0);
446
+ cc.mov(wA, 1);
447
+ cc.mov(wA, 2);
448
+ cc.mov(wA, 3);
449
+ cc.mov(wA, 4);
450
+ cc.mov(wA, 5);
451
+ cc.mov(wA, 6);
452
+ cc.mov(wA, 7);
453
+ cc.mov(wA, 8);
454
+ cc.mov(wA, 9);
455
+ cc.mov(wA, 10);
456
+ cc.mov(wA, 0xA234);
457
+ cc.mov(xA, 0xA23400000000);
458
+ cc.msub(wA, wB, wC, wD);
459
+ cc.msub(xA, xB, xC, xD);
460
+ cc.mul(wA, wB, wC);
461
+ cc.mul(xA, xB, xC);
462
+ cc.mvn(wA, wB);
463
+ cc.mvn(xA, xB);
464
+ cc.mvn(wA, wB, lsl(4));
465
+ cc.mvn(xA, xB, lsl(4));
466
+ cc.neg(wA, wB);
467
+ cc.neg(xA, xB);
468
+ cc.neg(wA, wB, lsl(4));
469
+ cc.neg(xA, xB, lsl(4));
470
+ cc.negs(wA, wB);
471
+ cc.negs(xA, xB);
472
+ cc.negs(wA, wB, lsl(4));
473
+ cc.negs(xA, xB, lsl(4));
474
+ cc.ngc(wA, wB);
475
+ cc.ngc(xA, xB);
476
+ cc.ngcs(wA, wB);
477
+ cc.ngcs(xA, xB);
478
+ cc.orn(wA, wB, wC);
479
+ cc.orn(xA, xB, xC);
480
+ cc.orn(wA, wB, wC, lsl(4));
481
+ cc.orn(xA, xB, xC, lsl(4));
482
+ cc.orr(wA, wB, wC);
483
+ cc.orr(xA, xB, xC);
484
+ cc.orr(wA, wB, wC, lsl(4));
485
+ cc.orr(xA, xB, xC, lsl(4));
486
+ cc.orr(wA, wB, 0x4000);
487
+ cc.orr(xA, xB, 0x8000);
488
+ cc.rbit(wA, wB);
489
+ cc.rbit(xA, xB);
490
+ cc.rev(wA, wB);
491
+ cc.rev(xA, xB);
492
+ cc.rev16(wA, wB);
493
+ cc.rev16(xA, xB);
494
+ cc.rev32(xA, xB);
495
+ cc.rev64(xA, xB);
496
+ cc.ror(wA, wB, wC);
497
+ cc.ror(xA, xB, xC);
498
+ cc.ror(wA, wB, 15);
499
+ cc.ror(xA, xB, 15);
500
+ cc.rorv(wA, wB, wC);
501
+ cc.rorv(xA, xB, xC);
502
+ cc.sbc(wA, wB, wC);
503
+ cc.sbc(xA, xB, xC);
504
+ cc.sbcs(wA, wB, wC);
505
+ cc.sbcs(xA, xB, xC);
506
+ cc.sbfiz(wA, wB, 5, 10);
507
+ cc.sbfiz(xA, xB, 5, 10);
508
+ cc.sbfm(wA, wB, 5, 10);
509
+ cc.sbfm(xA, xB, 5, 10);
510
+ cc.sbfx(wA, wB, 5, 10);
511
+ cc.sbfx(xA, xB, 5, 10);
512
+ cc.sdiv(wA, wB, wC);
513
+ cc.sdiv(xA, xB, xC);
514
+ cc.smaddl(xA, wB, wC, xD);
515
+ cc.smnegl(xA, wB, wC);
516
+ cc.smsubl(xA, wB, wC, xD);
517
+ cc.smulh(xA, xB, xC);
518
+ cc.smull(xA, wB, wC);
519
+ cc.stp(wA, wB, m);
520
+ cc.stp(xA, xB, m);
521
+ cc.sttr(wA, m);
522
+ cc.sttr(xA, m);
523
+ cc.sttrb(wA, m);
524
+ cc.sttrh(wA, m);
525
+ cc.stur(wA, m);
526
+ cc.stur(xA, m);
527
+ cc.sturb(wA, m);
528
+ cc.sturh(wA, m);
529
+ cc.stxp(wA, wB, wC, m);
530
+ cc.stxp(wA, xB, xC, m);
531
+ cc.stxr(wA, wB, m);
532
+ cc.stxr(wA, xB, m);
533
+ cc.stxrb(wA, wB, m);
534
+ cc.stxrh(wA, wB, m);
535
+ cc.sub(wA, wB, wC);
536
+ cc.sub(xA, xB, xC);
537
+ cc.sub(wA, wB, wC, lsl(3));
538
+ cc.sub(xA, xB, xC, lsl(3));
539
+ cc.subg(xA, xB, 32, 11);
540
+ cc.subp(xA, xB, xC);
541
+ cc.subps(xA, xB, xC);
542
+ cc.subs(wA, wB, wC);
543
+ cc.subs(xA, xB, xC);
544
+ cc.subs(wA, wB, wC, lsl(3));
545
+ cc.subs(xA, xB, xC, lsl(3));
546
+ cc.sxtb(wA, wB);
547
+ cc.sxtb(xA, wB);
548
+ cc.sxth(wA, wB);
549
+ cc.sxth(xA, wB);
550
+ cc.sxtw(xA, wB);
551
+ cc.tst(wA, 1);
552
+ cc.tst(xA, 1);
553
+ cc.tst(wA, wB);
554
+ cc.tst(xA, xB);
555
+ cc.tst(wA, wB, lsl(4));
556
+ cc.tst(xA, xB, lsl(4));
557
+ cc.udiv(wA, wB, wC);
558
+ cc.udiv(xA, xB, xC);
559
+ cc.ubfiz(wA, wB, 5, 10);
560
+ cc.ubfiz(xA, xB, 5, 10);
561
+ cc.ubfm(wA, wB, 5, 10);
562
+ cc.ubfm(xA, xB, 5, 10);
563
+ cc.ubfx(wA, wB, 5, 10);
564
+ cc.ubfx(xA, xB, 5, 10);
565
+ cc.umaddl(xA, wB, wC, xD);
566
+ cc.umnegl(xA, wB, wC);
567
+ cc.umsubl(xA, wB, wC, xD);
568
+ cc.umulh(xA, xB, xC);
569
+ cc.umull(xA, wB, wC);
570
+ cc.uxtb(wA, wB);
571
+ cc.uxth(wA, wB);
572
+ }
573
+
574
+ static void generateGpSequence(BaseEmitter& emitter, bool emitPrologEpilog) {
575
+ if (emitter.isAssembler()) {
576
+ a64::Assembler& cc = *emitter.as<a64::Assembler>();
577
+
578
+ a64::Gp a = a64::x0;
579
+ a64::Gp b = a64::x1;
580
+ a64::Gp c = a64::x2;
581
+ a64::Gp d = a64::x3;
582
+
583
+ if (emitPrologEpilog) {
584
+ FuncDetail func;
585
+ func.init(FuncSignatureT<void, void*, const void*, size_t>(CallConvId::kHost), cc.environment());
586
+
587
+ FuncFrame frame;
588
+ frame.init(func);
589
+ frame.addDirtyRegs(a, b, c, d);
590
+ frame.finalize();
591
+
592
+ cc.emitProlog(frame);
593
+ generateGpSequenceInternal(cc, a, b, c, d);
594
+ cc.emitEpilog(frame);
595
+ }
596
+ else {
597
+ generateGpSequenceInternal(cc, a, b, c, d);
598
+ }
599
+ }
600
+ #ifndef ASMJIT_NO_BUILDER
601
+ else if (emitter.isBuilder()) {
602
+ a64::Builder& cc = *emitter.as<a64::Builder>();
603
+
604
+ a64::Gp a = a64::x0;
605
+ a64::Gp b = a64::x1;
606
+ a64::Gp c = a64::x2;
607
+ a64::Gp d = a64::x3;
608
+
609
+ if (emitPrologEpilog) {
610
+ FuncDetail func;
611
+ func.init(FuncSignatureT<void, void*, const void*, size_t>(CallConvId::kHost), cc.environment());
612
+
613
+ FuncFrame frame;
614
+ frame.init(func);
615
+ frame.addDirtyRegs(a, b, c, d);
616
+ frame.finalize();
617
+
618
+ cc.emitProlog(frame);
619
+ generateGpSequenceInternal(cc, a, b, c, d);
620
+ cc.emitEpilog(frame);
621
+ }
622
+ else {
623
+ generateGpSequenceInternal(cc, a, b, c, d);
624
+ }
625
+ }
626
+ #endif
627
+ #ifndef ASMJIT_NO_COMPILER
628
+ else if (emitter.isCompiler()) {
629
+ a64::Compiler& cc = *emitter.as<a64::Compiler>();
630
+
631
+ a64::Gp a = cc.newIntPtr("a");
632
+ a64::Gp b = cc.newIntPtr("b");
633
+ a64::Gp c = cc.newIntPtr("c");
634
+ a64::Gp d = cc.newIntPtr("d");
635
+
636
+ cc.addFunc(FuncSignatureT<void>(CallConvId::kHost));
637
+ generateGpSequenceInternal(cc, a, b, c, d);
638
+ cc.endFunc();
639
+ }
640
+ #endif
641
+ }
642
+
643
+ template<typename EmitterFn>
644
+ static void benchmarkA64Function(Arch arch, uint32_t numIterations, const char* description, const EmitterFn& emitterFn) noexcept {
645
+ CodeHolder code;
646
+ printf("%s:\n", description);
647
+
648
+ bench<a64::Assembler>(code, arch, numIterations, "[raw]", [&](a64::Assembler& cc) {
649
+ emitterFn(cc, false);
650
+ });
651
+
652
+ bench<a64::Assembler>(code, arch, numIterations, "[validated]", [&](a64::Assembler& cc) {
653
+ cc.addDiagnosticOptions(DiagnosticOptions::kValidateAssembler);
654
+ emitterFn(cc, false);
655
+ });
656
+
657
+ bench<a64::Assembler>(code, arch, numIterations, "[prolog/epilog]", [&](a64::Assembler& cc) {
658
+ cc.addDiagnosticOptions(DiagnosticOptions::kValidateAssembler);
659
+ emitterFn(cc, true);
660
+ });
661
+
662
+ #ifndef ASMJIT_NO_BUILDER
663
+ bench<a64::Builder>(code, arch, numIterations, "[no-asm]", [&](a64::Builder& cc) {
664
+ emitterFn(cc, false);
665
+ });
666
+
667
+ bench<a64::Builder>(code, arch, numIterations, "[finalized]", [&](a64::Builder& cc) {
668
+ emitterFn(cc, false);
669
+ cc.finalize();
670
+ });
671
+
672
+ bench<a64::Builder>(code, arch, numIterations, "[prolog/epilog]", [&](a64::Builder& cc) {
673
+ emitterFn(cc, true);
674
+ cc.finalize();
675
+ });
676
+ #endif
677
+
678
+ #ifndef ASMJIT_NO_COMPILER
679
+ bench<a64::Compiler>(code, arch, numIterations, "[no-asm]", [&](a64::Compiler& cc) {
680
+ emitterFn(cc, true);
681
+ });
682
+
683
+ bench<a64::Compiler>(code, arch, numIterations, "[finalized]", [&](a64::Compiler& cc) {
684
+ emitterFn(cc, true);
685
+ cc.finalize();
686
+ });
687
+ #endif
688
+
689
+ printf("\n");
690
+ }
691
+
692
+ void benchmarkA64Emitters(uint32_t numIterations) {
693
+ static const char description[] = "GpSequence (Sequence of GP instructions - reg/mem)";
694
+ benchmarkA64Function(Arch::kAArch64, numIterations, description, [](BaseEmitter& emitter, bool emitPrologEpilog) {
695
+ generateGpSequence(emitter, emitPrologEpilog);
696
+ });
697
+ }
698
+
699
+ #endif // !ASMJIT_NO_AARCH64