All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1759264] [NEW] fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns
@ 2018-03-27 13:00 Bastian Koppelmann
  2018-04-10 20:07 ` [Qemu-devel] [Bug 1759264] " Alex Bennée
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Bastian Koppelmann @ 2018-03-27 13:00 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

After the refactor from ab52f973a504f8de0c5df64631ba4caea70a7d9e the
bahaviour of int32_to_float32() was altered.

helper_ftoi() in target/tricore/fpu_helper.c relied on int32_to_float32
to raise the invalid flag if the input was NaN to properly return 0.
Likewise if the input is infinity.

The obvious fix for softfloat would be to raise this flag in round_to_int_and_pack(). However,
I'm not sure if this breaks other targets and I have no easy way to test it.

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1759264

Title:
  fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns

Status in QEMU:
  New

Bug description:
  After the refactor from ab52f973a504f8de0c5df64631ba4caea70a7d9e the
  bahaviour of int32_to_float32() was altered.

  helper_ftoi() in target/tricore/fpu_helper.c relied on
  int32_to_float32 to raise the invalid flag if the input was NaN to
  properly return 0. Likewise if the input is infinity.

  The obvious fix for softfloat would be to raise this flag in round_to_int_and_pack(). However,
  I'm not sure if this breaks other targets and I have no easy way to test it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1759264/+subscriptions

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Qemu-devel] [Bug 1759264] Re: fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns
  2018-03-27 13:00 [Qemu-devel] [Bug 1759264] [NEW] fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns Bastian Koppelmann
@ 2018-04-10 20:07 ` Alex Bennée
  2018-04-11  9:23   ` Bastian Koppelmann
  2018-04-16 16:20 ` Bastian Koppelmann
  2018-04-26  5:10 ` Thomas Huth
  2 siblings, 1 reply; 10+ messages in thread
From: Alex Bennée @ 2018-04-10 20:07 UTC (permalink / raw)
  To: qemu-devel

Yeah it looks like it was missed, the round_to_uint code does it.

Do you have a test case I can verify?

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1759264

Title:
  fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns

Status in QEMU:
  New

Bug description:
  After the refactor from ab52f973a504f8de0c5df64631ba4caea70a7d9e the
  bahaviour of int32_to_float32() was altered.

  helper_ftoi() in target/tricore/fpu_helper.c relied on
  int32_to_float32 to raise the invalid flag if the input was NaN to
  properly return 0. Likewise if the input is infinity.

  The obvious fix for softfloat would be to raise this flag in round_to_int_and_pack(). However,
  I'm not sure if this breaks other targets and I have no easy way to test it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1759264/+subscriptions

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Bug 1759264] Re: fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns
  2018-04-10 20:07 ` [Qemu-devel] [Bug 1759264] " Alex Bennée
@ 2018-04-11  9:23   ` Bastian Koppelmann
  2018-04-11 11:01     ` Alex Bennée
  0 siblings, 1 reply; 10+ messages in thread
From: Bastian Koppelmann @ 2018-04-11  9:23 UTC (permalink / raw)
  To: Bug 1759264, qemu-devel

On 04/10/2018 10:07 PM, Alex Bennée wrote:
> Yeah it looks like it was missed, the round_to_uint code does it.
> 
> Do you have a test case I can verify?
> 

For the NaN input 0xffffffff the expected result for the flags is that
flag_invalid is raised.

I can provide you with some TriCore asm, but it is a bit of pain to get
the gnu assembler to build, since the public version is a decade old.

Cheers,
Bastian

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Bug 1759264] Re: fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns
  2018-04-11  9:23   ` Bastian Koppelmann
@ 2018-04-11 11:01     ` Alex Bennée
  2018-04-11 11:16       ` Bastian Koppelmann
  2018-04-11 12:46       ` Bastian Koppelmann
  0 siblings, 2 replies; 10+ messages in thread
