| ... | ... | @@ -2650,12 +2650,18 @@ fn binOp(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, op: Op) InnerError! |
| 2650 | 2650 | |
| 2651 | 2651 | fn binOpBigInt(func: *CodeGen, lhs: WValue, rhs: WValue, ty: Type, op: Op) InnerError!WValue { |
| 2652 | 2652 | const mod = func.bin_file.base.options.module.?; |
| 2653 | | if (ty.intInfo(mod).bits > 128) { |
| 2653 | const int_info = ty.intInfo(mod); |
| 2654 | if (int_info.bits > 128) { |
| 2654 | 2655 | return func.fail("TODO: Implement binary operation for big integers larger than 128 bits", .{}); |
| 2655 | 2656 | } |
| 2656 | 2657 | |
| 2657 | 2658 | switch (op) { |
| 2658 | 2659 | .mul => return func.callIntrinsic("__multi3", &.{ ty.toIntern(), ty.toIntern() }, ty, &.{ lhs, rhs }), |
| 2660 | .div => switch (int_info.signedness) { |
| 2661 | .signed => return func.callIntrinsic("__udivti3", &.{ ty.toIntern(), ty.toIntern() }, ty, &.{ lhs, rhs }), |
| 2662 | .unsigned => return func.callIntrinsic("__divti3", &.{ ty.toIntern(), ty.toIntern() }, ty, &.{ lhs, rhs }), |
| 2663 | }, |
| 2664 | .rem => return func.callIntrinsic("__umodti3", &.{ ty.toIntern(), ty.toIntern() }, ty, &.{ lhs, rhs }), |
| 2659 | 2665 | .shr => return func.callIntrinsic("__lshrti3", &.{ ty.toIntern(), .i32_type }, ty, &.{ lhs, rhs }), |
| 2660 | 2666 | .shl => return func.callIntrinsic("__ashlti3", &.{ ty.toIntern(), .i32_type }, ty, &.{ lhs, rhs }), |
| 2661 | 2667 | .xor => { |