sparc: Solaris fixes, part 2 /bin/as seems to only understand single-digit labels /bin/as knows nothing about .rept/.endr
1 2 3 4 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
diff --git a/src/sparc/v8.S b/src/sparc/v8.S
index 3b5bab2..f675151 100644
--- a/src/sparc/v8.S
+++ b/src/sparc/v8.S
@@ -177,7 +177,7 @@ E(SPARC_RET_F_2)
restore
E(SP_V8_RET_CPLX8)
stb %o0, [%i2+1]
- b 10f
+ b 0f
srl %o0, 8, %o0
E(SPARC_RET_F_1)
st %f0, [%i2]
@@ -189,7 +189,7 @@ E(SPARC_RET_F_1)
ret
restore
.align 8
-10: stb %o0, [%i2]
+0: stb %o0, [%i2]
ret
restore
@@ -202,17 +202,35 @@ E(SPARC_RET_F_1)
sll %l1, 2, %l0 ! size * 4
1: sll %l1, 4, %l1 ! size * 16
add %l0, %l1, %l0 ! size * 20
- add %o7, %l0, %o7 ! o7 = 0b + size*20
+ add %o7, %l0, %o7 ! o7 = 8b + size*20
jmp %o7+(2f-8b)
mov %i5, %g2 ! load static chain
2:
-.rept 0x1000
- call %i1
- nop
- unimp (. - 2b) / 20
- ret
+
+/* The Sun assembler doesn't understand .rept 0x1000. */
+#define rept1 \
+ call %i1; \
+ nop; \
+ unimp (. - 2b) / 20; \
+ ret; \
restore
-.endr
+
+#define rept16 \
+ rept1; rept1; rept1; rept1; \
+ rept1; rept1; rept1; rept1; \
+ rept1; rept1; rept1; rept1; \
+ rept1; rept1; rept1; rept1
+
+#define rept256 \
+ rept16; rept16; rept16; rept16; \
+ rept16; rept16; rept16; rept16; \
+ rept16; rept16; rept16; rept16; \
+ rept16; rept16; rept16; rept16
+
+ rept256; rept256; rept256; rept256
+ rept256; rept256; rept256; rept256
+ rept256; rept256; rept256; rept256
+ rept256; rept256; rept256; rept256
cfi_endproc
.size C(ffi_call_v8),. - C(ffi_call_v8)