authorgravatar for joachim.schmidt557@outlook.comJoachim Schmidt <joachim.schmidt557@outlook.com> 2020-11-21 19:15:01+01:00
committergravatar for joachim.schmidt557@outlook.comJoachim Schmidt <joachim.schmidt557@outlook.com> 2020-11-28 18:19:22+01:00
log85a3991a4392cee42acf0ed5fed185afdc2b133c
treed0412af5b788ac01180a3144400c8aa3dbb2d6dd
parent27c5c97f21c5e0c96d954246a6cc4d3018b71355
signature Commit is signed but in an unrecognized format.

stage2 codegen: use switch in genBoolOp


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

src/codegen.zig+4-4
...@@ -2189,12 +2189,12 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {...@@ -2189,12 +2189,12 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
2189 if (inst.base.isUnused())2189 if (inst.base.isUnused())
2190 return MCValue.dead;2190 return MCValue.dead;
2191 switch (arch) {2191 switch (arch) {
2192 .x86_64 => if (inst.base.tag == .booland) {2192 .x86_64 => switch (inst.base.tag) {
2193 // lhs AND rhs2193 // lhs AND rhs
2194 return try self.genX8664BinMath(&inst.base, inst.lhs, inst.rhs, 4, 0x20);2194 .booland => return try self.genX8664BinMath(&inst.base, inst.lhs, inst.rhs, 4, 0x20),
2195 } else {
2196 // lhs OR rhs2195 // lhs OR rhs
2197 return try self.genX8664BinMath(&inst.base, inst.lhs, inst.rhs, 1, 0x08);2196 .boolor => return try self.genX8664BinMath(&inst.base, inst.lhs, inst.rhs, 1, 0x08),
2197 else => unreachable,
2198 },2198 },
2199 else => return self.fail(inst.base.src, "TODO implement boolean operations for {}", .{self.target.cpu.arch}),2199 else => return self.fail(inst.base.src, "TODO implement boolean operations for {}", .{self.target.cpu.arch}),
2200 }2200 }