1. Dave Cheney
  2. go-debian-kfreebsd

Commits

minux  committed 8f08ef4 Draft

5l, runtime: remove softfloat emulation code when not used
This leads to ~30kB improvement on code size for ARM machines with VFP/NEON.
Example: go test -c math
GOARM=5 GOARM=6
Old: 18842001839144
New: 18841651805245
-: 35 33899

R=rsc, bradfitz, dave, kai.backman
CC=golang-dev
http://codereview.appspot.com/5975060

  • Participants
  • Parent commits ea56641
  • Branches default

Comments (0)

Files changed (2)

File src/cmd/5l/obj.c

View file
  • Ignore whitespace
  *	-Hlinux -Tx -Rx			is linux elf
  */
 
-static char*
-linkername[] =
-{
-	"runtime.softfloat",
-	"math.sqrtGoC",
-};
-
 void
 usage(void)
 {
 void
 main(int argc, char *argv[])
 {
-	int c, i;
+	int c;
 	char *p, *name, *val;
 
 	Binit(&bso, 1, OWRITE);
 	loadlib();
 
 	// mark some functions that are only referenced after linker code editing
-	// TODO(kaib): this doesn't work, the prog can't be found in runtime
-	for(i=0; i<nelem(linkername); i++)
-		mark(lookup(linkername[i], 0));
+	if(debug['F'])
+		mark(rlookup("_sfloat", 0));
 	deadcode();
 	if(textp == nil) {
 		diag("no code");

File src/pkg/runtime/asm_arm.s

View file
  • Ignore whitespace
 	MOVW	$1234, R0
 	MOVW	$1000, R1
 	MOVW	R0, (R1)	// fail hard
-	B	runtime·_dep_dummy(SB)	// Never reached
-
-// TODO(kaib): remove these once i actually understand how the linker removes symbols
-// pull in dummy dependencies
-TEXT runtime·_dep_dummy(SB),7,$0
-	BL	_div(SB)
-	BL	_divu(SB)
-	BL	_mod(SB)
-	BL	_modu(SB)
-	BL	_modu(SB)
-	BL	_sfloat(SB)
 
 TEXT runtime·breakpoint(SB),7,$0
 	// no breakpoint yet; let program exit