Commit 733008ec6b

Jacob Young <jacobly0@users.noreply.github.com>
2025-08-27 01:15:29
x86_64: fix multiplication overflow detection with adx
Closes #24965
1 parent ca2e17e
Changed files (1)
src
arch
src/arch/x86_64/CodeGen.zig
@@ -31490,7 +31490,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
                         .{ ._, ._x, .ado, .tmp8q, .tmp3q, ._, ._ },
                         .{ ._, ._x, .adc, .tmp8q, .tmp3q, ._, ._ },
                         .{ ._, ._mp, .j, .@"2f", ._, ._, ._ },
-                        .{ .@"1:", ._, .@"or", .tmp8q, .leai(.tmp1q, .tmp4), ._, ._ },
+                        .{ .@"1:", ._, .@"or", .tmp8q, .leaid(.tmp1q, .tmp4, 8), ._, ._ },
                         .{ .@"2:", ._, .sub, .tmp4d, .si(8), ._, ._ },
                         .{ ._, ._ae, .j, .@"1b", ._, ._, ._ },
                         .{ ._, ._, .@"or", .tmp2q, .tmp8q, ._, ._ },
@@ -31814,7 +31814,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
                         .{ ._, ._x, .ado, .tmp8q, .tmp3q, ._, ._ },
                         .{ ._, ._x, .adc, .tmp8q, .tmp3q, ._, ._ },
                         .{ ._, ._mp, .j, .@"2f", ._, ._, ._ },
-                        .{ .@"1:", ._, .@"or", .tmp8q, .leai(.tmp1q, .tmp4), ._, ._ },
+                        .{ .@"1:", ._, .@"or", .tmp8q, .leaid(.tmp1q, .tmp4, 8), ._, ._ },
                         .{ .@"2:", ._, .sub, .tmp4d, .si(8), ._, ._ },
                         .{ ._, ._ae, .j, .@"1b", ._, ._, ._ },
                         .{ ._, ._, .@"or", .tmp2q, .tmp8q, ._, ._ },
@@ -32175,7 +32175,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
                         .{ ._, ._x, .ado, .tmp8q, .tmp3q, ._, ._ },
                         .{ ._, ._x, .adc, .tmp8q, .tmp3q, ._, ._ },
                         .{ ._, ._mp, .j, .@"2f", ._, ._, ._ },
-                        .{ .@"1:", ._, .@"or", .tmp8q, .leai(.tmp1q, .tmp4), ._, ._ },
+                        .{ .@"1:", ._, .@"or", .tmp8q, .leaid(.tmp1q, .tmp4, 8), ._, ._ },
                         .{ .@"2:", ._, .sub, .tmp4d, .si(8), ._, ._ },
                         .{ ._, ._ae, .j, .@"1b", ._, ._, ._ },
                         .{ ._, ._, .@"or", .tmp2q, .tmp8q, ._, ._ },
@@ -55062,7 +55062,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
                         .{ ._, ._x, .ado, .tmp8q, .tmp3q, ._, ._ },
                         .{ ._, ._x, .adc, .tmp8q, .tmp3q, ._, ._ },
                         .{ ._, ._mp, .j, .@"2f", ._, ._, ._ },
-                        .{ .@"1:", ._, .@"or", .tmp8q, .leai(.tmp1q, .tmp4), ._, ._ },
+                        .{ .@"1:", ._, .@"or", .tmp8q, .leaid(.tmp1q, .tmp4, 8), ._, ._ },
                         .{ .@"2:", ._, .sub, .tmp4d, .si(8), ._, ._ },
                         .{ ._, ._ae, .j, .@"1b", ._, ._, ._ },
                         .{ ._, ._, .@"or", .tmp2q, .tmp8q, ._, ._ },
@@ -55361,7 +55361,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
                         .{ ._, ._x, .ado, .tmp8q, .tmp3q, ._, ._ },
                         .{ ._, ._x, .adc, .tmp8q, .tmp3q, ._, ._ },
                         .{ ._, ._mp, .j, .@"2f", ._, ._, ._ },
-                        .{ .@"1:", ._, .@"or", .tmp8q, .leai(.tmp1q, .tmp4), ._, ._ },
+                        .{ .@"1:", ._, .@"or", .tmp8q, .leaid(.tmp1q, .tmp4, 8), ._, ._ },
                         .{ .@"2:", ._, .sub, .tmp4d, .si(8), ._, ._ },
                         .{ ._, ._ae, .j, .@"1b", ._, ._, ._ },
                         .{ ._, ._, .@"or", .tmp2q, .tmp8q, ._, ._ },
@@ -55690,7 +55690,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
                         .{ ._, ._x, .ado, .tmp8q, .tmp3q, ._, ._ },
                         .{ ._, ._x, .adc, .tmp8q, .tmp3q, ._, ._ },
                         .{ ._, ._mp, .j, .@"2f", ._, ._, ._ },
-                        .{ .@"1:", ._, .@"or", .tmp8q, .leai(.tmp1q, .tmp4), ._, ._ },
+                        .{ .@"1:", ._, .@"or", .tmp8q, .leaid(.tmp1q, .tmp4, 8), ._, ._ },
                         .{ .@"2:", ._, .sub, .tmp4d, .si(8), ._, ._ },
                         .{ ._, ._ae, .j, .@"1b", ._, ._, ._ },
                         .{ ._, ._, .@"or", .tmp2q, .tmp8q, ._, ._ },