Commit a5e50891cb

Jacob Young <jacobly0@users.noreply.github.com>
2023-05-03 03:22:30
x86_64: optimize code size for double neg/abs
1 parent 36a3926
Changed files (1)
src
arch
src/arch/x86_64/CodeGen.zig
@@ -4229,16 +4229,12 @@ fn airFloatSign(self: *Self, inst: Air.Inst.Index) !void {
 
     const tag = self.air.instructions.items(.tag)[inst];
     try self.genBinOpMir(switch (ty_bits) {
-        32 => switch (tag) {
+        // No point using an extra prefix byte for *pd which performs the same operation.
+        32, 64 => switch (tag) {
             .neg => .xorps,
             .fabs => .andnps,
             else => unreachable,
         },
-        64 => switch (tag) {
-            .neg => .xorpd,
-            .fabs => .andnpd,
-            else => unreachable,
-        },
         else => return self.fail("TODO implement airFloatSign for {}", .{
             ty.fmt(self.bin_file.options.module.?),
         }),