authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-08-06 02:01:29-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-08-08 21:32:50-04:00
log3ebf8ce9704647686a9f9654c59e0be17bc78984
tree347b8acec3d17a488ed06543359f149f3fecced5
parentf938404a45d347fe448351c70cc34db98700e068

Builder: fix builtin pseudo-instruction dumping


1 files changed, 23 insertions(+), 4 deletions(-)

src/codegen/llvm/Builder.zig+23-4
......@@ -7727,7 +7727,14 @@ pub fn printUnbuffered(
77277727 },
77287728 .fneg,
77297729 .@"fneg fast",
7730 .ret,
7730 => |tag| {
7731 const val: Value = @enumFromInt(instruction.data);
7732 try writer.print(" %{} = {s} {%}\n", .{
7733 instruction_index.name(&function).fmt(self),
7734 @tagName(tag),
7735 val.fmt(function_index, self),
7736 });
7737 },
77317738 .@"llvm.ceil.",
77327739 .@"llvm.cos.",
77337740 .@"llvm.exp.",
......@@ -7746,8 +7753,12 @@ pub fn printUnbuffered(
77467753 .@"llvm.ctpop.",
77477754 => |tag| {
77487755 const val: Value = @enumFromInt(instruction.data);
7749 try writer.print(" {s} {%}\n", .{
7756 const ty = val.typeOf(function_index, self);
7757 try writer.print(" %{} = call {%} @{s}{m}({%})\n", .{
7758 instruction_index.name(&function).fmt(self),
7759 ty.fmt(self),
77507760 @tagName(tag),
7761 ty.fmt(self),
77517762 val.fmt(function_index, self),
77527763 });
77537764 },
......@@ -7872,6 +7883,13 @@ pub fn printUnbuffered(
78727883 }
78737884 try writer.writeByte('\n');
78747885 },
7886 .ret => |tag| {
7887 const val: Value = @enumFromInt(instruction.data);
7888 try writer.print(" {s} {%}\n", .{
7889 @tagName(tag),
7890 val.fmt(function_index, self),
7891 });
7892 },
78757893 .@"ret void",
78767894 .@"unreachable",
78777895 => |tag| try writer.print(" {s}\n", .{@tagName(tag)}),
......@@ -7966,13 +7984,14 @@ pub fn printUnbuffered(
79667984 extra.type.fmt(self),
79677985 });
79687986 },
7969 .@"llvm.fma." => {
7987 .@"llvm.fma." => |tag| {
79707988 const extra =
79717989 function.extraData(Function.Instruction.FusedMultiplyAdd, instruction.data);
79727990 const ty = instruction_index.typeOf(function_index, self);
7973 try writer.print(" %{} = call {%} @llvm.fma.{m}({%}, {%}, {%})\n", .{
7991 try writer.print(" %{} = call {%} @{s}{m}({%}, {%}, {%})\n", .{
79747992 instruction_index.name(&function).fmt(self),
79757993 ty.fmt(self),
7994 @tagName(tag),
79767995 ty.fmt(self),
79777996 extra.a.fmt(function_index, self),
79787997 extra.b.fmt(function_index, self),