Received: from eggs.gnu.org ([2001:4830:134:3::10]:38512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dO4R9-0001DH-29 for qemu-devel@nongnu.org; Thu, 22 Jun 2017 11:54:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dO4R8-00077b-72 for qemu-devel@nongnu.org; Thu, 22 Jun 2017 11:54:27 -0400 In-Reply-To: References: <0F376E9C-2D4B-4D79-B3D4-24F73FD61446@gmail.com> <20170508221304.y36owezwla7sc6ss@aurel32.net> <20170508225007.2duqxlo5ab2aenpl@aurel32.net> <4BD44623-AD16-4D5D-BF51-15521035E974@gmail.com> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: G 3 Date: Thu, 22 Jun 2017 11:54:14 -0400 Subject: Re: [Qemu-devel] [Qemu-ppc] Floating point unit bugs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: =?ISO-8859-1?Q?Philippe_Mathieu-Daud=E9?= , BALATON Zoltan , "qemu-ppc@nongnu.org list:PowerPC" , "qemu-devel@nongnu.org qemu-devel" , Aurelien Jarno On Jun 22, 2017, at 3:25 AM, Peter Maydell wrote: > On 22 June 2017 at 03:54, G 3 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 >> would >> need 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 need >> to 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.25 The 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: 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?