authorgravatar for koachan@protonmail.comKoakuma <koachan@protonmail.com> 2022-03-14 22:45:15+07:00
committergravatar for koachan@protonmail.comKoakuma <koachan@protonmail.com> 2022-03-16 21:38:44+07:00
logd6a35500e5afdbd26c8af4263f2167eb27c1b7e9
tree41ed36d521b44408d814f94c5b959511a09302bc
parent1d4b9f44ed4bc2a7e30cee74372cb19b545a0aa4

stage2 sparcv9: Reorder Format 4 wrappers too


1 files changed, 14 insertions(+), 7 deletions(-)

src/arch/sparcv9/bits.zig+14-7
...@@ -785,7 +785,7 @@ pub const Instruction = union(enum) {...@@ -785,7 +785,7 @@ pub const Instruction = union(enum) {
785 };785 };
786 }786 }
787787
788 fn format4a(rd: Register, op3: u6, rs1: Register, ccr: CCR, rs2: Register) Instruction {788 fn format4a(op3: u6, ccr: CCR, rs1: Register, rs2: Register, rd: Register) Instruction {
789 const ccr_cc1 = @truncate(u1, @enumToInt(ccr) >> 1);789 const ccr_cc1 = @truncate(u1, @enumToInt(ccr) >> 1);
790 const ccr_cc0 = @truncate(u1, @enumToInt(ccr));790 const ccr_cc0 = @truncate(u1, @enumToInt(ccr));
791 return Instruction{791 return Instruction{
...@@ -800,7 +800,7 @@ pub const Instruction = union(enum) {...@@ -800,7 +800,7 @@ pub const Instruction = union(enum) {
800 };800 };
801 }801 }
802802
803 fn format4b(rd: Register, op3: u6, rs1: Register, ccr: CCR, imm: i11) Instruction {803 fn format4b(op3: u6, ccr: CCR, rs1: Register, imm: i11, rd: Register) Instruction {
804 const ccr_cc1 = @truncate(u1, @enumToInt(ccr) >> 1);804 const ccr_cc1 = @truncate(u1, @enumToInt(ccr) >> 1);
805 const ccr_cc0 = @truncate(u1, @enumToInt(ccr));805 const ccr_cc0 = @truncate(u1, @enumToInt(ccr));
806 return Instruction{806 return Instruction{
...@@ -815,7 +815,7 @@ pub const Instruction = union(enum) {...@@ -815,7 +815,7 @@ pub const Instruction = union(enum) {
815 };815 };
816 }816 }
817817
818 fn format4c(rd: Register, op3: u6, ccr: CCR, cond: Condition, rs2: Register) Instruction {818 fn format4c(op3: u6, cond: Condition, ccr: CCR, rs2: Register, rd: Register) Instruction {
819 const ccr_cc2 = @truncate(u1, @enumToInt(ccr) >> 2);819 const ccr_cc2 = @truncate(u1, @enumToInt(ccr) >> 2);
820 const ccr_cc1 = @truncate(u1, @enumToInt(ccr) >> 1);820 const ccr_cc1 = @truncate(u1, @enumToInt(ccr) >> 1);
821 const ccr_cc0 = @truncate(u1, @enumToInt(ccr));821 const ccr_cc0 = @truncate(u1, @enumToInt(ccr));
...@@ -832,7 +832,7 @@ pub const Instruction = union(enum) {...@@ -832,7 +832,7 @@ pub const Instruction = union(enum) {
832 };832 };
833 }833 }
834834
835 fn format4d(rd: Register, op3: u6, ccr: CCR, cond: Condition, imm: i11) Instruction {835 fn format4d(op3: u6, cond: Condition, ccr: CCR, imm: i11, rd: Register) Instruction {
836 const ccr_cc2 = @truncate(u1, @enumToInt(ccr) >> 2);836 const ccr_cc2 = @truncate(u1, @enumToInt(ccr) >> 2);
837 const ccr_cc1 = @truncate(u1, @enumToInt(ccr) >> 1);837 const ccr_cc1 = @truncate(u1, @enumToInt(ccr) >> 1);
838 const ccr_cc0 = @truncate(u1, @enumToInt(ccr));838 const ccr_cc0 = @truncate(u1, @enumToInt(ccr));
...@@ -849,7 +849,7 @@ pub const Instruction = union(enum) {...@@ -849,7 +849,7 @@ pub const Instruction = union(enum) {
849 };849 };
850 }850 }
851851
852 fn format4e(rd: Register, op3: u6, rs1: Register, ccr: CCR, sw_trap: u7) Instruction {852 fn format4e(op3: u6, ccr: CCR, rs1: Register, rd: Register, sw_trap: u7) Instruction {
853 const ccr_cc1 = @truncate(u1, @enumToInt(ccr) >> 1);853 const ccr_cc1 = @truncate(u1, @enumToInt(ccr) >> 1);
854 const ccr_cc0 = @truncate(u1, @enumToInt(ccr));854 const ccr_cc0 = @truncate(u1, @enumToInt(ccr));
855 return Instruction{855 return Instruction{
...@@ -864,7 +864,14 @@ pub const Instruction = union(enum) {...@@ -864,7 +864,14 @@ pub const Instruction = union(enum) {
864 };864 };
865 }865 }
866866
867 fn format4f(rd: Register, op3: u6, rs1: Register, rcond: RCondition, opf_low: u5, rs2: Register) Instruction {867 fn format4f(
868 op3: u6,
869 opf_low: u5,
870 rcond: RCondition,
871 rs1: Register,
872 rs2: Register,
873 rd: Register,
874 ) Instruction {
868 return Instruction{875 return Instruction{
869 .format4f = .{876 .format4f = .{
870 .rd = rd.enc(),877 .rd = rd.enc(),
...@@ -877,7 +884,7 @@ pub const Instruction = union(enum) {...@@ -877,7 +884,7 @@ pub const Instruction = union(enum) {
877 };884 };
878 }885 }
879886
880 fn format4g(rd: Register, op3: u6, cond: Condition, opf_cc: u3, opf_low: u6, rs2: Register) Instruction {887 fn format4g(op3: u6, opf_low: u6, opf_cc: u3, cond: Condition, rs2: Register, rd: Register) Instruction {
881 return Instruction{888 return Instruction{
882 .format4g = .{889 .format4g = .{
883 .rd = rd.enc(),890 .rd = rd.enc(),