Commit 3224cd8a authored by xieyun's avatar xieyun Committed by V8 LUCI CQ

[loong64] Fix an undefined behavior

negation of 'INT64_MIN' cannot be represented in type 'int64_t'.


Change-Id: Ieddb0fc9bae4d3c85485bb94e76c05c72529a978
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3402665Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#78740}
parent 7308d3a7
......@@ -508,7 +508,7 @@ static const std::vector<int64_t> ffint_ftintrz_int64_test_values() {
static_cast<int64_t>(0xFFFFFFFFFFFFFFFF)};
return std::vector<int64_t>(&kValues[0], &kValues[arraysize(kValues)]);
}
// clang-off on
// clang-format on
// Helper macros that can be used in FOR_INT32_INPUTS(i) { ... *i ... }
#define FOR_INPUTS(ctype, itype, var, test_vector) \
......@@ -616,7 +616,7 @@ TEST(Ffint_d_l_Ftintrz_l_ud) {
CcTest::InitializeVM();
FOR_INT64_INPUTS(i, ffint_ftintrz_int64_test_values) {
int64_t input = *i;
uint64_t abs_input = (input < 0) ? -input : input;
uint64_t abs_input = (input >= 0 || input == INT64_MIN) ? input : -input;
auto fn = [](MacroAssembler* masm) {
__ movgr2fr_d(f8, a0);
__ ffint_d_l(f10, f8);
......
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