authorgravatar for koachan@protonmail.comKoakuma <koachan@protonmail.com> 2022-04-10 19:04:16+07:00
committergravatar for koachan@protonmail.comKoakuma <koachan@protonmail.com> 2022-04-14 22:18:06+07:00
logcfd389f927112cbc81e71118493a7b9fba18192d
tree11ae16f2c768acc5d077ee1e257409b957552df4
parentab2ea9fb09df6821a7b6cae7990b9bc5be7c1f61

stage2: sparcv9: zig fmt


2 files changed, 9 insertions(+), 9 deletions(-)

src/arch/sparcv9/CodeGen.zig+2-2
...@@ -586,9 +586,9 @@ fn airAsm(self: *Self, inst: Air.Inst.Index) !void {...@@ -586,9 +586,9 @@ fn airAsm(self: *Self, inst: Air.Inst.Index) !void {
586 const is_volatile = (extra.data.flags & 0x80000000) != 0;586 const is_volatile = (extra.data.flags & 0x80000000) != 0;
587 const clobbers_len = @truncate(u31, extra.data.flags);587 const clobbers_len = @truncate(u31, extra.data.flags);
588 var extra_i: usize = extra.end;588 var extra_i: usize = extra.end;
589 const outputs = @bitCast([]const Air.Inst.Ref, self.air.extra[extra_i..extra_i+extra.data.outputs_len]);589 const outputs = @bitCast([]const Air.Inst.Ref, self.air.extra[extra_i .. extra_i + extra.data.outputs_len]);
590 extra_i += outputs.len;590 extra_i += outputs.len;
591 const inputs = @bitCast([]const Air.Inst.Ref, self.air.extra[extra_i..extra_i+extra.data.inputs_len]);591 const inputs = @bitCast([]const Air.Inst.Ref, self.air.extra[extra_i .. extra_i + extra.data.inputs_len]);
592 extra_i += inputs.len;592 extra_i += inputs.len;
593593
594 const dead = !is_volatile and self.liveness.isUnused(inst);594 const dead = !is_volatile and self.liveness.isUnused(inst);
src/arch/sparcv9/bits.zig+7-7
...@@ -964,7 +964,7 @@ pub const Instruction = union(enum) {...@@ -964,7 +964,7 @@ pub const Instruction = union(enum) {
964 // See appendix A of the SPARCv9 ISA manual.964 // See appendix A of the SPARCv9 ISA manual.
965965
966 pub fn add(comptime s2: type, rs1: Register, rs2: s2, rd: Register) Instruction {966 pub fn add(comptime s2: type, rs1: Register, rs2: s2, rd: Register) Instruction {
967 return switch(s2) {967 return switch (s2) {
968 Register => format3a(0b10, 0b00_0000, rs1, rs2, rd),968 Register => format3a(0b10, 0b00_0000, rs1, rs2, rd),
969 i13 => format3b(0b10, 0b00_0000, rs1, rs2, rd),969 i13 => format3b(0b10, 0b00_0000, rs1, rs2, rd),
970 else => unreachable,970 else => unreachable,
...@@ -972,7 +972,7 @@ pub const Instruction = union(enum) {...@@ -972,7 +972,7 @@ pub const Instruction = union(enum) {
972 }972 }
973973
974 pub fn @"or"(comptime s2: type, rs1: Register, rs2: s2, rd: Register) Instruction {974 pub fn @"or"(comptime s2: type, rs1: Register, rs2: s2, rd: Register) Instruction {
975 return switch(s2) {975 return switch (s2) {
976 Register => format3a(0b10, 0b00_0010, rs1, rs2, rd),976 Register => format3a(0b10, 0b00_0010, rs1, rs2, rd),
977 i13 => format3b(0b10, 0b00_0010, rs1, rs2, rd),977 i13 => format3b(0b10, 0b00_0010, rs1, rs2, rd),
978 else => unreachable,978 else => unreachable,
...@@ -984,7 +984,7 @@ pub const Instruction = union(enum) {...@@ -984,7 +984,7 @@ pub const Instruction = union(enum) {
984 }984 }
985985
986 pub fn @"return"(comptime s2: type, rs1: Register, rs2: s2) Instruction {986 pub fn @"return"(comptime s2: type, rs1: Register, rs2: s2) Instruction {
987 return switch(s2) {987 return switch (s2) {
988 Register => format3c(0b10, 0b11_1001, rs1, rs2),988 Register => format3c(0b10, 0b11_1001, rs1, rs2),
989 i13 => format3d(0b10, 0b11_1001, rs1, rs2),989 i13 => format3d(0b10, 0b11_1001, rs1, rs2),
990 else => unreachable,990 else => unreachable,
...@@ -992,7 +992,7 @@ pub const Instruction = union(enum) {...@@ -992,7 +992,7 @@ pub const Instruction = union(enum) {
992 }992 }
993993
994 pub fn save(comptime s2: type, rs1: Register, rs2: s2, rd: Register) Instruction {994 pub fn save(comptime s2: type, rs1: Register, rs2: s2, rd: Register) Instruction {
995 return switch(s2) {995 return switch (s2) {
996 Register => format3a(0b10, 0b11_1100, rs1, rs2, rd),996 Register => format3a(0b10, 0b11_1100, rs1, rs2, rd),
997 i13 => format3b(0b10, 0b11_1100, rs1, rs2, rd),997 i13 => format3b(0b10, 0b11_1100, rs1, rs2, rd),
998 else => unreachable,998 else => unreachable,
...@@ -1000,7 +1000,7 @@ pub const Instruction = union(enum) {...@@ -1000,7 +1000,7 @@ pub const Instruction = union(enum) {
1000 }1000 }
10011001
1002 pub fn restore(comptime s2: type, rs1: Register, rs2: s2, rd: Register) Instruction {1002 pub fn restore(comptime s2: type, rs1: Register, rs2: s2, rd: Register) Instruction {
1003 return switch(s2) {1003 return switch (s2) {
1004 Register => format3a(0b10, 0b11_1101, rs1, rs2, rd),1004 Register => format3a(0b10, 0b11_1101, rs1, rs2, rd),
1005 i13 => format3b(0b10, 0b11_1101, rs1, rs2, rd),1005 i13 => format3b(0b10, 0b11_1101, rs1, rs2, rd),
1006 else => unreachable,1006 else => unreachable,
...@@ -1012,7 +1012,7 @@ pub const Instruction = union(enum) {...@@ -1012,7 +1012,7 @@ pub const Instruction = union(enum) {
1012 }1012 }
10131013
1014 pub fn sub(comptime s2: type, rs1: Register, rs2: s2, rd: Register) Instruction {1014 pub fn sub(comptime s2: type, rs1: Register, rs2: s2, rd: Register) Instruction {
1015 return switch(s2) {1015 return switch (s2) {
1016 Register => format3a(0b10, 0b00_0100, rs1, rs2, rd),1016 Register => format3a(0b10, 0b00_0100, rs1, rs2, rd),
1017 i13 => format3b(0b10, 0b00_0100, rs1, rs2, rd),1017 i13 => format3b(0b10, 0b00_0100, rs1, rs2, rd),
1018 else => unreachable,1018 else => unreachable,
...@@ -1021,7 +1021,7 @@ pub const Instruction = union(enum) {...@@ -1021,7 +1021,7 @@ pub const Instruction = union(enum) {
10211021
1022 pub fn trap(comptime s2: type, cond: Condition, ccr: CCR, rs1: Register, rs2: s2) Instruction {1022 pub fn trap(comptime s2: type, cond: Condition, ccr: CCR, rs1: Register, rs2: s2) Instruction {
1023 // Tcc instructions abuse the rd field to store the conditionals.1023 // Tcc instructions abuse the rd field to store the conditionals.
1024 return switch(s2) {1024 return switch (s2) {
1025 Register => format4a(0b11_1010, ccr, rs1, rs2, @intToEnum(Register, cond)),1025 Register => format4a(0b11_1010, ccr, rs1, rs2, @intToEnum(Register, cond)),
1026 u7 => format4e(0b00_0100, ccr, rs1, @intToEnum(Register, cond), rs2),1026 u7 => format4e(0b00_0100, ccr, rs1, @intToEnum(Register, cond), rs2),
1027 else => unreachable,1027 else => unreachable,