|
From: | Qi Hu |
Subject: | Re: [PATCH 5/5] target/loongarch: div if x/0 set dividend to 0 |
Date: | Tue, 20 Sep 2022 10:18:05 +0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 |
On 2022/9/19 19:45, gaosong wrote:
在 2022/9/17 下午6:12, Richard Henderson 写道:I think the manual maybe not correct, the hardware engineer said that they need to comfirm whether the result is always 0.On 9/17/22 11:12, gaosong wrote:在 2022/9/17 下午4:59, Qi Hu 写道:On 2022/9/17 15:59, Song Gao wrote:div.d, div.du, div,w, div.wu, the LoongArch host if x/0 the result is 0.The message has a typo: "div,w" => "div.w"Also I don't know why we need to do this, since the manual say: "When the divisor is 0, the result can be any value".I tested on LoongArch host, the result is always 0.But it is legal for a different loongarch host implementation to return some other value. Therefore the test itself is not correct.Thanks. Song Gao
Hi,The hardware designers suggested that 0 should not be used as the default value when "div 0" occurs. The behavior is not guaranteed in future processors.
So I think there are some ways to solve this: - Remove this case("div 0") from risu test. - Keep this patch by yourself. If you want to do risu test, patch it. :-) regards, Qi
r~
[Prev in Thread] | Current Thread | [Next in Thread] |