Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s390x: simplify ceil/floor code #246

Open
wants to merge 1 commit into
base: v2.1-agentzh
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/vm_s390x.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -2126,16 +2126,8 @@ static void build_subroutines(BuildCtx *ctx)
|// Value to round is in f0. May clobber f0-f7 and r0. Return address is r14.
|.macro vm_round, name, mask
|->name:
| ldr f4, f0
| lghi r0, 1
| cdfbr f1, r0
| didbr f0, f2, f1, mask // f0=remainder, f2=quotient.
| fidbra f4, mask, f4, 0
| ldr f0, f4
| jnle >1
| fidbra f0, mask, f0, 0
| br r14
|1: // partial remainder (sanity check)
| stg r0, 0
|.endmacro
|
| vm_round vm_floor, 7 // Round towards -inf.
Expand Down