From: Alex Bennée @ 2018-04-11 11:01 UTC (permalink / raw)
  To: Bastian Koppelmann; +Cc: Bug 1759264, qemu-devel


Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:

> On 04/10/2018 10:07 PM, Alex Bennée wrote:
>> Yeah it looks like it was missed, the round_to_uint code does it.
>>
>> Do you have a test case I can verify?
>>
>
> For the NaN input 0xffffffff the expected result for the flags is that
> flag_invalid is raised.
>
> I can provide you with some TriCore asm, but it is a bit of pain to get
> the gnu assembler to build, since the public version is a decade old.

I'll trust you if you send me a static binary for this particular
verification ;-)

It would be nice to TriCore tests building in tests/tcg/ but I guess we
need an up to date cross compile environment somewhere.

>
> Cheers,
> Bastian


--
Alex Bennée

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Bug 1759264] Re: fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns
  2018-04-11 11:01     ` Alex Bennée
@ 2018-04-11 11:16       ` Bastian Koppelmann
  2018-04-11 12:46       ` Bastian Koppelmann
  1 sibling, 0 replies; 10+ messages in thread
From: Bastian Koppelmann @ 2018-04-11 11:16 UTC (permalink / raw)
  To: Alex Bennée; +Cc: Bug 1759264, qemu-devel

On 04/11/2018 01:01 PM, Alex Bennée wrote:
> 
> Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:
> 
>> On 04/10/2018 10:07 PM, Alex Bennée wrote:
>>> Yeah it looks like it was missed, the round_to_uint code does it.
>>>
>>> Do you have a test case I can verify?
>>>
>>
>> For the NaN input 0xffffffff the expected result for the flags is that
>> flag_invalid is raised.
>>
>> I can provide you with some TriCore asm, but it is a bit of pain to get
>> the gnu assembler to build, since the public version is a decade old.
> 
> I'll trust you if you send me a static binary for this particular
> verification ;-)
> 
> It would be nice to TriCore tests building in tests/tcg/ but I guess we
> need an up to date cross compile environment somewhere.

That is the problem. There is a gcc/binutils port done by some german
company. And it's not easy to get the source. The one they provide is
pretty old and needs some patching to get in building on modern
machines. Right now I'm trying to set up a test environment.

Cheers,
Bastian

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Bug 1759264] Re: fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns
  2018-04-11 11:01     ` Alex Bennée
  2018-04-11 11:16       ` Bastian Koppelmann
@ 2018-04-11 12:46       ` Bastian Koppelmann
  2018-04-12 13:41         ` Alex Bennée
  1 sibling, 1 reply; 10+ messages in thread
From: Bastian Koppelmann @ 2018-04-11 12:46 UTC (permalink / raw)
  To: qemu-devel

On 04/11/2018 01:01 PM, Alex Bennée wrote:
> Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:
> 
>> On 04/10/2018 10:07 PM, Alex Bennée wrote:
>>> Yeah it looks like it was missed, the round_to_uint code does it.
>>>
>>> Do you have a test case I can verify?
>>>
>>
>> For the NaN input 0xffffffff the expected result for the flags is that
>> flag_invalid is raised.
>>
>> I can provide you with some TriCore asm, but it is a bit of pain to get
>> the gnu assembler to build, since the public version is a decade old.
> 
> I'll trust you if you send me a static binary for this particular
> verification ;-)

I set up a github repo with working binutils and the corresponding
testcase:

https://github.com/bkoppelmann/tricore-fpu

The one caveat is, that we cannot produce any binaries with the TriCore
ISA > 1.3.

In this testcase the last ftoi instruction is supposed to raise the
invalid flag and return 0 since the input was NaN. We did that by only
checking for NaN if any flag was raised after ftoi, then do the NaN
check, and if positive, return 0.

Cheers,
Bastian

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1759264

Title:
  fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns

Status in QEMU:
  New

Bug description:
  After the refactor from ab52f973a504f8de0c5df64631ba4caea70a7d9e the
  bahaviour of int32_to_float32() was altered.

  helper_ftoi() in target/tricore/fpu_helper.c relied on
  int32_to_float32 to raise the invalid flag if the input was NaN to
  properly return 0. Likewise if the input is infinity.

  The obvious fix for softfloat would be to raise this flag in round_to_int_and_pack(). However,
  I'm not sure if this breaks other targets and I have no easy way to test it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1759264/+subscriptions

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Bug 1759264] Re: fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns
  2018-04-11 12:46       ` Bastian Koppelmann
