aboutsummaryrefslogtreecommitdiffhomepage
path: root/compiler/defer.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2024-06-24 20:22:16 +0200
committerRon Evans <[email protected]>2024-07-22 16:21:26 +0200
commit725518f007663d6742f1e92ebc2d6d88418ccf61 (patch)
tree01489f64270419ddb28520cd040b24babddab475 /compiler/defer.go
parent04d1261f8a48b18a4404c52f858c35c0668316cd (diff)
downloadtinygo-725518f007663d6742f1e92ebc2d6d88418ccf61.tar.gz
tinygo-725518f007663d6742f1e92ebc2d6d88418ccf61.zip
all: add linux/mipsle support
This adds linux/mipsle (little endian Mips) support to TinyGo. It also adds experimental linux/mips (big-endian) support. It doesn't quite work yet, some parts of the standard library (like the reflect package) currently seem to assume a little-endian system.
Diffstat (limited to 'compiler/defer.go')
-rw-r--r--compiler/defer.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/defer.go b/compiler/defer.go
index e1ff2f58e..df8686957 100644
--- a/compiler/defer.go
+++ b/compiler/defer.go
@@ -187,6 +187,18 @@ std z+5, r29
ldi r24, 0
1:`
constraints = "={r24},z,~{r0},~{r2},~{r3},~{r4},~{r5},~{r6},~{r7},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{r16},~{r17},~{r18},~{r19},~{r20},~{r21},~{r22},~{r23},~{r25},~{r26},~{r27}"
+ case "mips":
+ // $4 flag (zero or non-zero)
+ // $5 defer frame
+ asmString = `
+.set noat
+move $$4, $$zero
+jal 1f
+1:
+addiu $$ra, 8
+sw $$ra, 4($$5)
+.set at`
+ constraints = "={$4},{$5},~{$1},~{$2},~{$3},~{$5},~{$6},~{$7},~{$8},~{$9},~{$10},~{$11},~{$12},~{$13},~{$14},~{$15},~{$16},~{$17},~{$18},~{$19},~{$20},~{$21},~{$22},~{$23},~{$24},~{$25},~{$26},~{$27},~{$28},~{$29},~{$30},~{$31},~{$f0},~{$f1},~{$f2},~{$f3},~{$f4},~{$f5},~{$f6},~{$f7},~{$f8},~{$f9},~{$f10},~{$f11},~{$f12},~{$f13},~{$f14},~{$f15},~{$f16},~{$f17},~{$f18},~{$f19},~{$f20},~{$f21},~{$f22},~{$f23},~{$f24},~{$f25},~{$f26},~{$f27},~{$f28},~{$f29},~{$f30},~{$f31},~{memory}"
case "riscv32":
asmString = `
la a2, 1f