authorgravatar for luuk@degram.devLuuk de Gram <luuk@degram.dev> 2023-05-17 20:31:18+02:00
committergravatar for luuk@degram.devLuuk de Gram <luuk@degram.dev> 2023-05-19 20:20:29+02:00
log55a260c968aed32001df5355596331db38b13729
treefd720a0edea03c807572044c9276e98dc46c1400
parentb93fa9833e6d2f7959eabb2417a154152a8d2d1c
signaturelock-open Commit is signed but in an unrecognized format.

wasm: implement `shl` for big integers


2 files changed, 1 insertions(+), 1 deletions(-)

src/arch/wasm/CodeGen.zig+1
...@@ -2604,6 +2604,7 @@ fn binOpBigInt(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, op: Op) Inner...@@ -2604,6 +2604,7 @@ fn binOpBigInt(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, op: Op) Inner
2604 switch (op) {2604 switch (op) {
2605 .mul => return func.callIntrinsic("__multi3", &.{ ty, ty }, ty, &.{ lhs, rhs }),2605 .mul => return func.callIntrinsic("__multi3", &.{ ty, ty }, ty, &.{ lhs, rhs }),
2606 .shr => return func.callIntrinsic("__lshrti3", &.{ ty, Type.i32 }, ty, &.{ lhs, rhs }),2606 .shr => return func.callIntrinsic("__lshrti3", &.{ ty, Type.i32 }, ty, &.{ lhs, rhs }),
2607 .shl => return func.callIntrinsic("__ashlti3", &.{ ty, Type.i32 }, ty, &.{ lhs, rhs }),
2607 .xor => {2608 .xor => {
2608 const result = try func.allocStack(ty);2609 const result = try func.allocStack(ty);
2609 try func.emitWValue(result);2610 try func.emitWValue(result);
test/behavior/int128.zig-1
...@@ -87,7 +87,6 @@ test "truncate int128" {...@@ -87,7 +87,6 @@ test "truncate int128" {
87}87}
8888
89test "shift int128" {89test "shift int128" {
90 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
91 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO90 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
92 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO91 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
93 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO92 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO