summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2009-12-09 02:57:24 +0100
committerTor Andersson <tor@ghostscript.com>2009-12-09 02:57:24 +0100
commitf818b6deae9981bf5dac84ef0d3864b9605fa5d1 (patch)
tree308c258bcb9ea7c8af3631780058eed97aca0cc1
parent030fdf11695e619ae24f1b42790b697cd33b84b8 (diff)
downloadmupdf-f818b6deae9981bf5dac84ef0d3864b9605fa5d1.tar.xz
Add some inline asm directives to the output of fontdump that will speed up the compilation of the font binary blobs significantly. This only affects linux for now since darwin still has a stone age version of gas, and I don't know enough about windows.
-rw-r--r--mupdf/fontdump.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/mupdf/fontdump.c b/mupdf/fontdump.c
index 88d75bc5..7fd31af0 100644
--- a/mupdf/fontdump.c
+++ b/mupdf/fontdump.c
@@ -70,16 +70,25 @@ main(int argc, char **argv)
p ++;
}
- fprintf(fo, "const unsigned char pdf_font_%s_buf[] = {\n", name);
+ fseek(fi, 0, SEEK_END);
+ len = ftell(fi);
+ fseek(fi, 0, SEEK_SET);
- len = hexdump(fo, fi);
+ fprintf(fo, "const unsigned int pdf_font_%s_len = %d;\n", name, len);
+ fprintf(fo, "#ifdef __linux__\n");
+ fprintf(fo, "asm(\".globl pdf_font_%s_buf\");\n", name);
+ fprintf(fo, "asm(\".balign 8\");\n");
+ fprintf(fo, "asm(\"pdf_font_%s_buf:\");\n", name);
+ fprintf(fo, "asm(\".incbin \\\"%s\\\"\");\n", argv[i]);
+ fprintf(fo, "#else\n");
+ fprintf(fo, "const unsigned char pdf_font_%s_buf[%d] = {\n", name, len);
+ hexdump(fo, fi);
fprintf(fo, "};\n");
- fprintf(fo, "const unsigned int pdf_font_%s_len = %d;\n", name, len);
+ fprintf(fo, "#endif\n");
fclose(fi);
}
return 0;
}
-