commit 55a260c968aed32001df5355596331db38b13729 (tree)
parent b93fa9833e6d2f7959eabb2417a154152a8d2d1c
Author: Luuk de Gram <luuk@degram.dev>
Date: Wed, 17 May 2023 20:31:18 +0200
wasm: implement `shl` for big integers
Diffstat:
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig
@@ -2604,6 +2604,7 @@ fn binOpBigInt(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, op: Op) Inner
switch (op) {
.mul => return func.callIntrinsic("__multi3", &.{ ty, ty }, ty, &.{ lhs, rhs }),
.shr => return func.callIntrinsic("__lshrti3", &.{ ty, Type.i32 }, ty, &.{ lhs, rhs }),
+ .shl => return func.callIntrinsic("__ashlti3", &.{ ty, Type.i32 }, ty, &.{ lhs, rhs }),
.xor => {
const result = try func.allocStack(ty);
try func.emitWValue(result);
diff --git a/test/behavior/int128.zig b/test/behavior/int128.zig
@@ -87,7 +87,6 @@ test "truncate int128" {
}
test "shift int128" {
- if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO