Commit graph

526 commits

Author SHA1 Message Date
Fabian 7d627ac13a Make tests a bit more robust 2020-08-30 19:29:53 -05:00
Fabian c108aaaadd Extend qemu paging tests with cross-page page faults 2020-08-30 19:29:53 -05:00
Fabian 510c6c186b qemu tests: More sse shift tests 2020-08-30 19:29:53 -05:00
Fabian 9bd1e30439 qemu tests: Re-enable some sse tests and reduce diff between upstream version 2020-08-30 19:29:53 -05:00
Fabian a7c25c423e nasmtests: Add timeout and clarify 2020-08-30 19:29:53 -05:00
Fabian 1ee5895c44 api test: Print error 2020-08-30 19:29:53 -05:00
Fabian f43ab3387a Remove use of cpu exceptions for trigger_gp for instructions 2020-08-30 19:29:53 -05:00
Fabian 4ee7da8f83 Remove use of cpu exceptions for divisions 2020-08-30 19:29:53 -05:00
Ernest Wong a538ba9960 Fix 9p caps test and add tests for xattr 2020-08-30 19:29:53 -05:00
Awal Garg b3e415cf9f jit inline 0xC3 2020-08-30 19:29:53 -05:00
Awal Garg 9224fc3878 jit inline 0xEB 2020-08-30 19:29:53 -05:00
Ernest Wong 5ec59fa019 Increase 9p tests' timeouts 2020-08-30 19:29:51 -05:00
Fabian 766c50b6fb Enable api tests 2020-08-30 19:29:13 -05:00
Fabian e0d3ebd6bc Test for atime of new files 2020-08-30 19:29:13 -05:00
Fabian 5df3b702ab Nasmtests: Fix gdb execution on docker 2020-08-30 19:29:13 -05:00
Fabian b74869dc67 Don't initialise loop counter when it's not used 2020-08-30 19:29:13 -05:00
Fabian 1253b72906 Generate prefix handling for string instructions 2020-08-30 19:29:13 -05:00
Fabian 3a8d644d75 Port jit to Rust
The following files and functions were ported:
- jit.c
- codegen.c
- _jit functions in instructions*.c and misc_instr.c
- generate_{analyzer,jit}.js (produces Rust code)
- jit_* from cpu.c

And the following data structures:
- hot_code_addresses
- wasm_table_index_free_list
- entry_points
- jit_cache_array
- page_first_jit_cache_entry

Other miscellaneous changes:
- Page is an abstract type
- Addresses, locals and bitflags are unsigned
- Make the number of entry points a growable type
- Avoid use of global state wherever possible
- Delete string packing
- Make CachedStateFlags abstract
- Make AnalysisType product type
- Make BasicBlockType product type
- Restore opcode assertion
- Set opt-level=2 in debug mode (for test performance)
- Delete JIT_ALWAYS instrumentation (now possible via api)
- Refactor generate_analyzer.js
- Refactor generate_jit.js
2020-08-30 19:29:13 -05:00
Ernest Wong 30a72e5874 Filesystem tests: include newlines in capture
- keep empty lines
- handle word wraps
- remove extra space in assert failure logging
2020-08-30 19:29:13 -05:00
Ernest Wong 72a4dc6448 Filesystem tests tidyup and ls --color=never 2020-08-30 19:29:13 -05:00
Ernest Wong 496e63f76e Add walk to filesystem stress test 2020-08-30 19:29:13 -05:00
Ernest Wong 8c6bfdb6da Minor improvements to filesystem tests 2020-08-30 19:29:13 -05:00
Ernest Wong 42d21bde56 Extend 9p tests to cover most file system calls 2020-08-30 19:29:02 -05:00
Fabian 3812cb5489 Update expect tests due to following of call instructions 2020-08-30 19:27:07 -05:00
Fabian 793c68a501 Update expect tests due to optimisation of memory writes 2020-08-30 19:27:07 -05:00
Fabian 8ac1e2a995 Update expect tests due to optimisation of loop iterations 2020-08-30 19:27:07 -05:00
Fabian f8dd22cf04 Expect test: Accept tests interactively (#15) 2020-08-30 19:27:07 -05:00
Fabian c06d141ea6 Run full tests in debug mode 2020-08-30 19:27:07 -05:00
Awal Garg f346fb2c7d increase freedos tests time limit to 20 seconds 2020-08-30 19:27:07 -05:00
Awal Garg 853bf477cc minor fixes 2020-08-30 19:27:07 -05:00
Awal Garg e33cc8f072 rust restructuring, some refactoring 2020-08-30 19:27:07 -05:00
Awal Garg 863c020785 delete codegen test 2020-08-30 19:27:07 -05:00
Awal Garg fc7f4b468c add wasmgen tests to makefile 2020-08-30 19:27:07 -05:00
Fabian 94b0376186 Remove timing profiler 2020-08-30 19:27:07 -05:00
Fabian 0cc47d72d1 nasmtests: Catch general protection error / sigsegv 2020-08-30 19:27:07 -05:00
Fabian c898611196 Regression tests for 8-bit jumps 2020-08-30 19:27:07 -05:00
Fabian c40a5ccf25 nasmtests: Put multiboot section early into binary 2020-08-30 19:27:07 -05:00
Fabian 67af8f55e1 nasmtests: Allow running specific test by name 2020-08-30 19:27:07 -05:00
Fabian f10dd50be6 Full test: Verbose mode 2020-08-30 19:27:07 -05:00
Fabian 2fcbfdaf19 Full test: Add extra time for more stability 2020-08-30 19:27:07 -05:00
Fabian e9eeba2248 Remove deprecated use of new Buffer 2020-08-30 19:27:07 -05:00
Ernest Wong 129269fc14 Add devices test to CI + update tests to linux4 2020-08-30 19:27:07 -05:00
Ernest Wong a75eb60e45 Use linux4 for virtio9p test + tidy up test logic 2020-08-30 19:27:07 -05:00
Ernest Wong 2bb5b194dc Fix virtio 9p tests
I wrongly assumed that libv86 would perform faster than libv86-debug.
Using libv86 caused ttyS0 to timeout before initialising, so there was
not serial terminal to use by the time debian booted.
2020-08-30 19:27:07 -05:00
Ernest Wong fe40ebc0f8 Add tests for virtio 9p (tests are currently incorrect)
These tests do not work yet: it fails to capture the serial output
after root login.

In addition, these tests are currently too slow to run
since it takes a while to boot the debian image (> 16 minutes on my
machine while running the test in the terminal.)

Would need to switch to a newer minimal linux image when available.
2020-08-30 19:27:07 -05:00
Fabian 4764d5b41e Set log level to zero (in case of running in debug mode) 2020-08-30 19:27:07 -05:00
Fabian 4423cf3010 Also test synchronous cdrom state saving/restoring (currently failing) 2020-08-30 19:27:07 -05:00
Fabian 617d962eba qemutests: More rounding tests 2020-08-30 19:27:07 -05:00
Fabian 7ba14bb47e Add debian-bytemark benchmark script 2020-08-30 19:27:07 -05:00
Amaan Cheval 3641bc3b87 codegen: Make SCALE_INDEX_FOR_ARRAY32 more specific and revert
This reverts commit b830fe8d7acb0f83c3c8a0febd7e172927ae2f46 and makes
the macro more specific
2020-08-30 19:27:07 -05:00
Amaan Cheval 96c095d381 codegen: Get rid of scale_by parameter and use log2(sizeof(arr[0])) 2020-08-30 19:27:07 -05:00
Amaan Cheval 80c9cdb9c1 codegen/gen_safe_write32: Use local-variable based arg passing
Stack based passing was needless given that we wanted the values in
local variables anyway and could simply have the caller do it.

We could have a minor optimization and have the caller gen_tee_local for
the address, but I chose not to do that because it seems like a minor
difference that complicates the calling convention
significantly (i.e. both set local variable and push to stack).
2020-08-30 19:27:07 -05:00
Amaan Cheval 7b259df48f cpu: Move tlb_data and page_first_jit_cache_entry to global_pointers
When they're stack-allocated, their addresses may change very easily,
even simply through updates in a header file that cpu.c includes.

This will make the expect-tests fail unnecessarily, simply because these
offsets changed.

In the future, we may change how memory handling works, so this may be a
non-issue then, but for now, it's easier to use a fixed offset for these
arrays.
2020-08-30 19:27:07 -05:00
Amaan Cheval 83e585c123 jit/instructions: Inline 0x89 "mov [mem], reg" for generated WASM 2020-08-30 19:27:07 -05:00
Amaan Cheval e3aab618af codegen: Update to 3 local scratch variables instead of 2 2020-08-30 19:27:07 -05:00
Amaan Cheval 1b8a856d7a codegen: Add missing mask for gen_safe_read32 2020-08-30 19:27:07 -05:00
Amaan Cheval c64c418b6f expect-tests: Split mov32 test into mov32-{reg,mem} files for readability 2020-08-30 19:27:07 -05:00
Amaan Cheval 5abcffd916 codegen: gen_store instead of gen_set_reg32_from_stack
The latter had more code to do the swap on the stack than to actually
store the value. Generating the store inline seems better.
2020-08-30 19:27:07 -05:00
Amaan Cheval c941a5e936 Minor: Fold expression at compile-time instead of generating code 2020-08-30 19:27:07 -05:00
Amaan Cheval 6b6dbcbad3 codegen: Fix assumption of aligned load from mem8
There is no guarantee that the load will actually be aligned, so we
ought to not assume it is.
2020-08-30 19:27:07 -05:00
Amaan Cheval 105b12ff98 codegen: Add memory offset parameters to aligned, unaligned loads
This way we don't need to generate the i32.add operations we had before
to access "arr[index_from_stack]" for eg.
2020-08-30 19:27:02 -05:00
Amaan Cheval db166cd703 jit/instructions: Inline 0x8b "mov reg, [mem]" for generated WASM 2020-08-30 19:27:02 -05:00
Amaan Cheval 8d55b34c5a codegen: Add 2 local scratch variables for easier inlining
WebAssembly has no "dup" operator (to duplicate the value on the top of
the stack), which means that if a value needs to be used twice, we need
to use a variable. We add 2 general-purpose local scratch variables to
this end.

Note: Users of the variable should be careful about interference with
other users - they may contain junk values, and between functions, the
state of a variable may well change.
2020-08-30 19:27:02 -05:00
Fabian 89a8b13b00 Add simple state test 2020-08-30 19:27:02 -05:00
Fabian 7201f9616d Delete unused stats 2020-08-30 19:27:02 -05:00
Fabian cba5491fc4 Multiple jit block entry points
- introduce multiple entry points per compiled wasm module, by passing
  the initial state to the generated function.
- continue analysing and compiling after instructions that change eip, but
  will eventually return to the next instruction, in particular CALLs
  (and generate an entry point for the following instruction)

This commit is incomplete in the sense that the container will crash
after some time of execution, as wasm table indices are never freed
2020-08-30 19:27:02 -05:00
Fabian ae2407a4dc Minor: Simplify and delete dead code 2020-08-30 19:27:02 -05:00
Fabian b2c46a9a67 Minor: Remove use of V86Starter 2020-08-30 19:27:02 -05:00
Amaan Cheval ccb9b6cbbf nasmtests: Re-enable 0x89 mem tests in mov16
The old method understandably triggered the 0x67 address-size override
prefix, which caused the segfault.

(Changed "mov [mem], ax" because that might use op 0xA3.)
2020-08-30 19:27:02 -05:00
Amaan Cheval 795ba8ad42 expect-tests: Improve error message and var name 2020-08-30 19:27:02 -05:00
Amaan Cheval 56e74baed0 nasmtests/jit: Regression test for mov16 (confirm 16-bit, not 32-bit)
This regression test will _NOT_ currently catch regressions in "make
nasmtests-force-jit" due to a pending issue where JIT execution doesn't
follow through the popf instruction, which this and most tests use
through header.inc.

To see the test actually fail, you need:
- To remove the popf instruction
- s/load_u16/load_i32/ in gen_set_reg16_r
2020-08-30 19:26:51 -05:00
Amaan Cheval 26dced841e expect-tests: Reduce is_32 sensitivity and warn about remaining tests 2020-07-21 20:10:14 -05:00
Amaan Cheval 81c09ef811 expect-tests: Write out raw wasm file too
This makes it easier to test the generated output with different
tools too, such as wasm-objdump, for eg.
2020-07-21 20:10:14 -05:00
Amaan Cheval 3b1d3ae91e expect-tests: Add mov16/mov32 fixtures for JIT
These tests confirm that the generated WAST:

1. Optimizes "mov reg, reg" with direct memory access stores, requiring
no function calls

2. Memory loads/stores use the correct data-width (i32.load16_u for
reg16, etc.)
2020-07-21 20:10:14 -05:00
Fabian f2274e0a60 Fix nasm test with forced jit
This is a (partial) fix for #8. It manually forces compilation of the
first set of basic blocks in the nasm tests, waits for the blocks to be
compiled and then runs the test. It doesn't make use of the fragile
compile-time machinery to force compilation.

Analysis currently doesn't follow execution after the popf instructions,
which is included in most tests. It has been manually verified that
tests pass when the popf instruction is compiled, and this limitation
will be lifted soon.

Analysis also doesn't follow through call and return instructions, so
nasm tests can't currently test these in their compiled form.
2020-07-21 20:10:14 -05:00
Fabian 5886077633 Minor cleanup 2020-07-21 20:10:14 -05:00
Fabian 73614108b7 Clarify that expect test uses flat binaries 2020-07-21 20:10:14 -05:00
Fabian 03a1351163 expect tests: Force creation of build dir before build 2020-07-21 20:10:14 -05:00
Fabian e6af9f3d7f Expect tests 2020-07-21 20:10:14 -05:00
Fabian 37f4a7da51 Make unhandled rejected promises fatal in tests 2020-07-21 20:10:14 -05:00
Fabian 30bb5e6968 Fix codegen tests 2020-07-21 20:10:14 -05:00
Fabian f7d7327753 qemu tests: Dump version 2020-07-21 20:10:14 -05:00
Amaan Cheval f6cceafac1 qemutests: Fix bug where test would hang forever sometimes
The stdout stream is not line-buffered, which means that occasionally the
chunk/Buffer of data that comes in immediately after we run the commands may be:

~% chmod +x /mnt/test-i386
~% /mnt/test-i386 > /mnt/result
~% echo test fini''shed
test finished
~%

Note how the data ends with the prompt, not in "test finished\n" - this will
cause the test to run indefinitely.
2020-07-21 20:10:14 -05:00
Amaan Cheval eb21d0203e style: Remove single quotes from ./tests/nasm/ 2020-07-21 20:10:14 -05:00
Amaan Cheval 52474abe58 test: Have integration test read from urandom to trigger JIT 2020-07-21 20:10:14 -05:00
Awal Garg 54a43ab437 improve segment prefix handling and custom code generation for lea 2020-07-21 20:10:14 -05:00
Fabian acfc4372c5 Use Westmere instead of max cpu for qemu (max is not available on older qemu versions) 2020-07-21 20:10:14 -05:00
Fabian 3cfce44363 Nasm: Jump tests 2020-07-21 20:10:14 -05:00
Fabian 0c2113d28c nasm: pop esp test 2020-07-21 20:10:14 -05:00
Fabian e0dc847ded Re-enable TEST_VM86 2020-07-21 20:10:14 -05:00
Fabian 4379e5ef3e Use qemu as a test oracle instead of the local machine
Recently distributions started disabling the CONFIG_MODIFY_LDT_SYSCALL
kernel config, breaking parts of the qemu test. qemu is very suitable to
run these tests in the same configuration as v86 (booting from
linux3.iso, exchanging files using 9p fs and controlling via serial
console).
2020-07-21 20:10:14 -05:00
Fabian f03b34ecd5 Handle missing modify_ldt syscall in qemu tests properly 2020-07-21 20:10:14 -05:00
Amaan Cheval b1787e5a0f Clean up push nasm test 2020-07-21 20:10:14 -05:00
Amaan Cheval b2e44e2340 NASM test for push [reg, r/m, imm] and pop reg are all tested
With ENABLE_JIT_ALWAYS set, it effectively tests all variants (is_32 +
imm/reg/rm) of the instruction.

Stack size variation should also be tested in the future.

See WASM dump for optimized versions here:

https://gist.github.com/AmaanC/c5c5f9d76bef589a7fbb0f4af3b15e64
2020-07-21 20:10:14 -05:00
Awal Garg cfad35612f add SYNC_GDB_EXECUTION flag 2020-07-21 20:10:14 -05:00
Amaan Cheval c3fa48e3fc Track stats for how many times the nonfaulting optimization is applied 2020-07-21 20:10:14 -05:00
Amaan Cheval 5c690d9de9 Update comment and fix line length 2020-07-21 20:10:14 -05:00
Amaan Cheval 158a697d67 s/scratch/instruction_body/ 2020-07-21 20:10:13 -05:00
Amaan Cheval 99098cc4df Remove _scratch from codegen function names.
This reverts parts of commit d779df89714ef784a1f0ebb264ed5b9fe8727fb1.
2020-07-21 20:10:13 -05:00
Amaan Cheval dbf0b7fa20 Add scratch buffer to codegen and refactor functions to indicate it
Since we can only know an instruction's length (and other characteristics) after
its been decoded, this change allows us to first decode the instruction and
generate the instruction function calls to a scratch buffer, which can then be
copied over to the main (cs) buffer as appropriate.

Tests for the scratch buffer were added too.
2020-07-21 20:10:13 -05:00
Fabian 86b8ac7b72 Add linux booting benchmark 2020-07-21 20:10:13 -05:00
Fabian 3e99913474 Catch signals in gdb instead of relying on the default printing 2020-07-21 20:10:13 -05:00
Fabian 26bb7c2caa Allocate more space for codegen buffers 2020-07-21 20:10:13 -05:00
Fabian a007fb690e Log fixture test when test was killed during execution 2020-07-21 20:10:13 -05:00
Fabian 87e1150acd Trailing comma 2020-07-21 20:10:13 -05:00
Amaan Cheval d505d7b936 Make JIT paging tests' mmap calls more robust (no SEGFAULT and better physical map)
1. SEGFAULTs may be caused by using MAP_FIXED - it may override an existing
mapping, which may exist for internal implementation helpers.

2. The Linux3 profile seems to allocate physical frames in the order in which
writes to memory mapped virtual addresses happen.

For this commit, for eg:

page0;     virtual=0xB7766000 physical=0x12C9000
throwaway; virtual=0xB7765000 physical=0x12C8000
page1;     virtual=0xB7767000 physical=0x12CC000

This way we can write from page0 -> page1's virtual addresses and make sure our
paging support works as it should, and that the tests aren't simply passing
because even the underlying physical frames are contiguous.
2020-07-21 20:10:13 -05:00
Amaan Cheval 89d80a5e3e Allocate enough space in page0 so that page1 can also fit
Without this, the MAP_FIXED call for page1 may cause a segfault by overwriting
an internally mapped structure.
2020-07-21 20:10:13 -05:00
Amaan Cheval 91cc94e556 Coverage Reporter: Log raw JSON data for additional analyses as well 2020-07-21 20:10:13 -05:00
Amaan Cheval 413468f0bb Make sure total_blocks is parsed as a number 2020-07-21 20:10:13 -05:00
Amaan Cheval 538a2cb64c Major refactor for coverage logger
- Moved all helper functions to coverage.js
- Refactor individual cov_*[func_id] objects to coverage[func_id].*
- Write coverage data to its own directory (./build/coverage/coverage_data*)
- Enable/disable coverage logging in do_many_cycles to account for exceptions
- Better naming
- Minor stylistic refactoring
2020-07-21 20:10:13 -05:00
Amaan Cheval 6362afa4c1 Minor cleanup for cov-report 2020-07-21 20:10:13 -05:00
Amaan Cheval bb5c84973e Add coverage-reporter
It looks for files in ./build/cov_data_fn_name_XX where XX=number of conditional
blocks in fn_name, and parses the binary data contained within to find which
blocks are missing.

Reports are generated in ./tests/coverage/build/report_XX where XX is
incremented to allow us to see how the coverage changes over time.

Note:

- The cov_data_* generated needs to be manually deleted if we want to compare 2
  individual coverage runs.
- We currently ignore the 0th block (LLVM marks it as visited when a function is
  entered).
2020-07-21 20:10:13 -05:00
Amaan Cheval 9c301f45e7 Improve NASM test error message marginally 2020-07-21 20:10:13 -05:00
Fabian fb1cb5e800 Run qemu tests in debug mode 2020-07-21 20:10:13 -05:00
Fabian a0f5074f18 Temporarily disable segment test in qemu 2020-07-21 20:10:13 -05:00
Awal Garg 8222d2e6e0 Squash
restore memcpy comment
delete all the things!
fix jshint issues
restore memcpy comment
remove duplicate fxsave assignment
Count cache drops
Use already available physical address instead of calling read_imm8
Remove useless assertion
Just move around to reduce later diff
Run jit paging test with assertions enabled
Run jit-paging test on CI
Extend jit-paging test
Fix deleting invalidated code across memory pages
Add jit-paging test to gitlab ci
Remove jit_in_progress
Clean up old comments, use bool for jit_jump
Fix state image not begin garbage collected
Add ENABLE_PROFILER_TIMES to configure slow profiling times
Move to jit_generate and jit_run_interpreted to separate function
Add missing struct field
Fix: Don't write jit cache entry until no more faults can happen
Download image for jit paging test
Add missing initialiser
Mark jit_{generate,run_interpreted} as static
Specify full path to profiler.h
Clean up duplicate/missing declaration after rebase
mmap error handling, line length and fix some warnings
remove further unused code
move js imports to single header file
2020-07-21 20:10:13 -05:00
Awal Garg f92ab52b38 fix view in codegen test 2020-07-21 20:10:13 -05:00
Awal Garg 318f595aa2 fix codegen test addresses 2020-07-21 20:10:13 -05:00
Amaan Cheval c780862cf5 Remove outdated docs and gdbauto script 2020-07-21 20:10:13 -05:00
Amaan Cheval c7a9a49050 NASM: Move shared breakpoint out gdb definition script
This lets the gdb script be more standalone and have fewer side-effects.
2020-07-21 20:10:13 -05:00
Amaan Cheval 56bc2e3dd9 Have gen_fixtures.js use mtime to generate fixtures only when needed 2020-07-21 20:10:13 -05:00
Amaan Cheval f7a39f901d Use path.join instead of manually concatenating paths 2020-07-21 20:10:13 -05:00
Amaan Cheval 13ce0f8ecb Variable refactor: snake-case and scope updates 2020-07-21 20:10:13 -05:00
Amaan Cheval 0d46574719 Remove chunk's default parameter and replace comment with test 2020-07-21 20:10:13 -05:00
Amaan Cheval ac83adc872 Remove DEBUG_FILE_LIMIT parameter
It was used to limit the number of files that the script processes manually, but
it doesn't really need to be checked in.
2020-07-21 20:10:13 -05:00
Amaan Cheval 8a413b621d Fix indentation of end of user-defined gdb command extract-state 2020-07-21 20:10:13 -05:00
Amaan Cheval 8354a1dafb Speed up NASM tests' fixture generation phase
The gen_fixtures.js currently generates fixtures for all
host_executables (*.bin) files, regardless of whether they need to be
regenerated or not.

The script speeds the process up by:

- Listing all files that need fixtures
- Finding nr_of_cpus (to parallelize execution)
- Dividing them up to roughly even "chunks" based on nr_of_cpus
- Spawning N gdb processes, which iteratively call a user-defined command named
  "extract-state" (see gdb-extract-def); the command automatically loads the new
  file and extracts its state into a fixture file

Rough benchmarks for 3725 tests:

Old method (after `rm build/*.fixture`):
make -j4  325.23s user 40.28s system 206% cpu 2:57.38 total
make -j4  342.65s user 43.73s system 289% cpu 2:13.23 total
make -j4  435.69s user 55.61s system 289% cpu 2:49.63 total

New method:
node gen_fixtures.js  11.85s user 4.86s system 140% cpu 11.890 total
node gen_fixtures.js  12.48s user 5.48s system 114% cpu 15.736 total
node gen_fixtures.js  14.54s user 6.33s system 141% cpu 14.769 total
2020-07-21 20:10:13 -05:00
Amaan Cheval a3420c5f32 Fix manual pcmpeqb nasm test
It mistakenly tested the pand instruction earlier.
2020-07-21 20:10:13 -05:00
Fabian a1358bd082 Fix codegen test 2020-07-21 20:10:13 -05:00
Fabian 0c34310c99 Codegen changes for jit 2020-07-21 20:10:13 -05:00
Fabian 02f75f476c Run kvm-unit-test in debug mode 2020-07-21 20:10:13 -05:00
Awal Garg 16bbb73bef fix codegen test 2020-07-21 20:10:13 -05:00
Awal Garg 51b6bc4e63 reenable separate compilation for codegen 2020-07-21 20:10:13 -05:00
Awal Garg 7997defdfb add codegen-test to CI 2020-07-21 20:10:13 -05:00
Amaan Cheval 6802f6ab5f Update maskmovq test to use "test memory" the same way as maskmovdqu 2020-07-21 20:10:12 -05:00
Amaan Cheval fef1b05f35 Add XMM based manual tests for SSE shift instructions 2020-07-21 20:10:12 -05:00
Amaan Cheval 2ad796c85a Add NASM test for maskmovdqu xmm, xmm 2020-07-21 20:10:12 -05:00
Amaan Cheval f8b22d1b79 Add NASM test for maskmovq mm, mm 2020-07-21 20:10:12 -05:00
Fabian 58e4c6df72 Add some more operating systems to the full test suite 2020-07-21 20:10:12 -05:00
Awal Garg 705f59773a add modrm tests 2020-07-21 20:10:12 -05:00
Awal Garg c244eace01 use load_wasm from browser/lib.js 2020-07-21 20:10:12 -05:00
Awal Garg db5e31600b fix nits 2020-07-21 20:10:12 -05:00
Fabian 975a06269e Squash
2e469796 Minor
fab422ef Improve generation of 0f instructions
08ad7fe9 Improved if-else generation
3f81014d Minor: Align test output
4a3a84ef Generate modrm tests
61aa1875 Simplify
a6e47954 Generate decoding of immediate operands
435b2c10 Fix warnings
e4933042 Add missing immediate operand
3f3810c7 Generate immediate operands for instructions with modrm byte
a0aa7b1f Make memory layout in nasm tests clearer
6b8ef212 Remove 'g' property from instruction table (implied by 'e')
bf15c58c Remove unused declarations
1e543035 Remove useless `| 0` and `>>> 0` javascriptisms
1ccc5d53 Fix headers
8b40c532 Update qemu tests with changes from qemu
ec9b0fb5 Port xchg instructions to C
c73613e7 Port virt_boundary_* to C
d61d1241 Add headers
fd19f22c Make written value in write8 and write16 int32_t
497dcaec Generate read_imm for instructions with a modrm byte
8b7003d6 Generate read_imm8s
0cc75498 Remove read_op
9d716086 Trigger unimplemented_sse for partial sse instructions with prefix
8d5edd03 Remove unimplmented sse c-to-js hack
585d3565 Remove | 0
308124b2 Use int32_t as return value
f193f8e1 Use JS version of cvttsd2si for now
12747b97 Generate trigger_ud for missing modrm branches
770f674e Split 0f00 and 0f01 into multiple instructions depending on modrm bits
1cb372a3 Generate decoder for some 0f-prefix instructions
cec7bc63 Disable unused parameter warnings in instruction functions
807665b1 Generate read_imm for 0f/jmpcc
cdf6eccc Generate modrm decoding for shld
04528429 Create temporary files in /tmp/, not cwd
d8f3fbd8 Generate modrm/imm decoding for shld
00ef0942 Generate modrm decoding for bts
f531984b Generate modrm decoding for shrd and imul
07569c53 Generate modrm decoding cmpxchg
535ff190 Generate modrm decoding for lfs/lgs/lss
2f8ced8d Generate modrm decoding for btr and btc
95de6c66 Generate modrm decoding for movzx
c4d07e7e Generate modrm decoding for bsf and bsr
f0985d26 Generate modrm decoding for movsx
4b30937a Generate modrm decoding for xadd
a422eb27 Generate modrm decoding for movnti
e5501d3c Generate modrm decoding for mov to/from control/debug registers
bce11ec5 Generate modrm decoding for lar/lsl
5729a23c Fix access to DR4 and DR5 when cr4.DE is clear
44269a81 Specify immediate size explicitly instead of inferring it
82b2867a Fix STR instruction
98a9cc89 Log failing assertion
6d2f9964 Fix rdtsc
00260694 Log GP exceptions
7916883d Port trigger_ud and trigger_nm to C
36fedae9 Remove unused code
e08fabd0 Generate modrm decoding for 0f00 and 0f01
8ae8174d Generate modrm decoding for 0fae and 0fc7 (fxsave, cmpxchg8, etc.)
26168164 Generate modrm+immediate decoding for 0fba (bit test with immediate operand)
6adf7fa7 Simplify create_tests.js (unused prefix call)
c77cbdd8 Add comments about the implementation of pop [addr]
4640b4fe Simplify prefix call
a81a5497 Don't use var
3ca5d13d Separate call name and arguments in code generator
3191a543 Simplify other prefix call (8D/lea)
5185080e Update generated code (stylistic changes and #ud generation)
93b51d41 Remove unused wasm externals
e4af0a7f Avoid hardcoding special cases in code generator (lea, pop r/m)
654a2b49 Avoid hardcoding special cases in code generator (enter/jumpf/callf)
fd1a1e86 Commit generated code (only stylistic changes)
7310fd1a Simplify code generator by merging code for with and without 0f prefix
e7eae4af Simplify code generator by merging code for immediate operands
00fafd8a Improve assertions
db084e49 Simplify code generator (modrm if-else)
0a0e4c9e Improve code generation of switch-case
ce292795 Clarify some comments
37cf33fa Generate code in if/else blocks
cbcc33fc Document naming scheme
e30b97eb Generate modrm decoding for 0f12 (sse) instruction
24b72c2f movlpd cannot be used for register-to-register moves
72d72995 Generate modrm decoding for 0f13 (sse) instruction and disable register-to-register moving
75d76fbb Generate modrm decoding for 0f14 (sse) instruction
ac8965a7 Generate modrm decoding for 0f28-0f2b (movap, movntp)
e919d33e Generate modrm decoding for cvttsd2si
5f2ca2b4 Generate modrm decoding for andp and xorp
c8d1c6de Generate modrm decoding for 0f60-0f70 (sse instructions)
ae4ed46d Add multi-byte nop and prefetch to nasm test, generate modrm decoding
718a1acf Print qemu test error message more useful
d1ecc37e Generate modrm decoding for 0f70-0f80 (sse instructions)
6a7219a5 Generate modrm decoding for popcnt
25278217 Generate modrm decoding for 0f71-0f73 (sse shift with immediate byte)
ed1ec81b Generate modrm decoding for the remaining sse instructions (0fc0-0fff)
42bc5a6f Use 64-bit multiplication for native code
dda3fb39 Remove old modrm-decoding functions
717975ef Move register access functions to cpu.c
aee8138f Remove read_op, read_sib, read_op0F, read_disp
f31317f2 Rename xmm/mmx register access functions
a525e70b Remove 32-bit access to reg_xmm and reg_mmx
c803eabc Rename s8/s16/s32 to i8/i16/i32
9fbd2ddf Don't use uninitialised structs
942eb4f7 Use 64-bit load for mmx registers and assert reg64 and reg128 size
f94ec612 Use 64-bit writes for write_xmm64
08022de9 Use more efficient method for some 128-bit stores
9d5b084c Make timestamp counter unsigned
2ef388b3 Pass 64-bit value to safe_write64
4cb2b1be Optimise safe_write64 and safe_write128
b0ab09fb Implement psllq (660ff3)
9935e5d4 Optimise safe_read64s and safe_read128s
af9ea1cc Log cl in cpuid only if relevant
be5fe23e Add multi-op cache (disabled by default through ENABLE_JIT macro) and JIT paging test (similar to QEMU test).
aa2f286e Don't initialise group_dirtiness with 1 as it increases the binary size significantly
b8e14ed9 Remove unused reg_xmm32s
bc726e03 Implement dbg_log for native code with format characters 'd' and 'x'
454039d6 Fix store task register
63a4b349 Remove unnecessary parens and clean up some log statements
4cc96814 Add logop and dbg_trace imports
7940655d Only inhibit interrupts if the interrupt flag was 0 in STI
876c68a7 Split create_tests into create_tests and generate_interpreter
aa82499f Move detection of string instructions to x86_table
f3840ec2 Move C ast to separate file
90400703 Skip tests for lfence/mfence/sfence, clarify their encoding
4a9d8204 elf: Hide log messages when log level is zero
a601c526 Allow setting log level via settings
8a624453 Add cpu_exception_hook to debug builds
f9e335bf Nasm: Test exceptions
599ad088 logop: Format instruction pointer as unsigned
f95cf22b Don't skip zero dividing tests
2a655a0e Remove get_seg_prefix_ds from read_moffs (preparation for calling read_moffs from the code generator)
bc580b71 Remove obsolete comment
e556cee0 Fix nasmtest dependencies in makefile and clean
dcb1e72b Use all cores on travis
86efa737 Replace all instances of u32 & 0xFFFF with the respective u16 accesses
98b9f439 Use u8 instead of bit-shifts and masks from u32
b43f6569 Replace all instances of u32 >> 16 with the respective u16 accesses
9bfa72c7 Remove unnecessary parens
9cf93734 Clean up remaining instance of u32 with a mask instead of u16
22d4117f Correct order of writes in virt_boundary_write32
6734c7c1 Fix keyboard on ios, fixes #105
858a4506 Add missing file, c_ast.js
1d62e39e Move instruction naming scheme into function
f4816852 Reorder some code
69d49788 Minor improvements
0493e05f Add util.js
af9000c1 Improve full test
e5feba31 Add missing export
c7c42065 Replace prefix_call with custom_resolve_modrm
3186e6ad Add support for "%%" format string to dbg_log_wasm for printf import
efe54fad Add barebones instrumentation profiler (disabled by default).
c9f0d462 Implement movlps m64, xmm and enable its test
42869a12 Add tests for cross-page reads/writes confirmed with byte reads/writes
d68976ea Mask word values in port byte reads
9758d51e Add PS2_LOG_VERBOSE
5f52f037 Update NASM Makefile to include all dependencies to prevent unnecessary recompilation
2c71f927 Have NASM test generator use a seedable PRNG to allow for faster incremental tests
e4aa45bb Add chunk{16,32}_rw paging tests; instructions that read and write to memory
bdf538a2 add codegen to cpu constructor
aa76ce8e add resolve_modrm16
14d7ecf1 refactor codegen
b710319f [rebased] Merge branch codegen
0565ea42 minor refactoring
071dff3f temporary fix for automatic cast warnings
57c504f2 fix modrm16 issue
c2db5d9e jit modrm32
85c04245 reinstate modrm_fn0 and modrm_fn1
be65dafd add ip and previous ip manipulating functions
ae00ef89 update codegen js interface
530a74fa squashed commit for refactor
2c692199 add codegen-test to build
c15afe68 prefix gen to codegen api
c9611533 codegen tests fixes
2020-07-21 20:10:12 -05:00
Amaan Cheval 966f61616c Minor refactor based on feedback 2020-07-21 20:10:12 -05:00
Amaan Cheval 650de5d7d7 Skip cvttsd2si test (due to emscripten bug) 2020-07-21 20:10:12 -05:00
Awal Garg 6274f90939 enable more string instructions in nasm tests 2020-07-21 20:10:11 -05:00
Awal Garg 1ba669fa61 enable tests for mov* string instructions 2020-07-21 20:10:11 -05:00
Fabian 3a78beeb78 kvm-unit-test: Add missing files 2020-07-21 20:10:11 -05:00
Fabian dbe71128e6 Temporarily disable fxsave test 2020-07-21 20:10:11 -05:00
Fabian befddacccf Fix kvm-unit-test: undefined reference to __stack_chk_fail 2020-07-21 20:10:11 -05:00
Fabian 1b6c1091ce Update kvm-unit-test from upstream 2020-07-21 20:10:11 -05:00
Fabian cda9398da5 Nasm tests: Ensure build folder exists 2020-07-21 20:10:11 -05:00
Fabian 6e9fb16ac5 Nasm: Separate .o generation in makefile 2020-07-21 20:10:11 -05:00
Fabian 3014f95359 Significantly improve speed of nasm tests
- Reuse v86 instances (in particular, memory allocation and wasm
loading)
- Reduce memory size from default (64M) to 2M
2020-07-21 20:10:11 -05:00
Fabian 4871e5a288 Nasm tests: Create more tests, improve instruction table 2020-07-21 20:10:11 -05:00
Fabian 3cea7aacde Nasm test: Also check final ESP 2020-07-21 20:10:11 -05:00
Fabian 0b0d5394ef Check fixtures before starting to run tests 2020-07-21 20:10:11 -05:00
Fabian db376f3b63 Add tests for fixed address in instructions 2020-07-21 20:10:11 -05:00
Fabian 3079fe8f8d Disable Windows 98 test 2020-07-21 20:10:11 -05:00
Fabian 3cd91a5064 Temporarily disable QEMU tests that don't compiler on newer GCC 2020-07-21 20:10:11 -05:00
Fabian 5ad6e1e67a Nasm tests: Test for lazy flags, fix flags mask for several instructions 2020-07-21 20:10:11 -05:00
Fabian c004dac4d5 Generate immediate byte reads for callf/jmpf/enter 2020-07-21 20:10:11 -05:00
Fabian 4332444dfe Use same esp in orace and test 2020-07-21 20:10:11 -05:00
Fabian 75ae9fe420 Split modrm functions by reg/mem 2020-07-21 20:10:11 -05:00
Fabian fc0e438348 nasm test: Test with different register than eax 2020-07-21 20:10:11 -05:00
Fabian a29221a6b2 Prepare for catching exceptions in nasm test 2020-07-21 20:10:11 -05:00
Fabian 14875dafb2 Move code into hex_byte 2020-07-21 20:10:11 -05:00
Fabian 6d9e8580ef Generate instruction calls when modrm/reg decides instructions 2020-07-21 20:10:11 -05:00
Fabian 425654304a Skip divide instruction tests instead of out-commenting them 2020-07-21 20:10:11 -05:00
Fabian b55c5119c7 Nasm tests: Write to build folder 2020-07-21 20:10:11 -05:00
Fabian 95cd31bb49 nasm tests: Test 16-bit instructions 2020-07-21 20:10:11 -05:00
Fabian a1a10d75a8 Fix unaligned stack check during nasm tests 2020-07-21 20:10:11 -05:00
Fabian 6c702c7340 nasm tests: Test both memory and register, skip failing register tests 2020-07-21 20:10:11 -05:00
Fabian 5b8296b0fd Add nasm test generation script 2020-07-21 20:10:11 -05:00
Fabian 403ff43c25 Fix nasm tests, add support for testing general purpose registers, eflags and xmm registers 2020-07-21 20:10:11 -05:00
Fabian aebcff84ed Big squash
e72eac2fc A few more sse instructions
bdf83e0f0 temp rebase to resolve conflicts
58aa08353 replace all usage of modrm_byte with the set/get fns
7f1dbadf4 move registers to wasm memory
9a0432708 remove stdio inclusion
60f49f735 partial branch port of read_e8
747c51979 partial port of do_div32
8700c3042 remove wasm file from repo
c69bc5c91 revert div32 to js
ead0195b9 move last_op1 to wasm
16e9a2801 move last_op2 to wasm
4b5e749c8 move last_op_size to wasm
3a02ec98c move last_add_result, last_result, flags_changed to wasm
882b5476b implement add in C
8a8b15e11 move flags to wasm
4667917a9 implement getcf in C
1199537a1 implement adc in C
a8a2f81ba implement sub in C
697cb4070 implement sbb in C
1e4e08079 implement inc in C
35259ddc3 implement dec in C
82498a632 implement neg in C
47fe549af copy opsize and reg constants
39c0f07aa implement mul8 in C
443aef4b2 implement imul8 in C
afd2ec864 refactor memory accessing from C
f937617bc implement mul16 in C
af430b023 rewrite reg_* macros
6639f23a7 implement imul16 in C
6c490e88d add wasm build to makefile
ea698b8bc refactor modrm_byte access
71899e821 split cpu.c into individual files
00dc878be capitalize flag constants
e1ccf9477 remove unused buffer view
f0175e480 refactor JS to wasm replacement
f52c5f3a6 add assert.h
ccf73539e implement imul_reg16 in C
8ae41facd implement do_mul32 in C and port mul32_result to wasm memory
77d3875eb implement do_imul32 in C
af1cdc85d implement mul32 in C
820f514e3 implement imul32 in C
e165f02e0 implement imul_reg32 in C
fdee993e9 implement xadd8 in C
4e5d6f1c2 implement xadd16 in C
1c903565f implement xadd32 in C
1be111a93 implement getaf in C
4c2bc9f43 implement bcd_daa in C
3852cee61 implement bcd_das in C
ed68e2777 implement bcd_aad in C
b56c17640 implement bcd_aaa in C
5650e48c6 implement bcd_aas in C
99aeb5682 implement and in C
39d2308aa implement or in C
c76e59a0b implement xor in C
b14b87b95 async wasm instantiation
7f11605bc implement rol8 in C
161c662cf implement rol16 in C
37bf420f6 implement rol32 in C
921f06821 implement rcl8 in C
2f1bf0c2d implement rcl16 in C
ad1d56ebe implement rcl32 in C
ebcded69e implement ror8 in C
9bc225ff0 implement ror16 in C
403125717 implement ror32 in C
2a21a0896 implement rcr8 in C
80bf2667e implement rcr16 in C
f8fe46c47 implement rcr32 in C
95493a272 split error_code flag in call_interrupt_vector
a6f19110e export throw_cpu_exception to C
dd5d8ce0d export call_interrupt_vector to C
537c08f65 implement raise_exception_with_code to C
8347e787e port instruction_pointer to wasm memory (offset 556)
0e62a7046 port previous_ip to wasm memory (offset 560)
c09089e40 implement trigger_gp in C
a4f0fed1b implement raise_exception in C
0b41949f4 implement trigger_de in C
fc2a568a6 implement div8 in C
acc6bbb54 implement idiv8 in C
5a3db2d09 implement div16 in C
d77f0d151 Move wasm replacements to a dedicated function
135b19af0 port idtr_size and idtr_offset to wasm (offset 564, 568)
5f0ad7257 port gdtr_size to wasm (offset 572)
dc17f7b7a port gdtr_offset to wasm (offset 576)
07876e86f port cr to wasm (offsets 580-608)
50b0213c2 port cpl to wasm (offset 612)
5cea3efcc port page_size_extensions to wasm (offset 616)
89d6fd6e8 port last_virt_eip to wasm (offset 620)
68f4111fd port eip_phys to wasm (offset 624)
73b146319 port last_virt_esp to wasm (offset 628)
dbf920ff7 port esp_phys to wasm (offset 632)
c05177c5a port sysenter_cs to wasm (offset 636)
63dd72194 port sysenter_esp to wasm (offset 640)
59d8aa686 port sysenter_eip to wasm (offset 644)
c5e02dd8b port prefixes to wasm (offset 648)
259ca5d72 port tsc_offset to wasm (offset 652)
62ecc8825 port phys_addr to wasm (offset 656)
188ea275e port phys_addr_high to wasm (offset 660)
f458cb2bb port timestamp_counter to wasm (offset 664)
890449fa3 port sreg to wasm (offsets 668-682)
ebe65e6f3 port dreg to wasm (offsets 684-716)
df6553220 port fw_value to wasm (offset 720)
0cd3b78ea port segment isnull, offsets and limits to wasm (offset 724-796)
4fb0ecebc Turn off verbose logging
b55bc2cae fix unzip command in readme
f5b897bc3 fix docs links to api.md
ba03a7b4e Remove outdated test
930483ac4 Add elf parser
6597973c8 Shift addresses correctly
189903a7d Add comment to lss #ud
0a46ec4a9 Fix iret #gp error code (Windows XP)
28986b7ee Lower TIME_PER_FRAME
4ce987d71 Add acpi PM timer
43c31ea99 Handle access to debug registers when cr4.DE is set
283305215 Add run_hardware_timers
c617846f2 A few more assertions for IO ports
32e7444f4 Make Closure Compiler happy
a661c408c Buffer get written blocks
9306fd080 Add debug panel (#108)
795ff1a50 More complete APIC and IOAPIC implementation (#86)
4a4253956 Makefile: Refactor using addprefix
ac1009331 More VGA logging
18ee4ecde Only check irqs when irr changed
cdbc55e03 Add multiboot image loading, currently only supporting kvm-unit-test (#95, #129)
3ee9a1c85 Disable advanced optimisations for libv86. Fixes tests
12df5c76d Import kvm-unit-test into this repo
249f9ba37 Add kvm-unit-test (#129)
99b824f49 Mention than FreeBSD works
91fe8a3a1 ATA flush cache
0af630d99 PCI: Fix command/status
30fc01491 Rename function
569d1f3d6 APIC version write
df376842c Split movsx/movzx into 16/32 bit versions
dda21c5e2 CR3 ignored bits
b1f039211 Implement #NP (kvm-unit-test)
57dd8358f Minor (style and logging)
17fd08e29 Less incomplete task switch implementation
797fd5bd8 cpuid level 5
24e66a43f Missing parameter
a679829f0 PIC logging
e68ea4573 Don't create new arrays in reset(), set to 0 instead
550e55186 Update readme regarding Arch Linux
3b565e54e Use local kolibriOS image on https. Temporary workaround for #141
1a0f804d6 Fix restoring state
b397f1934 Leave ACPI disabled, fixes #151
83db7e871 add note about range header in SimpleHTTPServer
a20794873 update linux 9p image mount hook doc
88e65312e Improve fprem instruction implementation to update FPU status word's condition codes
9844ef433 Remove comments from fprem instruction
a429bbe73 Disable Oberon tests
ba3092060 Add kvm-unit-test to travis CI (#129)
6a8813567 Travis fix
46da581de Travis fix (gcc-multilib)
c78dcb105 Travis fix (switch to Trusty)
dbc2ab704 Reduce memory for kvm-unit-test
2c6bd1889 Fix multiboot images smaller than 8192 bytes
f5dead1f5 expand Archlinux doc with scripted install example
a34cd08d9 fix raw RangeHTTPServer link to wget
35f9923fb change state to initial state in archlinux doc
2aed2636f extend archlinux doc with networking example
2aa8f3722 First entry in LDT is valid (#145)
7492c8d3c Basic 16-bit tss implementation. Fixes #127. Fixes #145. Fixes windows 3.0
098d84a02 Minor
b9c93f8c6 Proper CD IDE DMA implementation, fixes #147, fixes #107
9b9123d6e Improved file loading in nodejs, simplify tests
40ee13f9b Add dummy screen
a58bd7419 Fix test: Check if disk image is missing
c8a7fd8dc Reenable Oberon tests
bd63f49ad Minor: Semicolons
d10f0b7ff Implement elcr in legacy pic
aed5b441a Change virtio irq to 10, old one collides with ps2 mouse
b93519c8a PS2 minor changes
25e64afa6 Update build command
5377f9457 Add maximum debug to emscripten build
dac6ce6a4 Reduce logging
f44f3b467 Convert argument for call from C
e1808f222 Raise when C assertion fails
bb6d38e6e Add cpu imports, in order to be called from C
f3f909d5d Port constants
7bab32657 Port protected_mode, is_32 and stack_size_32
ee02cdd86 Port the main instruction table
fe15a6cc0 fixes for prop mangling and closure type checks
11935fcc0 remove redundant pointer timestamp_counter
a7021eb20 port read_imm8 to wasm
f7a432691 strip useless brackets
90c7435f8 Reduce logging
047f0f405 Port a few small functions
df293f8d4 Port get_seg*
37774b0d1 Remove useless comparison
47f7a89b9 Port instructions with 0F prefix
8a822bae4 Remove useless brackets again (lost in rebase) and use correct quote style
2f6e90023 port read_imm{8s,16,32s}
8f5ce2dbf remove redundant declaration
5785195ce port read_write_e8 and write_e8
5fa1a15af Make instruction functions static
4a2336d12 Port jmp_rel16, jmpcc8, jmpcc16, jmpcc32
8633cfad9 Port set_e*
f024aec98 Port read_imm* aliases
d39cb4d7b Port read_g*
fa838388d Port read_e*
2f1c41d93 Port write_g*
43157269f Port logging and assertions
ac2c937d5 Port read_write_e{16,32} and write_e{16,32}
eeb7340c2 Port safe_read*
54d89b3d1 Port safe_write*
c5557a227 Port diverged, branch_taken, branch_taken
e3bb35939 Fix loading in node
00f6b2638 Remove useless `| 0` and `>> 0`. Use unsigned comparison
70fa762e3 Optimise read_imm8
4487917fd Port a20_enabled to wasm
a8f16cb20 Fix a20_enabled booleans for closure compiler
95145ec53 Move mul32 result so offsets are reserved in order (and mention length)
a3264e132 Move global pointer reservations to its own header file and make sure all .c files include all headers
78c779cbd Port FPU's stack_empty to wasm (offset 816)
4f25fc4b7 Port FPU's safe_tag_word function to wasm
8589a1c21 Port emms instruction to wasm
feb5079c7 port memory_size to wasm (offset 812)
262559291 port in_mapped_range to C
8a72ad56c Port a20_enabled to wasm
ce393e211 [wip] port read8
e936b49d1 port read8 to wasm
80cf98a3a port read16 to wasm
3a423372b port read_aligned16 to wasm
4725e1bac port read32s to wasm
60815b748 port write8 to wasm
5d64b295b port write16 to wasm
5fc83a791 port write32 to wasm
7148b6804 port push{16,32} to wasm
697222408 port pusha{16,32} to wasm
6adb5be15 Port paging, tlb_info, tlb_info_global and tlb_data
c8ab560af Port translate_address_*
8bb3e4285 Port get_eflags and getzf
c7a70a79b Port getsf
0d35dd621 Port getof
e4d3ec252 Port getpf
9aacf2cfe Port test_* (branch conditions)
9cb64f970 Add v86-debug.wasm build target
37012099d Call mmap_* functions statically
8fb9da298 Add missing voids
0bcbe7ef4 Silence warning
6fb9db2fd Simplify translate_address_read and translate_address_write
28b66ca6b Optimized versions of resolve_modrm32 and resolve_sib
cf4aea666 Silence warning
b4915a2d2 Port adjust_stack_reg, get_stack_pointer and pop32s
7ddc14948 Optimised memory reads and writes
2020-07-21 20:10:05 -05:00
David Bullado 700bd0e6e7 Implement instructions commiss & ucomiss 2018-10-01 14:26:23 -03:00
David Bullado 20905b90ac Minor: indentation consistency in cvtpi2ps.asm 2018-10-01 14:26:23 -03:00
David Bullado 48f8fb1d77 Remove traling spaces in run.js 2018-10-01 14:26:23 -03:00
David Bullado d5f0f7e3e9 Implement ucomiss instruction 2018-10-01 14:26:23 -03:00
David Bullado 886d699ea9 Implement instruction cvtps2pi 2018-10-01 14:26:23 -03:00
David Bullado 43f9cd429f Implement instruction cvttps2pi 2018-10-01 14:26:23 -03:00
David Bullado 1e9c93252f Add nasm tests for movntpd & movntps 2018-10-01 14:26:23 -03:00
David Bullado 843ac57fbc Add cvtpi2ps instruction 2018-10-01 14:26:23 -03:00
David Bullado 12ba787e68 Nasm tests: print registry names in error output 2018-10-01 14:26:23 -03:00
David Bullado 5d18fb3786 Fix indentation between mmx and xmm for more clarity 2018-10-01 14:26:23 -03:00
David Bullado 9ec5f49115 Add movaps test 2018-10-01 14:26:23 -03:00
David Bullado 15058430f0 Add a new test case for pmuludq 2018-09-17 13:57:05 -05:00
David Bullado 994a1d265b Add nasm test for pmuludq 2018-09-17 13:57:05 -05:00
David Bullado c4e689899b Update gdb command file output xmm registers (SSE) 2018-09-17 13:57:05 -05:00
copy 98c303d516 make: Rebuild when .inc files change 2017-06-22 18:39:48 -05:00
copy 258eb359f1 Enable fxsave test. Replace constants that can't be represented in 64 bits 2017-06-20 18:38:58 -05:00
copy b7237338c3 Update emms test 2017-06-20 16:19:38 -05:00
Amaan Cheval f8ddf4dc9c Simplify nasm tests by using boilerplate includes 2017-06-20 12:07:24 -04:00
copy a9ea8fff37 Simplify nasm test 2017-06-19 15:44:10 -05:00
copy 016005fa20 Update testing readmes 2017-06-19 15:06:50 -05:00
copy e2cebe1130 qemu test: Add -mno-sse (fix for travis) 2017-06-19 14:37:12 -05:00
copy 97c44f48b5 Use -mmmx over -msse 2017-06-19 14:22:50 -05:00
copy 323d7ef255 Run qemu test on command line, add it to travis 2017-06-19 14:03:20 -05:00
copy e2c129ed23 Disable tests that require sse due to modern libc 2017-06-19 12:39:41 -05:00
Amaan Cheval ff9ea8d5ff Set exit code to 1 when there are any failed tests 2017-06-16 10:47:19 -04:00
Amaan Cheval 091d533d61 Improve punpcklwd tests 2017-06-16 10:47:19 -04:00
Amaan Cheval 15264a78b6 Improve punpckldq tests 2017-06-16 10:47:19 -04:00
Amaan Cheval cd22df4d63 Improve pcmpgtb tests 2017-06-16 10:47:19 -04:00
Amaan Cheval 421a0b8d91 Improve pcmpeqb tests 2017-06-16 10:47:19 -04:00
Amaan Cheval d2af5c46f3 Improve punpcklbw tests 2017-06-16 10:47:19 -04:00
Amaan Cheval 65a54ffb15 Improve pxor tests 2017-06-16 10:47:19 -04:00
Amaan Cheval a17cfa2636 Improve psubw tests 2017-06-16 10:47:19 -04:00
Amaan Cheval 1523d3a92d Improve packuswb tests 2017-06-16 10:47:19 -04:00
Amaan Cheval 4d5fe0309c Improve pand tests 2017-06-16 10:47:19 -04:00
Amaan Cheval 4b09aef726 Remove leftover comment from psllq 2017-06-16 10:47:19 -04:00
Amaan Cheval a6c8d76b70 Remove leftover comments from nasm tests (for manual fixtures) 2017-06-16 10:47:19 -04:00
Amaan Cheval ba6ac81fb6 Enable supported QEMU tests (for mmx-instructions) 2017-06-16 10:47:19 -04:00
Amaan Cheval f0994e3c86 Add regression test for psllw bug 2017-06-16 10:47:19 -04:00
Amaan Cheval 35f0be46bf Update README to mention automated method 2017-06-16 10:47:19 -04:00
Amaan Cheval 4fd4ae65b6 Add comment about failing emms test 2017-06-16 10:47:19 -04:00
Amaan Cheval ff8d4d26b9 Add nasm test for paddd 2017-06-16 10:47:19 -04:00
Amaan Cheval 68ec0db680 Add nasm test for paddb 2017-06-16 10:47:19 -04:00
Amaan Cheval 6c9faf199a Add nasm test for psubd 2017-06-16 10:47:19 -04:00
Amaan Cheval c97db9c86d Add nasmtest for psubb 2017-06-16 10:47:19 -04:00
Amaan Cheval 803eeec9b2 Add nasm test for pmaddwd 2017-06-16 10:47:19 -04:00
Amaan Cheval 055f9bade2 Add nasm test for paddsw 2017-06-16 10:47:19 -04:00
Amaan Cheval 5ea8bf54a6 Add nasm test for paddsb 2017-06-16 10:47:19 -04:00
Amaan Cheval 6c4a769456 Add nasm test for por 2017-06-16 10:47:19 -04:00
Amaan Cheval 5d850d47f3 Add nasm test for psubsw 2017-06-16 10:47:19 -04:00
Amaan Cheval f2d20eb3b6 Add test for psubsb 2017-06-16 10:47:19 -04:00
Amaan Cheval 1489d6f424 Add nasm test for pmulhw 2017-06-16 10:47:19 -04:00
Amaan Cheval 9694a0d9aa Improve pmullw test (to confirm that unsigned mul in JS doesn't
make a difference to the lower word)
2017-06-16 10:47:19 -04:00
Amaan Cheval b22d9d9bb7 Add nasm test for pandn 2017-06-16 10:47:19 -04:00
Amaan Cheval 790b9fe233 Add nasm test for paddusw 2017-06-16 10:47:19 -04:00
Amaan Cheval 441c7e14ed Add nasm test for paddusb 2017-06-16 10:47:19 -04:00
Amaan Cheval d4e01b6cab Add nasm test for psubusw 2017-06-16 10:47:19 -04:00
Amaan Cheval 936120bc1d Add nasm test for psubusb 2017-06-16 10:47:19 -04:00
Amaan Cheval fe3ad09b06 Add nasm test for pcmpeqd 2017-06-16 10:47:19 -04:00
Amaan Cheval 8752d71540 Add nasm test for pcmpeqw 2017-06-16 10:47:19 -04:00
Amaan Cheval 7c14a4bcfc Use v86's bus for CPU instead of emulator's bus 2017-06-16 10:47:19 -04:00
Amaan Cheval 81df2581a1 Make nasm test executable 2017-06-16 10:47:19 -04:00
Amaan Cheval 3d733cd97e Automate nasm test
MVP of automated tests for nasm using pre-built fixtures and
dynamically loaded multiboot kernel images for v86. These tests
compare _only_ the MMX technology registers mm0-mm7 at the
moment.
2017-06-16 10:47:19 -04:00
Amaan Cheval 281841492c Update gdb command file output mmx registers in JSON 2017-06-16 10:47:19 -04:00
Amaan Cheval 3136c62d02 Let nasm Makefile generate fixtures and add "all" target 2017-06-16 10:47:19 -04:00
Amaan Cheval 94901d2259 Add nasm test for pcmpeqb 2017-06-16 10:47:19 -04:00
Amaan Cheval ce29114564 Add nasm test for psllq 2017-06-16 10:47:19 -04:00
Amaan Cheval 6a9ac12fcd Add nasm regression test for psrlq bug when shift=31 2017-06-16 10:47:19 -04:00
Amaan Cheval 7463e36af5 nasm regression tests for bug where negative shifts were overlooked 2017-06-16 10:47:19 -04:00
Amaan Cheval fb71d55a7c Add nasm test for psrlq 2017-06-16 10:47:19 -04:00
Amaan Cheval 8ac5044274 Add nasm test for pslld 2017-06-16 10:47:19 -04:00
Amaan Cheval 313dfd9568 Add nasm test for psrad 2017-06-16 10:47:19 -04:00
Amaan Cheval 2638b39b04 Add nasm test for psrld 2017-06-16 10:47:19 -04:00
Amaan Cheval 81d898be56 Add nasm test for psllw 2017-06-16 10:47:19 -04:00
Amaan Cheval 4bdc993074 Add nasm test for psraw 2017-06-16 10:47:19 -04:00