@ 2018-04-12 13:41         ` Alex Bennée
  2018-04-13 14:09           ` Bastian Koppelmann
  0 siblings, 1 reply; 10+ messages in thread
From: Alex Bennée @ 2018-04-12 13:41 UTC (permalink / raw)
  To: Bug 1759264; +Cc: qemu-devel


Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:

> On 04/11/2018 01:01 PM, Alex Bennée wrote:
>> Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:
>>
>>> On 04/10/2018 10:07 PM, Alex Bennée wrote:
>>>> Yeah it looks like it was missed, the round_to_uint code does it.
>>>>
>>>> Do you have a test case I can verify?
>>>>
>>>
>>> For the NaN input 0xffffffff the expected result for the flags is that
>>> flag_invalid is raised.
>>>
>>> I can provide you with some TriCore asm, but it is a bit of pain to get
>>> the gnu assembler to build, since the public version is a decade old.
>>
>> I'll trust you if you send me a static binary for this particular
>> verification ;-)
>
> I set up a github repo with working binutils and the corresponding
> testcase:
>
> https://github.com/bkoppelmann/tricore-fpu
>
> The one caveat is, that we cannot produce any binaries with the TriCore
> ISA > 1.3.
>
> In this testcase the last ftoi instruction is supposed to raise the
> invalid flag and return 0 since the input was NaN. We did that by only
> checking for NaN if any flag was raised after ftoi, then do the NaN
> check, and if positive, return 0.

Well it builds and I get an fpu-test.elf but I'm a bit stuck on how to
run it. What are the runes for launching the test?

>
> Cheers,
> Bastian


--
Alex Bennée

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Bug 1759264] Re: fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns
  2018-04-12 13:41         ` Alex Bennée
@ 2018-04-13 14:09           ` Bastian Koppelmann
  0 siblings, 0 replies; 10+ messages in thread
From: Bastian Koppelmann @ 2018-04-13 14:09 UTC (permalink / raw)
  To: qemu-devel

On 04/12/2018 03:41 PM, Alex Bennée wrote:
> Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:
> 
>> On 04/11/2018 01:01 PM, Alex Bennée wrote:
>>> Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:
>>>
>>>> On 04/10/2018 10:07 PM, Alex Bennée wrote:
>>>>> Yeah it looks like it was missed, the round_to_uint code does it.
>>>>>
>>>>> Do you have a test case I can verify?
>>>>>
>>>>
>>>> For the NaN input 0xffffffff the expected result for the flags is that
>>>> flag_invalid is raised.
>>>>
>>>> I can provide you with some TriCore asm, but it is a bit of pain to get
>>>> the gnu assembler to build, since the public version is a decade old.
>>>
>>> I'll trust you if you send me a static binary for this particular
>>> verification ;-)
>>
>> I set up a github repo with working binutils and the corresponding
>> testcase:
>>
>> https://github.com/bkoppelmann/tricore-fpu
>>
>> The one caveat is, that we cannot produce any binaries with the TriCore
>> ISA > 1.3.
>>
>> In this testcase the last ftoi instruction is supposed to raise the
>> invalid flag and return 0 since the input was NaN. We did that by only
>> checking for NaN if any flag was raised after ftoi, then do the NaN
>> check, and if positive, return 0.
> 
> Well it builds and I get an fpu-test.elf but I'm a bit stuck on how to
> run it. What are the runes for launching the test?

qemu-system-tricore -M tricore_testboard -kernel fpu-test.elf -nographic

