@salang/sa 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/bin/sa.js +19 -1
  2. package/package.json +8 -7
  3. package/sa_std/alloc/layout.sal +12 -0
  4. package/sa_std/alloc/prelude.sa +1 -0
  5. package/sa_std/alloc/prelude.sal +1 -0
  6. package/sa_std/alloc/string.sa +3 -0
  7. package/sa_std/alloc/vec.sa +684 -0
  8. package/sa_std/alloc/vec.sal +4 -0
  9. package/sa_std/any.sa +130 -0
  10. package/sa_std/any.sal +23 -0
  11. package/sa_std/array.sa +1876 -0
  12. package/sa_std/ascii.sa +2 -0
  13. package/sa_std/ascii.sal +1 -0
  14. package/sa_std/async.sla +116 -0
  15. package/sa_std/binary_heap.sa +3003 -0
  16. package/sa_std/binary_heap.sal +7 -0
  17. package/sa_std/borrow.sa +171 -0
  18. package/sa_std/borrow.sal +13 -0
  19. package/sa_std/btree_map.sa +2210 -0
  20. package/sa_std/btree_map.sal +11 -0
  21. package/sa_std/btree_set.sa +1072 -0
  22. package/sa_std/btree_set.sal +6 -0
  23. package/sa_std/char.sa +1309 -0
  24. package/sa_std/char.sal +50 -0
  25. package/sa_std/cmp.sa +554 -0
  26. package/sa_std/cmp.sal +14 -0
  27. package/sa_std/collections/binary_heap.sa +1 -0
  28. package/sa_std/collections/btree_map.sa +1 -0
  29. package/sa_std/collections/btree_set.sa +1 -0
  30. package/sa_std/collections/hashmap.sa +1 -0
  31. package/sa_std/collections/hashset.sa +1 -0
  32. package/sa_std/collections/linked_list.sa +1120 -0
  33. package/sa_std/collections/linked_list.sal +10 -0
  34. package/sa_std/collections/prelude.sa +7 -0
  35. package/sa_std/collections/prelude.sal +1 -0
  36. package/sa_std/collections/vec_deque.sa +1 -0
  37. package/sa_std/collections.sal +13 -0
  38. package/sa_std/convert.sa +1115 -0
  39. package/sa_std/convert.sal +24 -0
  40. package/sa_std/core/arc.sa +233 -0
  41. package/sa_std/core/arc.sal +4 -0
  42. package/sa_std/core/ascii.sa +784 -0
  43. package/sa_std/core/ascii.sal +34 -0
  44. package/sa_std/core/bit.sa +41 -0
  45. package/sa_std/core/box.sa +1 -0
  46. package/sa_std/core/box.sal +2 -0
  47. package/sa_std/core/cell.sa +108 -0
  48. package/sa_std/core/cell.sal +5 -0
  49. package/sa_std/core/cleanup.sa +26 -0
  50. package/sa_std/core/control.sa +20 -0
  51. package/sa_std/core/derive.sa +60 -0
  52. package/sa_std/core/derive.sal +1 -0
  53. package/sa_std/core/dispatch.sa +7 -0
  54. package/sa_std/core/dispatch.sal +5 -0
  55. package/sa_std/core/future.sa +777 -0
  56. package/sa_std/core/future.sal +73 -0
  57. package/sa_std/core/hash.sa +48 -0
  58. package/sa_std/core/iter.sa +2805 -0
  59. package/sa_std/core/iter.sal +4 -0
  60. package/sa_std/core/loop.sa +60 -0
  61. package/sa_std/core/mem.sa +220 -0
  62. package/sa_std/core/option.sa +825 -0
  63. package/sa_std/core/option.sal +11 -0
  64. package/sa_std/core/panic.sa +23 -0
  65. package/sa_std/core/panic.sal +12 -0
  66. package/sa_std/core/prelude.sa +18 -0
  67. package/sa_std/core/prelude.sal +18 -0
  68. package/sa_std/core/rc.sa +225 -0
  69. package/sa_std/core/rc.sal +4 -0
  70. package/sa_std/core/refcell.sa +283 -0
  71. package/sa_std/core/refcell.sal +13 -0
  72. package/sa_std/core/result.sa +708 -0
  73. package/sa_std/core/result.sal +6 -0
  74. package/sa_std/core/rust_patterns.sal +295 -0
  75. package/sa_std/core/sa_core.sa +84 -0
  76. package/sa_std/core/slice.sa +4021 -0
  77. package/sa_std/core/slice.sal +7 -0
  78. package/sa_std/core/task.sa +112 -0
  79. package/sa_std/core/task.sal +15 -0
  80. package/sa_std/core/trait_object.sa +26 -0
  81. package/sa_std/core/trait_object.sal +4 -0
  82. package/sa_std/core/waker.sa +289 -0
  83. package/sa_std/core/waker.sal +31 -0
  84. package/sa_std/core/weak.sa +2 -0
  85. package/sa_std/core/weak.sal +4 -0
  86. package/sa_std/cow.sa +3 -0
  87. package/sa_std/cow.sal +2 -0
  88. package/sa_std/cstring.sa +3 -0
  89. package/sa_std/cstring.sal +2 -0
  90. package/sa_std/default.sa +99 -0
  91. package/sa_std/duration.sa +3 -0
  92. package/sa_std/duration.sal +2 -0
  93. package/sa_std/encoding/json.sa +259 -0
  94. package/sa_std/encoding/json.sai +54 -0
  95. package/sa_std/encoding/json.sal +35 -0
  96. package/sa_std/encoding/prelude.sa +1 -0
  97. package/sa_std/encoding/prelude.sal +0 -0
  98. package/sa_std/env.sa +390 -0
  99. package/sa_std/env.sai +25 -0
  100. package/sa_std/error.sa +253 -0
  101. package/sa_std/error.sal +44 -0
  102. package/sa_std/ffi/cstring.sa +3 -0
  103. package/sa_std/ffi/cstring.sal +1 -0
  104. package/sa_std/ffi/prelude.sa +2 -0
  105. package/sa_std/ffi/prelude.sal +2 -0
  106. package/sa_std/ffi.sa +635 -0
  107. package/sa_std/ffi.sal +51 -0
  108. package/sa_std/fmt.sa +2 -0
  109. package/sa_std/fmt.sai +18 -0
  110. package/sa_std/fmt.sal +35 -0
  111. package/sa_std/fs.sa +1023 -0
  112. package/sa_std/fs.sai +127 -0
  113. package/sa_std/fs.sal +51 -0
  114. package/sa_std/future.sa +2 -0
  115. package/sa_std/future.sal +1 -0
  116. package/sa_std/hash.sa +1486 -0
  117. package/sa_std/hash.sal +13 -0
  118. package/sa_std/hashmap.sa +1962 -0
  119. package/sa_std/hashmap.sal +20 -0
  120. package/sa_std/hashset.sa +1004 -0
  121. package/sa_std/hashset.sal +18 -0
  122. package/sa_std/http2.sa +78 -0
  123. package/sa_std/http2.sai +26 -0
  124. package/sa_std/http2.sal +36 -0
  125. package/sa_std/instant.sa +3 -0
  126. package/sa_std/instant.sal +2 -0
  127. package/sa_std/io/buf_reader.sa +43 -0
  128. package/sa_std/io/buf_writer.sa +35 -0
  129. package/sa_std/io/bufio.sa +4 -0
  130. package/sa_std/io/bufio.sal +4 -0
  131. package/sa_std/io/prelude.sa +1 -0
  132. package/sa_std/io/prelude.sal +1 -0
  133. package/sa_std/io/print.sa +2 -0
  134. package/sa_std/io/print.sai +3 -0
  135. package/sa_std/io.sa +925 -0
  136. package/sa_std/io.sai +25 -0
  137. package/sa_std/io.sal +84 -0
  138. package/sa_std/iter.sa +2 -0
  139. package/sa_std/iter.sal +1 -0
  140. package/sa_std/join_handle.sa +3 -0
  141. package/sa_std/join_handle.sal +2 -0
  142. package/sa_std/libsa_async.sa +80 -0
  143. package/sa_std/m_async.sa +137 -0
  144. package/sa_std/m_async.sal +30 -0
  145. package/sa_std/m_async.sla +2 -0
  146. package/sa_std/manually_drop.sa +3 -0
  147. package/sa_std/manually_drop.sal +2 -0
  148. package/sa_std/marker/phantom_data.sa +3 -0
  149. package/sa_std/marker/phantom_data.sal +1 -0
  150. package/sa_std/marker/prelude.sa +4 -0
  151. package/sa_std/marker/prelude.sal +4 -0
  152. package/sa_std/marker.sa +220 -0
  153. package/sa_std/marker.sal +15 -0
  154. package/sa_std/math.sa +84 -0
  155. package/sa_std/math.sai +10 -0
  156. package/sa_std/mem/manually_drop.sa +3 -0
  157. package/sa_std/mem/manually_drop.sal +1 -0
  158. package/sa_std/mem/prelude.sa +2 -0
  159. package/sa_std/mem/prelude.sal +2 -0
  160. package/sa_std/mem.sa +564 -0
  161. package/sa_std/mem.sal +40 -0
  162. package/sa_std/modstate.sai +19 -0
  163. package/sa_std/net.sa +4227 -0
  164. package/sa_std/net.sai +239 -0
  165. package/sa_std/net.sal +159 -0
  166. package/sa_std/netx.sa +85 -0
  167. package/sa_std/netx.sai +11 -0
  168. package/sa_std/netx.sal +39 -0
  169. package/sa_std/nonzero.sa +3 -0
  170. package/sa_std/nonzero.sal +2 -0
  171. package/sa_std/num/nonzero.sa +3 -0
  172. package/sa_std/num/nonzero.sal +1 -0
  173. package/sa_std/num/prelude.sa +3 -0
  174. package/sa_std/num/prelude.sal +3 -0
  175. package/sa_std/num.sa +17302 -0
  176. package/sa_std/num.sai +11 -0
  177. package/sa_std/num.sal +341 -0
  178. package/sa_std/ops.sa +1884 -0
  179. package/sa_std/ops.sal +68 -0
  180. package/sa_std/option.sa +2 -0
  181. package/sa_std/option.sal +1 -0
  182. package/sa_std/os/fd.sa +96 -0
  183. package/sa_std/os/fd.sai +7 -0
  184. package/sa_std/os/fd.sal +11 -0
  185. package/sa_std/os/prelude.sa +2 -0
  186. package/sa_std/os/prelude.sal +1 -0
  187. package/sa_std/os/unix_ffi.sa +271 -0
  188. package/sa_std/panic.sa +1 -0
  189. package/sa_std/panic.sal +1 -0
  190. package/sa_std/path.sa +3170 -0
  191. package/sa_std/path.sal +12 -0
  192. package/sa_std/phantom_data.sa +3 -0
  193. package/sa_std/phantom_data.sal +2 -0
  194. package/sa_std/pin.sa +79 -0
  195. package/sa_std/pin.sal +5 -0
  196. package/sa_std/plugin_async.sa +90 -0
  197. package/sa_std/plugin_async.sal +29 -0
  198. package/sa_std/plugin_async.sla +4 -0
  199. package/sa_std/plugin_http_async.sa +46 -0
  200. package/sa_std/plugin_http_server.sa +61 -0
  201. package/sa_std/plugin_http_server.sla +2 -0
  202. package/sa_std/plugin_sqlite.sa +106 -0
  203. package/sa_std/plugin_sqlite.sla +2 -0
  204. package/sa_std/prelude.sa +60 -0
  205. package/sa_std/prelude.sal +55 -0
  206. package/sa_std/process.sa +916 -0
  207. package/sa_std/process.sai +57 -0
  208. package/sa_std/process.sal +27 -0
  209. package/sa_std/ptr.sa +503 -0
  210. package/sa_std/ptr.sal +2 -0
  211. package/sa_std/result.sa +2 -0
  212. package/sa_std/result.sal +1 -0
  213. package/sa_std/rust_core.sa +51 -0
  214. package/sa_std/rust_core.sal +26 -0
  215. package/sa_std/sa.mod +7 -0
  216. package/sa_std/sort.sa +156 -0
  217. package/sa_std/str.sla +13 -0
  218. package/sa_std/string.sa +12240 -0
  219. package/sa_std/string.sai +25 -0
  220. package/sa_std/string.sal +17 -0
  221. package/sa_std/string_format.sa +269 -0
  222. package/sa_std/sync/atomic.sa +1500 -0
  223. package/sa_std/sync/atomic.sal +45 -0
  224. package/sa_std/sync/barrier.sa +105 -0
  225. package/sa_std/sync/barrier.sal +7 -0
  226. package/sa_std/sync/condvar.sa +240 -0
  227. package/sa_std/sync/condvar.sal +4 -0
  228. package/sa_std/sync/mpsc.sa +758 -0
  229. package/sa_std/sync/mpsc.sal +42 -0
  230. package/sa_std/sync/mpsc_list.sa +255 -0
  231. package/sa_std/sync/mpsc_list.sal +3 -0
  232. package/sa_std/sync/mutex.sa +182 -0
  233. package/sa_std/sync/mutex.sal +7 -0
  234. package/sa_std/sync/once.sa +371 -0
  235. package/sa_std/sync/once.sal +31 -0
  236. package/sa_std/sync/poison.sa +36 -0
  237. package/sa_std/sync/poison.sal +11 -0
  238. package/sa_std/sync/prelude.sa +8 -0
  239. package/sa_std/sync/prelude.sal +7 -0
  240. package/sa_std/sync/rwlock.sa +369 -0
  241. package/sa_std/sync/rwlock.sal +13 -0
  242. package/sa_std/task.sa +2 -0
  243. package/sa_std/task.sal +1 -0
  244. package/sa_std/term.sa +2 -0
  245. package/sa_std/term.sai +10 -0
  246. package/sa_std/term.sal +33 -0
  247. package/sa_std/testing/assert.sai +4 -0
  248. package/sa_std/testing/mock_io.sa +174 -0
  249. package/sa_std/testing/mock_io.sal +5 -0
  250. package/sa_std/testing/prelude.sa +2 -0
  251. package/sa_std/testing/prelude.sal +1 -0
  252. package/sa_std/text/prelude.sa +1 -0
  253. package/sa_std/text/prelude.sal +1 -0
  254. package/sa_std/text/regex.sa +2 -0
  255. package/sa_std/text/regex.sai +9 -0
  256. package/sa_std/text/regex.sal +33 -0
  257. package/sa_std/thread/join_handle.sa +3 -0
  258. package/sa_std/thread/join_handle.sal +1 -0
  259. package/sa_std/thread/prelude.sa +4 -0
  260. package/sa_std/thread/prelude.sal +3 -0
  261. package/sa_std/thread.sa +160 -0
  262. package/sa_std/thread.sai +11 -0
  263. package/sa_std/thread.sal +4 -0
  264. package/sa_std/thread_local.sa +45 -0
  265. package/sa_std/thread_local.sai +9 -0
  266. package/sa_std/time/duration.sa +3 -0
  267. package/sa_std/time/duration.sal +1 -0
  268. package/sa_std/time/instant.sa +3 -0
  269. package/sa_std/time/instant.sal +1 -0
  270. package/sa_std/time/prelude.sa +4 -0
  271. package/sa_std/time/prelude.sal +4 -0
  272. package/sa_std/time.sa +850 -0
  273. package/sa_std/time.sai +37 -0
  274. package/sa_std/time.sal +35 -0
  275. package/sa_std/time.sla +67 -0
  276. package/sa_std/tls_client.sai +39 -0
  277. package/sa_std/vec.sa +5754 -0
  278. package/sa_std/vec.sal +1 -0
  279. package/sa_std/vec_deque.sa +4925 -0
  280. package/sa_std/vec_deque.sal +8 -0
  281. package/sa_std/vec_runtime_macros.sa +11 -0
  282. package/sa_std/ws_client.sai +57 -0
@@ -0,0 +1,50 @@
1
+ #def CHAR_MAX = 1114111
2
+ #def CHAR_SIZE = 4
3
+ #def CHAR_ALIGN = 4
4
+ #def CHAR_DEFAULT = 0
5
+ #def CHAR_REPLACEMENT = 65533
6
+ #def CHAR_REPLACEMENT_CHARACTER = CHAR_REPLACEMENT
7
+ #def CHAR_MAX_LEN_UTF8 = 4
8
+ #def CHAR_MAX_LEN_UTF16 = 2
9
+ #def CHAR_SURROGATE_MIN = 55296
10
+ #def CHAR_SURROGATE_MAX = 57343
11
+
12
+ #def CHAR_UTF8_ONE_MAX = 127
13
+ #def CHAR_UTF8_TWO_MAX = 2047
14
+ #def CHAR_UTF8_THREE_MAX = 65535
15
+
16
+ #def CHAR_UTF8_CONT_TAG = 128
17
+ #def CHAR_UTF8_TWO_TAG = 192
18
+ #def CHAR_UTF8_THREE_TAG = 224
19
+ #def CHAR_UTF8_FOUR_TAG = 240
20
+ #def CHAR_UTF8_CONT_MASK = 63
21
+
22
+ #def CHAR_UTF16_BMP_MAX = 65535
23
+ #def CHAR_UTF16_SUPPLEMENTARY_BASE = 65536
24
+ #def CHAR_UTF16_SURROGATE_OFFSET = 55232
25
+ #def CHAR_UTF16_HIGH_SURROGATE_MIN = 55296
26
+ #def CHAR_UTF16_HIGH_SURROGATE_MAX = 56319
27
+ #def CHAR_UTF16_LOW_SURROGATE_MIN = 56320
28
+ #def CHAR_UTF16_LOW_SURROGATE_MAX = 57343
29
+ #def CHAR_UTF16_TRAIL_MASK = 1023
30
+
31
+ #def CHAR_ESCAPE_BACKSLASH = 92
32
+ #def CHAR_ESCAPE_U = 117
33
+ #def CHAR_ESCAPE_LBRACE = 123
34
+ #def CHAR_ESCAPE_RBRACE = 125
35
+
36
+ #def ParseCharError_SIZE = 8
37
+ #def ParseCharError_kind = +0
38
+ #def PARSE_CHAR_ERROR_EMPTY_STRING = 0
39
+ #def PARSE_CHAR_ERROR_TOO_MANY_CHARS = 1
40
+
41
+ #def DecodeUtf16Error_SIZE = 8
42
+ #def DecodeUtf16Error_unpaired_surrogate = +0
43
+
44
+ #def CharTryFromError_SIZE = 0
45
+ #def CharTryFromError_ALIGN = 1
46
+
47
+ #def TryFromCharError_SIZE = 0
48
+ #def TryFromCharError_ALIGN = 1
49
+
50
+ #def CHAR_MIN = 0
package/sa_std/cmp.sa ADDED
@@ -0,0 +1,554 @@
1
+ @import "cmp.sal"
2
+ @import "hash.sa"
3
+
4
+ [MACRO] CMP_ORDERING_IS_LT %out_bool, %ordering
5
+ %out_bool = eq %ordering, CMP_ORDERING_LESS
6
+ [END_MACRO]
7
+
8
+ [MACRO] CMP_ORDERING_IS_EQ %out_bool, %ordering
9
+ %out_bool = eq %ordering, CMP_ORDERING_EQUAL
10
+ [END_MACRO]
11
+
12
+ [MACRO] CMP_ORDERING_IS_GT %out_bool, %ordering
13
+ %out_bool = eq %ordering, CMP_ORDERING_GREATER
14
+ [END_MACRO]
15
+
16
+ [MACRO] CMP_ORDERING_IS_NE %out_bool, %ordering
17
+ __cmp_ordering_is_eq_%out_bool = eq %ordering, CMP_ORDERING_EQUAL
18
+ %out_bool = eq __cmp_ordering_is_eq_%out_bool, 0
19
+ !__cmp_ordering_is_eq_%out_bool
20
+ [END_MACRO]
21
+
22
+ [MACRO] CMP_ORDERING_IS_LE %out_bool, %ordering
23
+ __cmp_ordering_is_lt_%out_bool = eq %ordering, CMP_ORDERING_LESS
24
+ __cmp_ordering_is_eq_%out_bool = eq %ordering, CMP_ORDERING_EQUAL
25
+ %out_bool = or __cmp_ordering_is_lt_%out_bool, __cmp_ordering_is_eq_%out_bool
26
+ !__cmp_ordering_is_eq_%out_bool
27
+ !__cmp_ordering_is_lt_%out_bool
28
+ [END_MACRO]
29
+
30
+ [MACRO] CMP_ORDERING_IS_GE %out_bool, %ordering
31
+ __cmp_ordering_is_gt_%out_bool = eq %ordering, CMP_ORDERING_GREATER
32
+ __cmp_ordering_is_eq_%out_bool = eq %ordering, CMP_ORDERING_EQUAL
33
+ %out_bool = or __cmp_ordering_is_gt_%out_bool, __cmp_ordering_is_eq_%out_bool
34
+ !__cmp_ordering_is_eq_%out_bool
35
+ !__cmp_ordering_is_gt_%out_bool
36
+ [END_MACRO]
37
+
38
+ [MACRO] CMP_ORDERING_THEN %out_ordering, %ordering, %other_ordering
39
+ __cmp_ordering_then_eq_%out_ordering = eq %ordering, CMP_ORDERING_EQUAL
40
+ br __cmp_ordering_then_eq_%out_ordering -> L_CMP_ORDERING_THEN_OTHER_%out_ordering, L_CMP_ORDERING_THEN_SELF_%out_ordering
41
+ L_CMP_ORDERING_THEN_OTHER_%out_ordering:
42
+ %out_ordering = add %other_ordering, 0
43
+ !__cmp_ordering_then_eq_%out_ordering
44
+ jmp L_CMP_ORDERING_THEN_DONE_%out_ordering
45
+ L_CMP_ORDERING_THEN_SELF_%out_ordering:
46
+ %out_ordering = add %ordering, 0
47
+ !__cmp_ordering_then_eq_%out_ordering
48
+ L_CMP_ORDERING_THEN_DONE_%out_ordering:
49
+ [END_MACRO]
50
+
51
+ [MACRO] CMP_ORDERING_THEN_WITH %out_ordering, %ordering, %fn
52
+ __cmp_ordering_then_with_eq_%out_ordering = eq %ordering, CMP_ORDERING_EQUAL
53
+ br __cmp_ordering_then_with_eq_%out_ordering -> L_CMP_ORDERING_THEN_WITH_CALL_%out_ordering, L_CMP_ORDERING_THEN_WITH_SELF_%out_ordering
54
+ L_CMP_ORDERING_THEN_WITH_CALL_%out_ordering:
55
+ %out_ordering = call %fn()
56
+ !__cmp_ordering_then_with_eq_%out_ordering
57
+ jmp L_CMP_ORDERING_THEN_WITH_DONE_%out_ordering
58
+ L_CMP_ORDERING_THEN_WITH_SELF_%out_ordering:
59
+ %out_ordering = add %ordering, 0
60
+ !__cmp_ordering_then_with_eq_%out_ordering
61
+ L_CMP_ORDERING_THEN_WITH_DONE_%out_ordering:
62
+ [END_MACRO]
63
+
64
+ [MACRO] CMP_ORDERING_REVERSE %out_ordering, %ordering
65
+ __cmp_is_less_%out_ordering = eq %ordering, CMP_ORDERING_LESS
66
+ br __cmp_is_less_%out_ordering -> L_CMP_REVERSE_LESS_%out_ordering, L_CMP_REVERSE_CHECK_GREATER_%out_ordering
67
+ L_CMP_REVERSE_LESS_%out_ordering:
68
+ %out_ordering = add 0, CMP_ORDERING_GREATER
69
+ jmp L_CMP_REVERSE_END_%out_ordering
70
+ L_CMP_REVERSE_CHECK_GREATER_%out_ordering:
71
+ __cmp_is_greater_%out_ordering = eq %ordering, CMP_ORDERING_GREATER
72
+ br __cmp_is_greater_%out_ordering -> L_CMP_REVERSE_GREATER_%out_ordering, L_CMP_REVERSE_EQUAL_%out_ordering
73
+ L_CMP_REVERSE_GREATER_%out_ordering:
74
+ %out_ordering = add 0, CMP_ORDERING_LESS
75
+ !__cmp_is_greater_%out_ordering
76
+ jmp L_CMP_REVERSE_END_%out_ordering
77
+ L_CMP_REVERSE_EQUAL_%out_ordering:
78
+ %out_ordering = add 0, CMP_ORDERING_EQUAL
79
+ !__cmp_is_greater_%out_ordering
80
+ L_CMP_REVERSE_END_%out_ordering:
81
+ !__cmp_is_less_%out_ordering
82
+ [END_MACRO]
83
+
84
+ [MACRO] CMP_COMPARE_U64 %out_ordering, %lhs, %rhs
85
+ __cmp_lt_%out_ordering = ult %lhs, %rhs
86
+ br __cmp_lt_%out_ordering -> L_CMP_COMPARE_U64_LESS_%out_ordering, L_CMP_COMPARE_U64_CHECK_GT_%out_ordering
87
+ L_CMP_COMPARE_U64_LESS_%out_ordering:
88
+ %out_ordering = add 0, CMP_ORDERING_LESS
89
+ jmp L_CMP_COMPARE_U64_END_%out_ordering
90
+ L_CMP_COMPARE_U64_CHECK_GT_%out_ordering:
91
+ __cmp_gt_%out_ordering = ugt %lhs, %rhs
92
+ br __cmp_gt_%out_ordering -> L_CMP_COMPARE_U64_GREATER_%out_ordering, L_CMP_COMPARE_U64_EQUAL_%out_ordering
93
+ L_CMP_COMPARE_U64_GREATER_%out_ordering:
94
+ %out_ordering = add 0, CMP_ORDERING_GREATER
95
+ !__cmp_gt_%out_ordering
96
+ jmp L_CMP_COMPARE_U64_END_%out_ordering
97
+ L_CMP_COMPARE_U64_EQUAL_%out_ordering:
98
+ %out_ordering = add 0, CMP_ORDERING_EQUAL
99
+ !__cmp_gt_%out_ordering
100
+ L_CMP_COMPARE_U64_END_%out_ordering:
101
+ !__cmp_lt_%out_ordering
102
+ [END_MACRO]
103
+
104
+ // Rust method-name alias over CMP_COMPARE_U64.
105
+ [MACRO] CMP_COMPARE %out_ordering, %lhs, %rhs
106
+ EXPAND CMP_COMPARE_U64 %out_ordering, %lhs, %rhs
107
+ [END_MACRO]
108
+
109
+ [MACRO] CMP_COMPARE_I64 %out_ordering, %lhs, %rhs
110
+ __cmp_lt_%out_ordering = slt %lhs, %rhs
111
+ br __cmp_lt_%out_ordering -> L_CMP_COMPARE_I64_LESS_%out_ordering, L_CMP_COMPARE_I64_CHECK_GT_%out_ordering
112
+ L_CMP_COMPARE_I64_LESS_%out_ordering:
113
+ %out_ordering = add 0, CMP_ORDERING_LESS
114
+ jmp L_CMP_COMPARE_I64_END_%out_ordering
115
+ L_CMP_COMPARE_I64_CHECK_GT_%out_ordering:
116
+ __cmp_gt_%out_ordering = sgt %lhs, %rhs
117
+ br __cmp_gt_%out_ordering -> L_CMP_COMPARE_I64_GREATER_%out_ordering, L_CMP_COMPARE_I64_EQUAL_%out_ordering
118
+ L_CMP_COMPARE_I64_GREATER_%out_ordering:
119
+ %out_ordering = add 0, CMP_ORDERING_GREATER
120
+ !__cmp_gt_%out_ordering
121
+ jmp L_CMP_COMPARE_I64_END_%out_ordering
122
+ L_CMP_COMPARE_I64_EQUAL_%out_ordering:
123
+ %out_ordering = add 0, CMP_ORDERING_EQUAL
124
+ !__cmp_gt_%out_ordering
125
+ L_CMP_COMPARE_I64_END_%out_ordering:
126
+ !__cmp_lt_%out_ordering
127
+ [END_MACRO]
128
+
129
+ [MACRO] CMP_MIN_U64 %out_value, %lhs, %rhs
130
+ __cmp_take_lhs_%out_value = ule %lhs, %rhs
131
+ br __cmp_take_lhs_%out_value -> L_CMP_MIN_U64_LHS_%out_value, L_CMP_MIN_U64_RHS_%out_value
132
+ L_CMP_MIN_U64_LHS_%out_value:
133
+ %out_value = add %lhs, 0
134
+ !__cmp_take_lhs_%out_value
135
+ jmp L_CMP_MIN_U64_END_%out_value
136
+ L_CMP_MIN_U64_RHS_%out_value:
137
+ %out_value = add %rhs, 0
138
+ !__cmp_take_lhs_%out_value
139
+ L_CMP_MIN_U64_END_%out_value:
140
+ [END_MACRO]
141
+
142
+ // Rust method-name alias over CMP_MIN_U64.
143
+ [MACRO] CMP_MIN %out_value, %lhs, %rhs
144
+ EXPAND CMP_MIN_U64 %out_value, %lhs, %rhs
145
+ [END_MACRO]
146
+
147
+ [MACRO] CMP_MAX_U64 %out_value, %lhs, %rhs
148
+ __cmp_take_lhs_%out_value = uge %lhs, %rhs
149
+ br __cmp_take_lhs_%out_value -> L_CMP_MAX_U64_LHS_%out_value, L_CMP_MAX_U64_RHS_%out_value
150
+ L_CMP_MAX_U64_LHS_%out_value:
151
+ %out_value = add %lhs, 0
152
+ !__cmp_take_lhs_%out_value
153
+ jmp L_CMP_MAX_U64_END_%out_value
154
+ L_CMP_MAX_U64_RHS_%out_value:
155
+ %out_value = add %rhs, 0
156
+ !__cmp_take_lhs_%out_value
157
+ L_CMP_MAX_U64_END_%out_value:
158
+ [END_MACRO]
159
+
160
+ // Rust method-name alias over CMP_MAX_U64.
161
+ [MACRO] CMP_MAX %out_value, %lhs, %rhs
162
+ EXPAND CMP_MAX_U64 %out_value, %lhs, %rhs
163
+ [END_MACRO]
164
+
165
+ [MACRO] CMP_MIN_BY_U64 %out_value, %lhs, %rhs, %compare_fn
166
+ __cmp_min_by_ordering_%out_value = call %compare_fn(%lhs, %rhs)
167
+ __cmp_min_by_take_lhs_%out_value = eq __cmp_min_by_ordering_%out_value, CMP_ORDERING_GREATER
168
+ br __cmp_min_by_take_lhs_%out_value -> L_CMP_MIN_BY_U64_RHS_%out_value, L_CMP_MIN_BY_U64_LHS_%out_value
169
+ L_CMP_MIN_BY_U64_LHS_%out_value:
170
+ %out_value = add %lhs, 0
171
+ jmp L_CMP_MIN_BY_U64_DONE_%out_value
172
+ L_CMP_MIN_BY_U64_RHS_%out_value:
173
+ %out_value = add %rhs, 0
174
+ L_CMP_MIN_BY_U64_DONE_%out_value:
175
+ !__cmp_min_by_take_lhs_%out_value
176
+ !__cmp_min_by_ordering_%out_value
177
+ [END_MACRO]
178
+
179
+ // Rust method-name alias over CMP_MIN_BY_U64.
180
+ [MACRO] CMP_MIN_BY %out_value, %lhs, %rhs, %compare_fn
181
+ EXPAND CMP_MIN_BY_U64 %out_value, %lhs, %rhs, %compare_fn
182
+ [END_MACRO]
183
+
184
+ [MACRO] CMP_MAX_BY_U64 %out_value, %lhs, %rhs, %compare_fn
185
+ __cmp_max_by_ordering_%out_value = call %compare_fn(%lhs, %rhs)
186
+ __cmp_max_by_take_rhs_%out_value = eq __cmp_max_by_ordering_%out_value, CMP_ORDERING_LESS
187
+ br __cmp_max_by_take_rhs_%out_value -> L_CMP_MAX_BY_U64_RHS_%out_value, L_CMP_MAX_BY_U64_LHS_%out_value
188
+ L_CMP_MAX_BY_U64_LHS_%out_value:
189
+ %out_value = add %lhs, 0
190
+ jmp L_CMP_MAX_BY_U64_DONE_%out_value
191
+ L_CMP_MAX_BY_U64_RHS_%out_value:
192
+ %out_value = add %rhs, 0
193
+ L_CMP_MAX_BY_U64_DONE_%out_value:
194
+ !__cmp_max_by_take_rhs_%out_value
195
+ !__cmp_max_by_ordering_%out_value
196
+ [END_MACRO]
197
+
198
+ // Rust method-name alias over CMP_MAX_BY_U64.
199
+ [MACRO] CMP_MAX_BY %out_value, %lhs, %rhs, %compare_fn
200
+ EXPAND CMP_MAX_BY_U64 %out_value, %lhs, %rhs, %compare_fn
201
+ [END_MACRO]
202
+
203
+ [MACRO] CMP_MIN_BY_KEY_U64 %out_value, %lhs, %rhs, %key_fn
204
+ __cmp_min_key_lhs_%out_value = call %key_fn(%lhs)
205
+ __cmp_min_key_rhs_%out_value = call %key_fn(%rhs)
206
+ __cmp_min_key_take_lhs_%out_value = ule __cmp_min_key_lhs_%out_value, __cmp_min_key_rhs_%out_value
207
+ br __cmp_min_key_take_lhs_%out_value -> L_CMP_MIN_BY_KEY_U64_LHS_%out_value, L_CMP_MIN_BY_KEY_U64_RHS_%out_value
208
+ L_CMP_MIN_BY_KEY_U64_LHS_%out_value:
209
+ %out_value = add %lhs, 0
210
+ jmp L_CMP_MIN_BY_KEY_U64_DONE_%out_value
211
+ L_CMP_MIN_BY_KEY_U64_RHS_%out_value:
212
+ %out_value = add %rhs, 0
213
+ L_CMP_MIN_BY_KEY_U64_DONE_%out_value:
214
+ !__cmp_min_key_take_lhs_%out_value
215
+ !__cmp_min_key_rhs_%out_value
216
+ !__cmp_min_key_lhs_%out_value
217
+ [END_MACRO]
218
+
219
+ // Rust method-name alias over CMP_MIN_BY_KEY_U64.
220
+ [MACRO] CMP_MIN_BY_KEY %out_value, %lhs, %rhs, %key_fn
221
+ EXPAND CMP_MIN_BY_KEY_U64 %out_value, %lhs, %rhs, %key_fn
222
+ [END_MACRO]
223
+
224
+ [MACRO] CMP_MAX_BY_KEY_U64 %out_value, %lhs, %rhs, %key_fn
225
+ __cmp_max_key_lhs_%out_value = call %key_fn(%lhs)
226
+ __cmp_max_key_rhs_%out_value = call %key_fn(%rhs)
227
+ __cmp_max_key_take_lhs_%out_value = uge __cmp_max_key_lhs_%out_value, __cmp_max_key_rhs_%out_value
228
+ br __cmp_max_key_take_lhs_%out_value -> L_CMP_MAX_BY_KEY_U64_LHS_%out_value, L_CMP_MAX_BY_KEY_U64_RHS_%out_value
229
+ L_CMP_MAX_BY_KEY_U64_LHS_%out_value:
230
+ %out_value = add %lhs, 0
231
+ jmp L_CMP_MAX_BY_KEY_U64_DONE_%out_value
232
+ L_CMP_MAX_BY_KEY_U64_RHS_%out_value:
233
+ %out_value = add %rhs, 0
234
+ L_CMP_MAX_BY_KEY_U64_DONE_%out_value:
235
+ !__cmp_max_key_take_lhs_%out_value
236
+ !__cmp_max_key_rhs_%out_value
237
+ !__cmp_max_key_lhs_%out_value
238
+ [END_MACRO]
239
+
240
+ // Rust method-name alias over CMP_MAX_BY_KEY_U64.
241
+ [MACRO] CMP_MAX_BY_KEY %out_value, %lhs, %rhs, %key_fn
242
+ EXPAND CMP_MAX_BY_KEY_U64 %out_value, %lhs, %rhs, %key_fn
243
+ [END_MACRO]
244
+
245
+ [MACRO] CMP_MIN_I64 %out_value, %lhs, %rhs
246
+ __cmp_take_lhs_%out_value = sle %lhs, %rhs
247
+ br __cmp_take_lhs_%out_value -> L_CMP_MIN_I64_LHS_%out_value, L_CMP_MIN_I64_RHS_%out_value
248
+ L_CMP_MIN_I64_LHS_%out_value:
249
+ %out_value = add %lhs, 0
250
+ !__cmp_take_lhs_%out_value
251
+ jmp L_CMP_MIN_I64_END_%out_value
252
+ L_CMP_MIN_I64_RHS_%out_value:
253
+ %out_value = add %rhs, 0
254
+ !__cmp_take_lhs_%out_value
255
+ L_CMP_MIN_I64_END_%out_value:
256
+ [END_MACRO]
257
+
258
+ [MACRO] CMP_MAX_I64 %out_value, %lhs, %rhs
259
+ __cmp_take_lhs_%out_value = sge %lhs, %rhs
260
+ br __cmp_take_lhs_%out_value -> L_CMP_MAX_I64_LHS_%out_value, L_CMP_MAX_I64_RHS_%out_value
261
+ L_CMP_MAX_I64_LHS_%out_value:
262
+ %out_value = add %lhs, 0
263
+ !__cmp_take_lhs_%out_value
264
+ jmp L_CMP_MAX_I64_END_%out_value
265
+ L_CMP_MAX_I64_RHS_%out_value:
266
+ %out_value = add %rhs, 0
267
+ !__cmp_take_lhs_%out_value
268
+ L_CMP_MAX_I64_END_%out_value:
269
+ [END_MACRO]
270
+
271
+ [MACRO] CMP_CLAMP_U64 %out_value, %value, %min_value, %max_value
272
+ __cmp_below_min_%out_value = ult %value, %min_value
273
+ br __cmp_below_min_%out_value -> L_CMP_CLAMP_U64_MIN_%out_value, L_CMP_CLAMP_U64_CHECK_MAX_%out_value
274
+ L_CMP_CLAMP_U64_MIN_%out_value:
275
+ %out_value = add %min_value, 0
276
+ jmp L_CMP_CLAMP_U64_END_%out_value
277
+ L_CMP_CLAMP_U64_CHECK_MAX_%out_value:
278
+ __cmp_above_max_%out_value = ugt %value, %max_value
279
+ br __cmp_above_max_%out_value -> L_CMP_CLAMP_U64_MAX_%out_value, L_CMP_CLAMP_U64_VALUE_%out_value
280
+ L_CMP_CLAMP_U64_MAX_%out_value:
281
+ %out_value = add %max_value, 0
282
+ !__cmp_above_max_%out_value
283
+ jmp L_CMP_CLAMP_U64_END_%out_value
284
+ L_CMP_CLAMP_U64_VALUE_%out_value:
285
+ %out_value = add %value, 0
286
+ !__cmp_above_max_%out_value
287
+ L_CMP_CLAMP_U64_END_%out_value:
288
+ !__cmp_below_min_%out_value
289
+ [END_MACRO]
290
+
291
+ // Rust method-name alias over CMP_CLAMP_U64.
292
+ [MACRO] CMP_CLAMP %out_value, %value, %min_value, %max_value
293
+ EXPAND CMP_CLAMP_U64 %out_value, %value, %min_value, %max_value
294
+ [END_MACRO]
295
+
296
+ [MACRO] CMP_TRY_CLAMP_U64 %out_ok, %out_value, %value, %min_value, %max_value
297
+ __cmp_range_ok_%out_ok = ule %min_value, %max_value
298
+ br __cmp_range_ok_%out_ok -> L_CMP_TRY_CLAMP_U64_OK_%out_ok, L_CMP_TRY_CLAMP_U64_BAD_%out_ok
299
+ L_CMP_TRY_CLAMP_U64_OK_%out_ok:
300
+ EXPAND CMP_CLAMP_U64 %out_value, %value, %min_value, %max_value
301
+ %out_ok = add 0, 1
302
+ !__cmp_range_ok_%out_ok
303
+ jmp L_CMP_TRY_CLAMP_U64_END_%out_ok
304
+ L_CMP_TRY_CLAMP_U64_BAD_%out_ok:
305
+ %out_value = add 0, 0
306
+ %out_ok = add 0, 0
307
+ !__cmp_range_ok_%out_ok
308
+ L_CMP_TRY_CLAMP_U64_END_%out_ok:
309
+ [END_MACRO]
310
+
311
+ // Rust method-name alias over CMP_TRY_CLAMP_U64.
312
+ [MACRO] CMP_TRY_CLAMP %out_ok, %out_value, %value, %min_value, %max_value
313
+ EXPAND CMP_TRY_CLAMP_U64 %out_ok, %out_value, %value, %min_value, %max_value
314
+ [END_MACRO]
315
+
316
+ [MACRO] CMP_CLAMP_I64 %out_value, %value, %min_value, %max_value
317
+ __cmp_below_min_%out_value = slt %value, %min_value
318
+ br __cmp_below_min_%out_value -> L_CMP_CLAMP_I64_MIN_%out_value, L_CMP_CLAMP_I64_CHECK_MAX_%out_value
319
+ L_CMP_CLAMP_I64_MIN_%out_value:
320
+ %out_value = add %min_value, 0
321
+ jmp L_CMP_CLAMP_I64_END_%out_value
322
+ L_CMP_CLAMP_I64_CHECK_MAX_%out_value:
323
+ __cmp_above_max_%out_value = sgt %value, %max_value
324
+ br __cmp_above_max_%out_value -> L_CMP_CLAMP_I64_MAX_%out_value, L_CMP_CLAMP_I64_VALUE_%out_value
325
+ L_CMP_CLAMP_I64_MAX_%out_value:
326
+ %out_value = add %max_value, 0
327
+ !__cmp_above_max_%out_value
328
+ jmp L_CMP_CLAMP_I64_END_%out_value
329
+ L_CMP_CLAMP_I64_VALUE_%out_value:
330
+ %out_value = add %value, 0
331
+ !__cmp_above_max_%out_value
332
+ L_CMP_CLAMP_I64_END_%out_value:
333
+ !__cmp_below_min_%out_value
334
+ [END_MACRO]
335
+
336
+ [MACRO] CMP_TRY_CLAMP_I64 %out_ok, %out_value, %value, %min_value, %max_value
337
+ __cmp_range_ok_%out_ok = sle %min_value, %max_value
338
+ br __cmp_range_ok_%out_ok -> L_CMP_TRY_CLAMP_I64_OK_%out_ok, L_CMP_TRY_CLAMP_I64_BAD_%out_ok
339
+ L_CMP_TRY_CLAMP_I64_OK_%out_ok:
340
+ EXPAND CMP_CLAMP_I64 %out_value, %value, %min_value, %max_value
341
+ %out_ok = add 0, 1
342
+ !__cmp_range_ok_%out_ok
343
+ jmp L_CMP_TRY_CLAMP_I64_END_%out_ok
344
+ L_CMP_TRY_CLAMP_I64_BAD_%out_ok:
345
+ %out_value = add 0, 0
346
+ %out_ok = add 0, 0
347
+ !__cmp_range_ok_%out_ok
348
+ L_CMP_TRY_CLAMP_I64_END_%out_ok:
349
+ [END_MACRO]
350
+
351
+ [MACRO] CMP_REVERSE_U64_NEW %reverse_ptr, %value
352
+ store %reverse_ptr+CmpReverseU64_value, %value as u64
353
+ [END_MACRO]
354
+
355
+ [MACRO] CMP_REVERSE_U64_GET %out_value, %reverse_ptr
356
+ %out_value = load %reverse_ptr+CmpReverseU64_value as u64
357
+ [END_MACRO]
358
+
359
+ [MACRO] CMP_REVERSE_U64_SET %reverse_ptr, %value
360
+ store %reverse_ptr+CmpReverseU64_value, %value as u64
361
+ [END_MACRO]
362
+
363
+ [MACRO] CMP_REVERSE_U64_COPY %dst_reverse, %src_reverse
364
+ __cmp_reverse_u64_copy_value_%dst_reverse = load %src_reverse+CmpReverseU64_value as u64
365
+ store %dst_reverse+CmpReverseU64_value, __cmp_reverse_u64_copy_value_%dst_reverse as u64
366
+ !__cmp_reverse_u64_copy_value_%dst_reverse
367
+ [END_MACRO]
368
+
369
+ [MACRO] CMP_REVERSE_U64_DEFAULT %reverse_ptr
370
+ EXPAND CMP_REVERSE_U64_NEW %reverse_ptr, 0
371
+ [END_MACRO]
372
+
373
+ [MACRO] CMP_REVERSE_U64_CLONE %dst_reverse, %src_reverse
374
+ EXPAND CMP_REVERSE_U64_COPY %dst_reverse, %src_reverse
375
+ [END_MACRO]
376
+
377
+ [MACRO] CMP_REVERSE_U64_CLONE_FROM %dst_reverse, %src_reverse
378
+ EXPAND CMP_REVERSE_U64_COPY %dst_reverse, %src_reverse
379
+ [END_MACRO]
380
+
381
+ [MACRO] DEFAULT_HASHER_WRITE_CMP_REVERSE_U64 %hasher, %reverse_ptr
382
+ __cmp_reverse_u64_hash_value_%hasher = load %reverse_ptr+CmpReverseU64_value as u64
383
+ EXPAND DEFAULT_HASHER_WRITE_U64 %hasher, __cmp_reverse_u64_hash_value_%hasher
384
+ !__cmp_reverse_u64_hash_value_%hasher
385
+ [END_MACRO]
386
+
387
+ // Rust method-name alias over DEFAULT_HASHER_WRITE_CMP_REVERSE_U64.
388
+ [MACRO] DEFAULT_HASHER_WRITE_CMP_REVERSE %hasher, %reverse_ptr
389
+ EXPAND DEFAULT_HASHER_WRITE_CMP_REVERSE_U64 %hasher, %reverse_ptr
390
+ [END_MACRO]
391
+
392
+ [MACRO] CMP_REVERSE_U64_HASH %out_hash, %reverse_ptr
393
+ __cmp_reverse_u64_hash_hasher_%out_hash = stack_alloc DefaultHasher_SIZE
394
+ EXPAND DEFAULT_HASHER_NEW __cmp_reverse_u64_hash_hasher_%out_hash
395
+ EXPAND DEFAULT_HASHER_WRITE_CMP_REVERSE_U64 __cmp_reverse_u64_hash_hasher_%out_hash, %reverse_ptr
396
+ EXPAND DEFAULT_HASHER_FINISH %out_hash, __cmp_reverse_u64_hash_hasher_%out_hash
397
+ [END_MACRO]
398
+
399
+ [MACRO] BUILD_HASHER_DEFAULT_HASH_ONE_CMP_REVERSE_U64 %out_hash, %builder, %reverse_ptr
400
+ __build_hash_one_cmp_reverse_u64_hasher_%out_hash = stack_alloc DefaultHasher_SIZE
401
+ EXPAND BUILD_HASHER_DEFAULT_BUILD __build_hash_one_cmp_reverse_u64_hasher_%out_hash, %builder
402
+ EXPAND DEFAULT_HASHER_WRITE_CMP_REVERSE_U64 __build_hash_one_cmp_reverse_u64_hasher_%out_hash, %reverse_ptr
403
+ EXPAND DEFAULT_HASHER_FINISH %out_hash, __build_hash_one_cmp_reverse_u64_hasher_%out_hash
404
+ [END_MACRO]
405
+
406
+ // Rust method-name alias over BUILD_HASHER_DEFAULT_HASH_ONE_CMP_REVERSE_U64.
407
+ [MACRO] BUILD_HASHER_DEFAULT_HASH_ONE_CMP_REVERSE %out_hash, %builder, %reverse_ptr
408
+ EXPAND BUILD_HASHER_DEFAULT_HASH_ONE_CMP_REVERSE_U64 %out_hash, %builder, %reverse_ptr
409
+ [END_MACRO]
410
+
411
+ [MACRO] RANDOM_STATE_HASH_ONE_CMP_REVERSE_U64 %out_hash, %state, %reverse_ptr
412
+ __random_state_hash_one_cmp_reverse_u64_hasher_%out_hash = stack_alloc DefaultHasher_SIZE
413
+ EXPAND RANDOM_STATE_BUILD __random_state_hash_one_cmp_reverse_u64_hasher_%out_hash, %state
414
+ EXPAND DEFAULT_HASHER_WRITE_CMP_REVERSE_U64 __random_state_hash_one_cmp_reverse_u64_hasher_%out_hash, %reverse_ptr
415
+ EXPAND DEFAULT_HASHER_FINISH %out_hash, __random_state_hash_one_cmp_reverse_u64_hasher_%out_hash
416
+ [END_MACRO]
417
+
418
+ // Rust method-name alias over RANDOM_STATE_HASH_ONE_CMP_REVERSE_U64.
419
+ [MACRO] RANDOM_STATE_HASH_ONE_CMP_REVERSE %out_hash, %state, %reverse_ptr
420
+ EXPAND RANDOM_STATE_HASH_ONE_CMP_REVERSE_U64 %out_hash, %state, %reverse_ptr
421
+ [END_MACRO]
422
+
423
+ [MACRO] CMP_REVERSE_U64_COMPARE %out_ordering, %lhs_reverse, %rhs_reverse
424
+ __cmp_reverse_u64_lhs_%out_ordering = load %lhs_reverse+CmpReverseU64_value as u64
425
+ __cmp_reverse_u64_rhs_%out_ordering = load %rhs_reverse+CmpReverseU64_value as u64
426
+ EXPAND CMP_COMPARE_U64 __cmp_reverse_u64_inner_%out_ordering, __cmp_reverse_u64_lhs_%out_ordering, __cmp_reverse_u64_rhs_%out_ordering
427
+ EXPAND CMP_ORDERING_REVERSE %out_ordering, __cmp_reverse_u64_inner_%out_ordering
428
+ !__cmp_reverse_u64_inner_%out_ordering
429
+ !__cmp_reverse_u64_rhs_%out_ordering
430
+ !__cmp_reverse_u64_lhs_%out_ordering
431
+ [END_MACRO]
432
+
433
+ [MACRO] CMP_REVERSE_U64_MIN_VALUE %out_value, %lhs_reverse, %rhs_reverse
434
+ EXPAND CMP_REVERSE_U64_COMPARE __cmp_reverse_u64_min_ord_%out_value, %lhs_reverse, %rhs_reverse
435
+ __cmp_reverse_u64_min_take_rhs_%out_value = eq __cmp_reverse_u64_min_ord_%out_value, CMP_ORDERING_GREATER
436
+ br __cmp_reverse_u64_min_take_rhs_%out_value -> L_CMP_REVERSE_U64_MIN_RHS_%out_value, L_CMP_REVERSE_U64_MIN_LHS_%out_value
437
+ L_CMP_REVERSE_U64_MIN_LHS_%out_value:
438
+ EXPAND CMP_REVERSE_U64_GET %out_value, %lhs_reverse
439
+ jmp L_CMP_REVERSE_U64_MIN_DONE_%out_value
440
+ L_CMP_REVERSE_U64_MIN_RHS_%out_value:
441
+ EXPAND CMP_REVERSE_U64_GET %out_value, %rhs_reverse
442
+ L_CMP_REVERSE_U64_MIN_DONE_%out_value:
443
+ !__cmp_reverse_u64_min_take_rhs_%out_value
444
+ !__cmp_reverse_u64_min_ord_%out_value
445
+ [END_MACRO]
446
+
447
+ [MACRO] CMP_REVERSE_U64_MAX_VALUE %out_value, %lhs_reverse, %rhs_reverse
448
+ EXPAND CMP_REVERSE_U64_COMPARE __cmp_reverse_u64_max_ord_%out_value, %lhs_reverse, %rhs_reverse
449
+ __cmp_reverse_u64_max_take_rhs_%out_value = eq __cmp_reverse_u64_max_ord_%out_value, CMP_ORDERING_LESS
450
+ br __cmp_reverse_u64_max_take_rhs_%out_value -> L_CMP_REVERSE_U64_MAX_RHS_%out_value, L_CMP_REVERSE_U64_MAX_LHS_%out_value
451
+ L_CMP_REVERSE_U64_MAX_LHS_%out_value:
452
+ EXPAND CMP_REVERSE_U64_GET %out_value, %lhs_reverse
453
+ jmp L_CMP_REVERSE_U64_MAX_DONE_%out_value
454
+ L_CMP_REVERSE_U64_MAX_RHS_%out_value:
455
+ EXPAND CMP_REVERSE_U64_GET %out_value, %rhs_reverse
456
+ L_CMP_REVERSE_U64_MAX_DONE_%out_value:
457
+ !__cmp_reverse_u64_max_take_rhs_%out_value
458
+ !__cmp_reverse_u64_max_ord_%out_value
459
+ [END_MACRO]
460
+
461
+ [MACRO] CMP_REVERSE_I64_NEW %reverse_ptr, %value
462
+ store %reverse_ptr+CmpReverseI64_value, %value as i64
463
+ [END_MACRO]
464
+
465
+ [MACRO] CMP_REVERSE_I64_GET %out_value, %reverse_ptr
466
+ %out_value = load %reverse_ptr+CmpReverseI64_value as i64
467
+ [END_MACRO]
468
+
469
+ [MACRO] CMP_REVERSE_I64_SET %reverse_ptr, %value
470
+ store %reverse_ptr+CmpReverseI64_value, %value as i64
471
+ [END_MACRO]
472
+
473
+ [MACRO] CMP_REVERSE_I64_COPY %dst_reverse, %src_reverse
474
+ __cmp_reverse_i64_copy_value_%dst_reverse = load %src_reverse+CmpReverseI64_value as i64
475
+ store %dst_reverse+CmpReverseI64_value, __cmp_reverse_i64_copy_value_%dst_reverse as i64
476
+ !__cmp_reverse_i64_copy_value_%dst_reverse
477
+ [END_MACRO]
478
+
479
+ [MACRO] CMP_REVERSE_I64_DEFAULT %reverse_ptr
480
+ EXPAND CMP_REVERSE_I64_NEW %reverse_ptr, 0
481
+ [END_MACRO]
482
+
483
+ [MACRO] CMP_REVERSE_I64_CLONE %dst_reverse, %src_reverse
484
+ EXPAND CMP_REVERSE_I64_COPY %dst_reverse, %src_reverse
485
+ [END_MACRO]
486
+
487
+ [MACRO] CMP_REVERSE_I64_CLONE_FROM %dst_reverse, %src_reverse
488
+ EXPAND CMP_REVERSE_I64_COPY %dst_reverse, %src_reverse
489
+ [END_MACRO]
490
+
491
+ [MACRO] DEFAULT_HASHER_WRITE_CMP_REVERSE_I64 %hasher, %reverse_ptr
492
+ __cmp_reverse_i64_hash_value_%hasher = load %reverse_ptr+CmpReverseI64_value as i64
493
+ EXPAND DEFAULT_HASHER_WRITE_I64 %hasher, __cmp_reverse_i64_hash_value_%hasher
494
+ !__cmp_reverse_i64_hash_value_%hasher
495
+ [END_MACRO]
496
+
497
+ [MACRO] CMP_REVERSE_I64_HASH %out_hash, %reverse_ptr
498
+ __cmp_reverse_i64_hash_hasher_%out_hash = stack_alloc DefaultHasher_SIZE
499
+ EXPAND DEFAULT_HASHER_NEW __cmp_reverse_i64_hash_hasher_%out_hash
500
+ EXPAND DEFAULT_HASHER_WRITE_CMP_REVERSE_I64 __cmp_reverse_i64_hash_hasher_%out_hash, %reverse_ptr
501
+ EXPAND DEFAULT_HASHER_FINISH %out_hash, __cmp_reverse_i64_hash_hasher_%out_hash
502
+ [END_MACRO]
503
+
504
+ [MACRO] BUILD_HASHER_DEFAULT_HASH_ONE_CMP_REVERSE_I64 %out_hash, %builder, %reverse_ptr
505
+ __build_hash_one_cmp_reverse_i64_hasher_%out_hash = stack_alloc DefaultHasher_SIZE
506
+ EXPAND BUILD_HASHER_DEFAULT_BUILD __build_hash_one_cmp_reverse_i64_hasher_%out_hash, %builder
507
+ EXPAND DEFAULT_HASHER_WRITE_CMP_REVERSE_I64 __build_hash_one_cmp_reverse_i64_hasher_%out_hash, %reverse_ptr
508
+ EXPAND DEFAULT_HASHER_FINISH %out_hash, __build_hash_one_cmp_reverse_i64_hasher_%out_hash
509
+ [END_MACRO]
510
+
511
+ [MACRO] RANDOM_STATE_HASH_ONE_CMP_REVERSE_I64 %out_hash, %state, %reverse_ptr
512
+ __random_state_hash_one_cmp_reverse_i64_hasher_%out_hash = stack_alloc DefaultHasher_SIZE
513
+ EXPAND RANDOM_STATE_BUILD __random_state_hash_one_cmp_reverse_i64_hasher_%out_hash, %state
514
+ EXPAND DEFAULT_HASHER_WRITE_CMP_REVERSE_I64 __random_state_hash_one_cmp_reverse_i64_hasher_%out_hash, %reverse_ptr
515
+ EXPAND DEFAULT_HASHER_FINISH %out_hash, __random_state_hash_one_cmp_reverse_i64_hasher_%out_hash
516
+ [END_MACRO]
517
+
518
+ [MACRO] CMP_REVERSE_I64_COMPARE %out_ordering, %lhs_reverse, %rhs_reverse
519
+ __cmp_reverse_i64_lhs_%out_ordering = load %lhs_reverse+CmpReverseI64_value as i64
520
+ __cmp_reverse_i64_rhs_%out_ordering = load %rhs_reverse+CmpReverseI64_value as i64
521
+ EXPAND CMP_COMPARE_I64 __cmp_reverse_i64_inner_%out_ordering, __cmp_reverse_i64_lhs_%out_ordering, __cmp_reverse_i64_rhs_%out_ordering
522
+ EXPAND CMP_ORDERING_REVERSE %out_ordering, __cmp_reverse_i64_inner_%out_ordering
523
+ !__cmp_reverse_i64_inner_%out_ordering
524
+ !__cmp_reverse_i64_rhs_%out_ordering
525
+ !__cmp_reverse_i64_lhs_%out_ordering
526
+ [END_MACRO]
527
+
528
+ [MACRO] CMP_REVERSE_I64_MIN_VALUE %out_value, %lhs_reverse, %rhs_reverse
529
+ EXPAND CMP_REVERSE_I64_COMPARE __cmp_reverse_i64_min_ord_%out_value, %lhs_reverse, %rhs_reverse
530
+ __cmp_reverse_i64_min_take_rhs_%out_value = eq __cmp_reverse_i64_min_ord_%out_value, CMP_ORDERING_GREATER
531
+ br __cmp_reverse_i64_min_take_rhs_%out_value -> L_CMP_REVERSE_I64_MIN_RHS_%out_value, L_CMP_REVERSE_I64_MIN_LHS_%out_value
532
+ L_CMP_REVERSE_I64_MIN_LHS_%out_value:
533
+ EXPAND CMP_REVERSE_I64_GET %out_value, %lhs_reverse
534
+ jmp L_CMP_REVERSE_I64_MIN_DONE_%out_value
535
+ L_CMP_REVERSE_I64_MIN_RHS_%out_value:
536
+ EXPAND CMP_REVERSE_I64_GET %out_value, %rhs_reverse
537
+ L_CMP_REVERSE_I64_MIN_DONE_%out_value:
538
+ !__cmp_reverse_i64_min_take_rhs_%out_value
539
+ !__cmp_reverse_i64_min_ord_%out_value
540
+ [END_MACRO]
541
+
542
+ [MACRO] CMP_REVERSE_I64_MAX_VALUE %out_value, %lhs_reverse, %rhs_reverse
543
+ EXPAND CMP_REVERSE_I64_COMPARE __cmp_reverse_i64_max_ord_%out_value, %lhs_reverse, %rhs_reverse
544
+ __cmp_reverse_i64_max_take_rhs_%out_value = eq __cmp_reverse_i64_max_ord_%out_value, CMP_ORDERING_LESS
545
+ br __cmp_reverse_i64_max_take_rhs_%out_value -> L_CMP_REVERSE_I64_MAX_RHS_%out_value, L_CMP_REVERSE_I64_MAX_LHS_%out_value
546
+ L_CMP_REVERSE_I64_MAX_LHS_%out_value:
547
+ EXPAND CMP_REVERSE_I64_GET %out_value, %lhs_reverse
548
+ jmp L_CMP_REVERSE_I64_MAX_DONE_%out_value
549
+ L_CMP_REVERSE_I64_MAX_RHS_%out_value:
550
+ EXPAND CMP_REVERSE_I64_GET %out_value, %rhs_reverse
551
+ L_CMP_REVERSE_I64_MAX_DONE_%out_value:
552
+ !__cmp_reverse_i64_max_take_rhs_%out_value
553
+ !__cmp_reverse_i64_max_ord_%out_value
554
+ [END_MACRO]
package/sa_std/cmp.sal ADDED
@@ -0,0 +1,14 @@
1
+ #def CMP_ORDERING_LESS = -1
2
+ #def CMP_ORDERING_EQUAL = 0
3
+ #def CMP_ORDERING_GREATER = 1
4
+ #def CMP_ORDERING_DEFAULT_VALUE = CMP_ORDERING_EQUAL
5
+
6
+ #def CmpReverseU64_SIZE = 8
7
+ #def CmpReverseU64_value = +0
8
+
9
+ #def CmpReverseI64_SIZE = 8
10
+ #def CmpReverseI64_value = +0
11
+
12
+
13
+ #def CMP_ORDERING_MIN = -1
14
+ #def CMP_ORDERING_MAX = 1
@@ -0,0 +1 @@
1
+ @import "../binary_heap.sa"
@@ -0,0 +1 @@
1
+ @import "../btree_map.sa"
@@ -0,0 +1 @@
1
+ @import "../btree_set.sa"
@@ -0,0 +1 @@
1
+ @import "../hashmap.sa"
@@ -0,0 +1 @@
1
+ @import "../hashset.sa"