[Qemu-devel] [PATCH 0/5] tricore: adding new instructions and fixing issues

David Brenken posted 5 patches 4 years, 10 months ago
Test s390x passed
Test checkpatch passed
Test asan passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190605061126.10244-1-david.brenken@efs-auto.org
Maintainers: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
There is a newer version of this series
target/tricore/fpu_helper.c | 129 ++++++++++++++++++++++++++++++++++++
target/tricore/helper.h     |   3 +
target/tricore/translate.c  |  21 +++++-
3 files changed, 150 insertions(+), 3 deletions(-)
[Qemu-devel] [PATCH 0/5] tricore: adding new instructions and fixing issues
Posted by David Brenken 4 years, 10 months ago
From: David Brenken <david.brenken@efs-auto.de>

Hello everyone,

in the scope of this patchset we added implementations for the following 
instructions for the target TriCore:

QSEED, FTOIZ, UTOF

For the implementation of the QSEED instruction we wrote a test application to 
record the QSEED results on the actual target. We recognized that the results
of the instruction can be clustered in blocks and do not use all available mantissa bits.
After investigating on how to calculate the square root on floats, which can easily
be done using shift and add, we implemented it using a 128 entry LUT and finetuned
the values to exactly match the hardware results.

Furthermore we added a fix for the RRPW_INSERT instruction.

Internally we are now using QEMU head and encountered strange issues during 
execution. Sometimes the PC of the target was set to address 0x0 which was wrong 
behaviour. A detailed analysis (using valgrind and git bisect) resulted in the fix 
to reset the ctx variable before generating intermediate code.

Best regards

David Brenken


Andreas Konopik (1):
  tricore: add QSEED instruction

David Brenken (3):
  tricore: add FTOIZ instruction
  tricore: add UTOF instruction
  tricore: fix RRPW_INSERT instruction

Georg Hofstetter (1):
  tricore: reset DisasContext before generating code

 target/tricore/fpu_helper.c | 129 ++++++++++++++++++++++++++++++++++++
 target/tricore/helper.h     |   3 +
 target/tricore/translate.c  |  21 +++++-
 3 files changed, 150 insertions(+), 3 deletions(-)

-- 
2.17.1


Re: [Qemu-devel] [PATCH 0/5] tricore: adding new instructions and fixing issues
Posted by Bastian Koppelmann 4 years, 10 months ago
Hi Guys,

On 6/5/19 8:11 AM, David Brenken wrote:
> From: David Brenken <david.brenken@efs-auto.de>
>
> Hello everyone,
>
> in the scope of this patchset we added implementations for the following
> instructions for the target TriCore:
>
> QSEED, FTOIZ, UTOF

first of all thanks for these patches. QSEED.F was one instruction that 
was bugging me for some time and I didn't dare to do the grind figuring 
out how it works in all details.

I left some comments in the patch emails but in general I think the 
patches are nearly good to go. I created some scripts [1] to generate 
random tricore asm programs that I run against tsim. This has been very 
useful in catching bugs in the PSW calculation. You might want to run 
them as well :)


Cheers,
Bastian

[1] https://github.com/bkoppelmann/tricore-qemu-tests