Commit 4e48c700 authored by Liu Yu's avatar Liu Yu Committed by V8 LUCI CQ

[loong64][simulator] Fix some floating_point ops implementation

Due to differences in compiler versions and optimization levels,
std::floor treats snan differently, as does std::ceil and std::trunc.
So the implementation of some instructions is sometimes inconsistent
with the physical machine. We add extra processing to them.

Besides, fix Loong64Debugger::Debug error in simulator, IsTrap
returns true only if break is encountered.

Change-Id: I240d91ed658645a2453162107b6dd172735fbfef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3661259Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Auto-Submit: Liu Yu <liuyu@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#80714}
parent 560ce080
......@@ -1276,7 +1276,8 @@ InstructionBase::Type InstructionBase::InstructionType() const {
template <class P>
bool InstructionGetters<P>::IsTrap() const {
return true;
if ((this->Bits(31, 15) << 15) == BREAK) return true;
return false;
}
} // namespace internal
......
This diff is collapsed.
......@@ -209,6 +209,13 @@ class Simulator : public SimulatorBase {
// for each native thread.
V8_EXPORT_PRIVATE static Simulator* current(v8::internal::Isolate* isolate);
float ceil(float value);
float floor(float value);
float trunc(float value);
double ceil(double value);
double floor(double value);
double trunc(double value);
// Accessors for register state. Reading the pc value adheres to the LOONG64
// architecture specification and is off by a 8 from the currently executing
// instruction.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment