X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=README.md;h=496d3957e442c5a064c9cd3ed10c416de63e9e41;hp=4804bd7ca79e980a022a261d7658bb3f78ff2564;hb=b6c89d9ffbb08c5286448de4773290f0924a420b;hpb=ecc362e702b77d5c1334656e6f4dc9b17abcb767 diff --git a/README.md b/README.md index 4804bd7..496d395 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,62 @@ which will in turn start dosbox, which will execute the DOS binary! If the gods are slumbering in valhalla, just typing `dosbox demo.exe` should do the trick. -SDL backend ------------ -Run make to build (assuming make on your system is GNU make). +Building and running with the SDL backend +----------------------------------------- +Run make to build (assuming make on your system is GNU make), or use the visual +studio 2013 project on Windows. The SDL backend will scale the framebuffer up, by the factor specified in the `FBSCALE` environment variable. So run the demo as: `FBSCALE=3 ./demo` for a 3x scale factor, or just export the `FBSCALE` env var in the shell you are going to use for running the demo. The default scale factor is 2x. + +Datafiles +--------- +The demo datafiles are in their own subversion repo. To checkout the data files +run the following in the demo root directory: + + svn co svn://mutantstargoat.com/datadirs/dosdemo data + +Random optimization details about the Pentium1 (p54c) +----------------------------------------------------- +Use cround64 (util.h) for float -> integer conversions, instead of casts. + +Performance measurement with RDTSC: + perf_start(); + /* code under test */ + perf_end(); /* result in perf_interval_count */ + +Cache organization (L1): 8kb data / 8kb instruction +128 sets of 2 cache lines, 32 bytes per cache line. + +Addresses which are multiples of 4096 fall in the same set and can only have +two of them in cache at any time. + +U/V pipe pairing rules: + - both instructions must be simple + - no read-after-write or write-after-write reg dependencies + - no displacement AND immediate in either instruction + - instr. with prefixes (except 0x0f) can only run on U pipe. + - prefixes are treated as separate 1-byte instructions (except 0x0f). + - branches can be paired if they are the second instr. of the pair only. + +Simple instructions are: + - mov reg, reg/mem/imm + - mov mem, reg/imm + - alu reg, reg/mem/imm (alu: add/sub/cmp/and/or/xor) + - alu mem, reg/imm + - inc reg/mem + - dec reg/mem + - push reg/mem + - pop reg + - lea reg,mem + - jmp/call/jcc near + - nop + - test reg,reg/mem + - test acc,imm + +U-only pairable instructions: + - adc, sbb + - shr, sar, shl, sal with immediate + - ror, rol, rcr, rcl with immediate=1