However, this is not really a test. I usually run these against
Infineons golden (sadly proprietary) simulator and compare register
dumps. I have some more regression tests but I haven't had the time make
them into proper tests, such that we don't need this golden model.

Cheers,
Bastian

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1759264

Title:
  fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns

Status in QEMU:
  New

Bug description:
  After the refactor from ab52f973a504f8de0c5df64631ba4caea70a7d9e the
  bahaviour of int32_to_float32() was altered.

  helper_ftoi() in target/tricore/fpu_helper.c relied on
  int32_to_float32 to raise the invalid flag if the input was NaN to
  properly return 0. Likewise if the input is infinity.

  The obvious fix for softfloat would be to raise this flag in round_to_int_and_pack(). However,
  I'm not sure if this breaks other targets and I have no easy way to test it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1759264/+subscriptions

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Qemu-devel] [Bug 1759264] Re: fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns
  2018-03-27 13:00 [Qemu-devel] [Bug 1759264] [NEW] fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns Bastian Koppelmann
  2018-04-10 20:07 ` [Qemu-devel] [Bug 1759264] " Alex Bennée
@ 2018-04-16 16:20 ` Bastian Koppelmann
  2018-04-26  5:10 ` Thomas Huth
  2 siblings, 0 replies; 10+ messages in thread
From: Bastian Koppelmann @ 2018-04-16 16:20 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: New => Fix Committed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1759264

Title:
  fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns

Status in QEMU:
  Fix Committed

Bug description:
  After the refactor from ab52f973a504f8de0c5df64631ba4caea70a7d9e the
  bahaviour of int32_to_float32() was altered.

  helper_ftoi() in target/tricore/fpu_helper.c relied on
  int32_to_float32 to raise the invalid flag if the input was NaN to
  properly return 0. Likewise if the input is infinity.

  The obvious fix for softfloat would be to raise this flag in round_to_int_and_pack(). However,
  I'm not sure if this breaks other targets and I have no easy way to test it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1759264/+subscriptions

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Qemu-devel] [Bug 1759264] Re: fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns
  2018-03-27 13:00 [Qemu-devel] [Bug 1759264] [NEW] fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns Bastian Koppelmann
  2018-04-10 20:07 ` [Qemu-devel] [Bug 1759264] " Alex Bennée
  2018-04-16 16:20 ` Bastian Koppelmann
@ 2018-04-26  5:10 ` Thomas Huth
  2 siblings, 0 replies; 10+ messages in thread
From: Thomas Huth @ 2018-04-26  5:10 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1759264

Title:
  fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns

Status in QEMU:
  Fix Released

Bug description:
  After the refactor from ab52f973a504f8de0c5df64631ba4caea70a7d9e the
  bahaviour of int32_to_float32() was altered.

  helper_ftoi() in target/tricore/fpu_helper.c relied on
  int32_to_float32 to raise the invalid flag if the input was NaN to
  properly return 0. Likewise if the input is infinity.

  The obvious fix for softfloat would be to raise this flag in round_to_int_and_pack(). However,
  I'm not sure if this breaks other targets and I have no easy way to test it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1759264/+subscriptions

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-04-26  5:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-27 13:00 [Qemu-devel] [Bug 1759264] [NEW] fpu/softfloat: round_to_int_and_pack refactor broke TriCore ftoi insns Bastian Koppelmann
2018-04-10 20:07 ` [Qemu-devel] [Bug 1759264] " Alex Bennée
2018-04-11  9:23   ` Bastian Koppelmann
2018-04-11 11:01     ` Alex Bennée
2018-04-11 11:16       ` Bastian Koppelmann
2018-04-11 12:46       ` Bastian Koppelmann
2018-04-12 13:41         ` Alex Bennée
2018-04-13 14:09           ` Bastian Koppelmann
2018-04-16 16:20 ` Bastian Koppelmann
2018-04-26  5:10 ` Thomas Huth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.