Skip to content

Support GOARCH=mips64 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6222467
Revert "cmd/internal/obj/mips: add SEB/SEH instructions"
clktmr May 22, 2024
125928e
Revert "cmd/internal/obj/mips: add WSBH/DSBH/DSHD instructions"
clktmr May 22, 2024
c13271c
Revert "cmd/asm: add MIPS MSA LD/ST/LDI support for mips64x"
clktmr Oct 2, 2023
1a2d221
Revert "runtime: improve MIPS64x memclr"
clktmr Oct 2, 2023
f82253e
Remove MUL instruction, unsupported in MIPS-III
clktmr Oct 17, 2023
caf77a1
First steps for mips support
clktmr Sep 27, 2023
8d2c243
move entry function to beginning of text section
clktmr Sep 30, 2023
c9f68a3
Implement _rt0_mips64_noos and rt0_go
clktmr Oct 7, 2023
6d41f48
First draft for interrupt handler
clktmr Oct 13, 2023
2837de6
rework implementation of inthandler
clktmr Oct 16, 2023
29c8a19
Save a few cycles in creg access
clktmr Oct 17, 2023
7b524bd
Use SW interrupts for signaling newwork()
clktmr Oct 19, 2023
eb3e450
Simple default write for debugging
clktmr Oct 19, 2023
b1021ca
Support user interrupt vectors
clktmr Oct 22, 2023
06704ea
Fix hardware interrupt handler
clktmr Oct 24, 2023
6516cca
Refactor inthandler in preparation for nested IRQ
clktmr Oct 24, 2023
4dbf8e6
Reimplement context saving for external irqs
clktmr Oct 24, 2023
287f9a8
Fix save/restoreGPRs by including R23
clktmr Oct 24, 2023
da434ec
Save and restore status register
clktmr Nov 8, 2023
ef0642a
Remove broken setAlarm() implementation
clktmr Nov 18, 2023
8283719
Mitigate sign-extended pointers with TLB
clktmr Nov 18, 2023
6f00840
Don't allow preempting the scheduler for now
clktmr Nov 18, 2023
430c3cb
Add makeshift USB logging
clktmr Nov 18, 2023
298a74f
Revert "Add makeshift USB logging"
clktmr Jun 11, 2024
4372382
Fix CP0 hazards of ERET
clktmr Nov 18, 2023
9fc8ef8
Declare interrupt handler in go files
clktmr May 22, 2024
4fd5ff8
Fix instruction for accessing boolean variable
clktmr May 22, 2024
fd80e6d
Fix error message strings
clktmr May 27, 2024
704da87
Increase space for non-heap allocations
clktmr Jun 10, 2024
ac7609e
Make sure dummyNanotime doesn't block in usleep()
clktmr Jun 12, 2024
9e816c3
Add dependency to target specific machine package
clktmr Jun 12, 2024
738945e
Remove incorrect uncached memory accesses
clktmr Jun 12, 2024
225f0ca
Use Go register notation
clktmr Jun 12, 2024
d4607ca
Implement meminit in Go instead of assembly
clktmr Jun 13, 2024
4d92f70
Cleanup asm_mips64.h
clktmr Jun 13, 2024
53f6232
Allow target specific unhandled exception handler
clktmr Jun 18, 2024
2cb2829
Cleanup tasker implementation
clktmr Jun 19, 2024
08feb8a
Use only one of the two SW interrupts
clktmr Jun 19, 2024
80103c5
Consistent naming
clktmr Jun 19, 2024
4bea3f6
Rework nested exceptions
clktmr Jun 19, 2024
f31c852
Handle fast syscalls properly
clktmr Jun 19, 2024
6c2b71d
Improve documentation
clktmr Jun 20, 2024
c13d8c9
Make context restoration preemptable if possbile
clktmr Jun 20, 2024
d4e2e31
Remove unreachable code
clktmr Jun 20, 2024
be0dfbb
Allow nesting only for external interrupts
clktmr Jun 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/cmd/asm/internal/arch/arch.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,6 @@ func archMips64(linkArch *obj.LinkArch) *Arch {
for i := mips.REG_FCR0; i <= mips.REG_FCR31; i++ {
register[obj.Rconv(i)] = int16(i)
}
for i := mips.REG_W0; i <= mips.REG_W31; i++ {
register[obj.Rconv(i)] = int16(i)
}
register["HI"] = mips.REG_HI
register["LO"] = mips.REG_LO
// Pseudo-registers.
Expand All @@ -491,7 +488,6 @@ func archMips64(linkArch *obj.LinkArch) *Arch {
"FCR": true,
"M": true,
"R": true,
"W": true,
}

instructions := make(map[string]obj.As)
Expand Down
4 changes: 0 additions & 4 deletions src/cmd/asm/internal/arch/mips.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ func mipsRegisterNumber(name string, n int16) (int16, bool) {
if 0 <= n && n <= 31 {
return mips.REG_R0 + n, true
}
case "W":
if 0 <= n && n <= 31 {
return mips.REG_W0 + n, true
}
}
return 0, false
}
5 changes: 0 additions & 5 deletions src/cmd/asm/internal/asm/testdata/mips.s
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,6 @@ label4:
CLZ R1, R2 // 70221020
CLO R1, R2 // 70221021

WSBH R1, R2 // 7c0110a0

SEB R1, R2 // 7c011420
SEH R1, R2 // 7c011620

// to (Hi, Lo)
MADD R2, R1 // 70220000
MSUB R2, R1 // 70220004
Expand Down
42 changes: 0 additions & 42 deletions src/cmd/asm/internal/asm/testdata/mips64.s
Original file line number Diff line number Diff line change
Expand Up @@ -587,50 +587,8 @@ label4:
CALL foo(SB)
RET foo(SB)

// unary operation
NEGW R1, R2 // 00011023
NEGV R1, R2 // 0001102f

WSBH R1, R2 // 7c0110a0
DSBH R1, R2 // 7c0110a4
DSHD R1, R2 // 7c011164

SEB R1, R2 // 7c011420
SEH R1, R2 // 7c011620

RET

// MSA VMOVI
VMOVB $511, W0 // 7b0ff807
VMOVH $24, W23 // 7b20c5c7
VMOVW $-24, W15 // 7b5f43c7
VMOVD $-511, W31 // 7b700fc7

VMOVB (R0), W8 // 78000220
VMOVB 511(R3), W0 // 79ff1820
VMOVB -512(R12), W21 // 7a006560
VMOVH (R24), W12 // 7800c321
VMOVH 110(R19), W8 // 78379a21
VMOVH -70(R12), W3 // 7bdd60e1
VMOVW (R3), W31 // 78001fe2
VMOVW 64(R20), W16 // 7810a422
VMOVW -104(R17), W24 // 7be68e22
VMOVD (R3), W2 // 780018a3
VMOVD 128(R23), W19 // 7810bce3
VMOVD -256(R31), W0 // 7be0f823

VMOVB W8, (R0) // 78000224
VMOVB W0, 511(R3) // 79ff1824
VMOVB W21, -512(R12) // 7a006564
VMOVH W12, (R24) // 7800c325
VMOVH W8, 110(R19) // 78379a25
VMOVH W3, -70(R12) // 7bdd60e5
VMOVW W31, (R3) // 78001fe6
VMOVW W16, 64(R20) // 7810a426
VMOVW W24, -104(R17) // 7be68e26
VMOVD W2, (R3) // 780018a7
VMOVD W19, 128(R23) // 7810bce7
VMOVD W0, -256(R31) // 7be0f827
RET

// END
Expand Down
1 change: 1 addition & 0 deletions src/cmd/dist/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,7 @@ var cgoEnabled = map[string]bool{
"windows/arm64": true,
"noos/thumb": false,
"noos/riscv64": false,
"noos/mips64": false,
}

// List of platforms that are marked as broken ports.
Expand Down
53 changes: 0 additions & 53 deletions src/cmd/internal/obj/mips/a.out.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const (
NSYM = 50
NREG = 32 /* number of general registers */
NFREG = 32 /* number of floating point registers */
NWREG = 32 /* number of MSA registers */
)

const (
Expand Down Expand Up @@ -181,41 +180,6 @@ const (
REG_FCR30
REG_FCR31

// MSA registers
// The lower bits of W registers are alias to F registers
REG_W0 // must be a multiple of 32
REG_W1
REG_W2
REG_W3
REG_W4
REG_W5
REG_W6
REG_W7
REG_W8
REG_W9
REG_W10
REG_W11
REG_W12
REG_W13
REG_W14
REG_W15
REG_W16
REG_W17
REG_W18
REG_W19
REG_W20
REG_W21
REG_W22
REG_W23
REG_W24
REG_W25
REG_W26
REG_W27
REG_W28
REG_W29
REG_W30
REG_W31

REG_HI
REG_LO

Expand Down Expand Up @@ -253,8 +217,6 @@ func init() {
f(REG_F0, REG_F31, 32) // For 32-bit MIPS, compiler only uses even numbered registers -- see cmd/compile/internal/ssa/gen/MIPSOps.go
MIPSDWARFRegisters[REG_HI] = 64
MIPSDWARFRegisters[REG_LO] = 65
// The lower bits of W registers are alias to F registers
f(REG_W0, REG_W31, 32)
}

const (
Expand All @@ -281,7 +243,6 @@ const (
C_FREG
C_FCREG
C_MREG /* special processor register */
C_WREG /* MSA registers */
C_HI
C_LO
C_ZCON
Expand Down Expand Up @@ -394,8 +355,6 @@ const (
AROTRV
ASC
ASCV
ASEB
ASEH
ASGT
ASGTU
ASLL
Expand All @@ -417,7 +376,6 @@ const (
ATLBWR
ATNE
AWORD
AWSBH
AXOR

/* 64-bit */
Expand All @@ -437,8 +395,6 @@ const (
AADDVU
ASUBV
ASUBVU
ADSBH
ADSHD

/* 64-bit FP */
ATRUNCFV
Expand All @@ -451,12 +407,6 @@ const (
AMOVVF
AMOVVD

/* MSA */
AVMOVB
AVMOVH
AVMOVW
AVMOVD

ALAST

// aliases
Expand All @@ -482,7 +432,4 @@ func init() {
if REG_FCR0%32 != 0 {
panic("REG_FCR0 is not a multiple of 32")
}
if REG_W0%32 != 0 {
panic("REG_W0 is not a multiple of 32")
}
}
9 changes: 0 additions & 9 deletions src/cmd/internal/obj/mips/anames.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/cmd/internal/obj/mips/anames0.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ var cnames0 = []string{
"FREG",
"FCREG",
"MREG",
"WREG",
"HI",
"LO",
"ZCON",
Expand Down
Loading