Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

[codegen] add encodings for isub borrow variants#962

Merged
bnjbvr merged 3 commits intobytecodealliance:masterfrom
ryzokuken:feature/86-32/isub
Sep 5, 2019
Merged

[codegen] add encodings for isub borrow variants#962
bnjbvr merged 3 commits intobytecodealliance:masterfrom
ryzokuken:feature/86-32/isub

Conversation

@ryzokuken
Copy link
Contributor

Add encodings for isub borrow variants (isub_bout, isub_bin, isub_borrow) for x86_32, enabling the legalization for isub.i64 to work.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1576675
Bug: https://github.com/CraneStation/cranelift/issues/765

/cc @bnjbvr @wingo @caitp

@ryzokuken
Copy link
Contributor Author

Depends on #961.

Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remark as for the add: the isub_ family should use iflags instead of b1. Can you tweak this here too, please?

@ryzokuken
Copy link
Contributor Author

@bnjbvr this should work too, now.

@bnjbvr bnjbvr self-requested a review September 5, 2019 09:35
@bnjbvr bnjbvr marked this pull request as ready for review September 5, 2019 13:04
@bnjbvr
Copy link
Member

bnjbvr commented Sep 5, 2019

Can you please rebase and autosquash?

Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct, but I'd like to see the rebased version first.

ebb0(v1: i64, v2: i64):
v10 = iadd v1, v2
; check: v1 = iconcat $(v1_lsb=$V), $(v1_msb=$V)
; check: v2 = iconcat $(v2_lsb=$V), $(v2_msb=$V)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, only the first line requires to be a check; next ones could be nextln, if the lines actually follow in the output. Can you try this, for all the tests in this file, and see if they still pass, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

Add encodings for isub borrow variants (isub_bout, isub_bin,
isub_borrow) for x86_32, enabling the legalization for isub.i64 to work.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1576675
Bug: https://github.com/CraneStation/cranelift/issues/765
Previously, the borrow variants of isub (isub_bin, isub_bout and
isub_borrow) were being legalized for isa/riscv since RISC architectures
lack a flags register.

This forced us to return and accept booleans for these operations, which
proved to be problematic and inconvenient, especially for x86.

This commit removes support for said statements and all dependent
statements for isa/riscv so that we can work on a better legalization
strategy in the future.
…ants

The type of the borrow operands for the borrow variants of the isub
instruction (isub_bin, isub_bout, isub_borrow) was bool for compatibility
reasons for isa/riscv. Since support for these instructions on RISC
architectures has been temporarily suspended, we can safely change the
type to iflags.
Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks!

@bnjbvr bnjbvr merged commit 31e7c29 into bytecodealliance:master Sep 5, 2019
ryzokuken added a commit to ryzokuken/cranelift that referenced this pull request Sep 9, 2019
…SC ISAs

Reintroduce support for iadd carry variants and isub borrow variants for
RISC ISAs which had been removed in
bytecodealliance#961 and
bytecodealliance#962 because of the lack
of a proper flags register in RISC architectures.
ryzokuken added a commit to ryzokuken/cranelift that referenced this pull request Sep 12, 2019
…SC ISAs

Reintroduce support for iadd carry variants and isub borrow variants for
RISC ISAs which had been removed in
bytecodealliance#961 and
bytecodealliance#962 because of the lack
of a proper flags register in RISC architectures.
bnjbvr pushed a commit that referenced this pull request Sep 13, 2019
#1005)

Reintroduce support for iadd carry variants and isub borrow variants for
RISC ISAs which had been removed in
#961 and
#962 because of the lack
of a proper flags register in RISC architectures.
arkpar pushed a commit to paritytech/wasmtime that referenced this pull request Mar 4, 2020
bytecodealliance#1005)

Reintroduce support for iadd carry variants and isub borrow variants for
RISC ISAs which had been removed in
bytecodealliance/cranelift#961 and
bytecodealliance/cranelift#962 because of the lack
of a proper flags register in RISC architectures.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants