Skip to content

Commit 49f4d3d

Browse files
committed
Eliminate @builtin decorator for compatibility with TS
1 parent 56d8915 commit 49f4d3d

22 files changed

+922
-957
lines changed

dist/asc.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/asc.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assemblyscript.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assemblyscript.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/i64-polyfill/assembly/i64.ts

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,29 @@ export function getHi(): u32 {
99
return hi;
1010
}
1111

12-
function clz_(loLeft: u32, hiLeft: u32): void {
13-
var ret = clz<u64>(<u64>loLeft | <u64>hiLeft << 32);
12+
import { clz as builtin_clz } from "builtins";
13+
14+
export function clz(loLeft: u32, hiLeft: u32): void {
15+
var ret = builtin_clz<u64>(<u64>loLeft | <u64>hiLeft << 32);
1416
lo = <u32>ret;
1517
hi = 0;
1618
}
17-
export { clz_ as clz };
1819

19-
function ctz_(loLeft: u32, hiLeft: u32): void {
20-
var ret = ctz<u64>(<u64>loLeft | <u64>hiLeft << 32);
20+
import { ctz as builtin_ctz } from "builtins";
21+
22+
export function ctz(loLeft: u32, hiLeft: u32): void {
23+
var ret = builtin_ctz<u64>(<u64>loLeft | <u64>hiLeft << 32);
2124
lo = <u32>ret;
2225
hi = 0;
2326
}
24-
export { ctz_ as ctz };
2527

26-
function popcnt_(loLeft: u32, hiLeft: u32): void {
27-
var ret = popcnt<u64>(<u64>loLeft | <u64>hiLeft << 32);
28+
import { popcnt as builtin_popcnt } from "builtins";
29+
30+
export function popcnt(loLeft: u32, hiLeft: u32): void {
31+
var ret = builtin_popcnt<u64>(<u64>loLeft | <u64>hiLeft << 32);
2832
lo = <u32>ret;
2933
hi = 0;
3034
}
31-
export { popcnt_ as popcnt };
3235

3336
export function eqz(loLeft: u32, hiLeft: u32): void {
3437
var ret: bool = !(<u64>loLeft | <u64>hiLeft << 32);
@@ -114,19 +117,21 @@ export function shr_u(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): voi
114117
hi = <u32>(ret >>> 32);
115118
}
116119

117-
function rotl_(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void {
118-
var ret = rotl<u64>(<u64>loLeft | <u64>hiLeft << 32, <u64>loRight | <u64>hiRight << 32);
120+
import { rotl as builtin_rotl } from "builtins";
121+
122+
export function rotl(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void {
123+
var ret = builtin_rotl<u64>(<u64>loLeft | <u64>hiLeft << 32, <u64>loRight | <u64>hiRight << 32);
119124
lo = <u32>ret;
120125
hi = <u32>(ret >>> 32);
121126
}
122-
export { rotl_ as rotl };
123127

124-
function rotr_(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void {
125-
var ret = rotr<u64>(<u64>loLeft | <u64>hiLeft << 32, <u64>loRight | <u64>hiRight << 32);
128+
import { rotr as builtin_rotr } from "builtins";
129+
130+
export function rotr(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void {
131+
var ret = builtin_rotr<u64>(<u64>loLeft | <u64>hiLeft << 32, <u64>loRight | <u64>hiRight << 32);
126132
lo = <u32>ret;
127133
hi = <u32>(ret >>> 32);
128134
}
129-
export { rotr_ as rotr };
130135

131136
export function eq(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void {
132137
var ret: bool = (<u64>loLeft | <u64>hiLeft << 32) == (<u64>loRight | <u64>hiRight << 32);

0 commit comments

Comments
 (0)