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) {
785785 };
786786 }
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 {
789789 const ccr_cc1 = @truncate(u1, @enumToInt(ccr) >> 1);
790790 const ccr_cc0 = @truncate(u1, @enumToInt(ccr));
791791 return Instruction{
......@@ -800,7 +800,7 @@ pub const Instruction = union(enum) {
800800 };
801801 }
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 {
804804 const ccr_cc1 = @truncate(u1, @enumToInt(ccr) >> 1);
805805 const ccr_cc0 = @truncate(u1, @enumToInt(ccr));
806806 return Instruction{
......@@ -815,7 +815,7 @@ pub const Instruction = union(enum) {
815815 };
816816 }
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 {
819819 const ccr_cc2 = @truncate(u1, @enumToInt(ccr) >> 2);
820820 const ccr_cc1 = @truncate(u1, @enumToInt(ccr) >> 1);
821821 const ccr_cc0 = @truncate(u1, @enumToInt(ccr));
......@@ -832,7 +832,7 @@ pub const Instruction = union(enum) {
832832 };
833833 }
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 {
836836 const ccr_cc2 = @truncate(u1, @enumToInt(ccr) >> 2);
837837 const ccr_cc1 = @truncate(u1, @enumToInt(ccr) >> 1);
838838 const ccr_cc0 = @truncate(u1, @enumToInt(ccr));
......@@ -849,7 +849,7 @@ pub const Instruction = union(enum) {
849849 };
850850 }
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 {
853853 const ccr_cc1 = @truncate(u1, @enumToInt(ccr) >> 1);
854854 const ccr_cc0 = @truncate(u1, @enumToInt(ccr));
855855 return Instruction{
......@@ -864,7 +864,14 @@ pub const Instruction = union(enum) {
864864 };
865865 }
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 {
868875 return Instruction{
869876 .format4f = .{
870877 .rd = rd.enc(),
......@@ -877,7 +884,7 @@ pub const Instruction = union(enum) {
877884 };
878885 }
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 {
881888 return Instruction{
882889 .format4g = .{
883890 .rd = rd.enc(),