x86_64: optimize code size for double neg/abs

This commit is contained in:
Jacob Young 2023-05-02 21:22:30 -04:00
parent 36a39267b8
commit a5e50891cb

View File

@ -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.?),
}),