Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:25
erlang
0567-AArch64-Correct-test-of-int-typed-return-v...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0567-AArch64-Correct-test-of-int-typed-return-value.patch of Package erlang
From 63d1bee55eb3e81ca3081d145a228ff0a5995ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Mon, 27 Nov 2023 12:26:23 +0100 Subject: [PATCH] AArch64: Correct test of int-typed return value The function `eq()` returns an `int`, but the code generated by the JIT for AArch64 tested the entire `x0` (ARG1) register. That happened to work because the way `eq()` is implemented, it does not return random garbage in the upper part of `x0`. Change the test to only check the lower part of ARG1 in case the implementation of `eq()` changes in the future. --- erts/emulator/beam/jit/arm/instr_common.cpp | 4 ++-- erts/emulator/beam/jit/arm/instr_guard_bifs.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/erts/emulator/beam/jit/arm/instr_common.cpp b/erts/emulator/beam/jit/arm/instr_common.cpp index 06ebae04b9..d244d8df1e 100644 --- a/erts/emulator/beam/jit/arm/instr_common.cpp +++ b/erts/emulator/beam/jit/arm/instr_common.cpp @@ -1500,7 +1500,7 @@ void BeamModuleAssembler::emit_is_eq_exact(const ArgLabel &Fail, emit_leave_runtime(); - a.cbz(ARG1, resolve_beam_label(Fail, disp1MB)); + a.cbz(ARG1.w(), resolve_beam_label(Fail, disp1MB)); a.bind(next); } @@ -1578,7 +1578,7 @@ void BeamModuleAssembler::emit_is_ne_exact(const ArgLabel &Fail, emit_leave_runtime(); - a.cbnz(ARG1, resolve_beam_label(Fail, disp1MB)); + a.cbnz(ARG1.w(), resolve_beam_label(Fail, disp1MB)); a.bind(next); } diff --git a/erts/emulator/beam/jit/arm/instr_guard_bifs.cpp b/erts/emulator/beam/jit/arm/instr_guard_bifs.cpp index c24ca4831f..2386a4a1bb 100644 --- a/erts/emulator/beam/jit/arm/instr_guard_bifs.cpp +++ b/erts/emulator/beam/jit/arm/instr_guard_bifs.cpp @@ -81,7 +81,7 @@ void BeamGlobalAssembler::emit_bif_is_eq_exact_shared() { emit_leave_runtime(); emit_leave_runtime_frame(); - a.cbz(ARG1, fail); + a.cbz(ARG1.w(), fail); a.bind(succ); { @@ -113,7 +113,7 @@ void BeamGlobalAssembler::emit_bif_is_ne_exact_shared() { emit_leave_runtime(); emit_leave_runtime_frame(); - a.cbnz(ARG1, fail); + a.cbnz(ARG1.w(), fail); a.bind(succ); { -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor