[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/+/3402665
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#78740}
This commit is contained in:
xieyun 2022-01-21 11:10:38 +08:00 committed by V8 LUCI CQ
parent 7308d3a7ac
commit 3224cd8aac

View File

@ -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);