|
From: | G 3 |
Subject: | Re: [Qemu-ppc] [Qemu-devel] Floating point unit bugs |
Date: | Thu, 22 Jun 2017 11:54:14 -0400 |
On Jun 22, 2017, at 3:25 AM, Peter Maydell wrote:
On 22 June 2017 at 03:54, G 3 <address@hidden> wrote:The advantage a test image would have is the user doesn't have to worry about compiling a test using a cross compiler. Everything the user wouldneed to test QEMU is already inside the image file (hopefully).Is the setup you want something like running 'make test' ? I imagine binary files included with QEMU would test the emulated CPU. There would be no needto cross compile anything.I want our tests to be easy to add new tests for, and easy for anybody to recreate the binary files. Certainly providing pre-built binaries would be helpful (faster than rebuilding whole system images), but we must have an automated mechanism for saying "build this image from sources" too, so that if we want to update the test program later it's easy to do that, or if we want to add a second test that's like the first one but slightly modified we can easily do that too.
So what you want is a test system that is easy to write. Maybe as easy as writing a python script? What I thought up is a collection of functions that implement assembly language code. Say you want to make a test that runs the fadds instruction. You might run it like this:
def my_float_test: inputA = 0.5 inputB = 0.25 result = fadds(inputA, inputB) if result != 0.75: print("Error with fadds calculation") if get_FPSCR() != expect_fpscr_value: print("FPSCR error")Then all we would be left to figure out is how to turn this code into a mach-o or elf binary. Then again this might not be a requirement. What if we had python running on the guest. The above code might work as is. No cross compiling required.
Implementing the callable assembly language code from python could be done using a single command-line program. This program would simply receive its arguments and return a value. If this program was called assembly _adapter, it would run like this:
% assembly_adapter fadds 0.5 0.25The return value of this command is where we would see the result. This command-line program would only need to be compiled once and included with QEMU. The format of this program's arguments would be something like this: <assembly instruction> <input> <input>
This input would probably work for most instructions but doesn't necessarily need to be applied to all instructions.
Would this kind of system be something you want?
[Prev in Thread] | Current Thread | [Next in Thread] |