Skip to content

aarch64: Implement uextend/sextend for i128 values#3005

Merged
cfallin merged 2 commits into
bytecodealliance:mainfrom
afonso360:aarch64-i128-extend
Jun 22, 2021
Merged

aarch64: Implement uextend/sextend for i128 values#3005
cfallin merged 2 commits into
bytecodealliance:mainfrom
afonso360:aarch64-i128-extend

Conversation

@afonso360
Copy link
Copy Markdown
Contributor

Hey, a few more ops for i128 support

@afonso360 afonso360 force-pushed the aarch64-i128-extend branch from a609e77 to 2deb46e Compare June 20, 2021 14:50
@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator cranelift:area:aarch64 Issues related to AArch64 backend. labels Jun 20, 2021
@afonso360 afonso360 force-pushed the aarch64-i128-extend branch from 2deb46e to c771ab3 Compare June 21, 2021 08:39
Copy link
Copy Markdown
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

Thanks! Just a suggestion for a clarification to the branching logic below but otherwise looks good.


let needs_extend = from_bits < to_bits && to_bits <= 64;
// For i128, we want to extend the lower half, except if it is already 64 bits.
let needs_lower_extend = to_bits > 64 && from_bits < 64;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we clarify the logic a bit by adding a let pass_through_lower = to_bits > 64 && !needs_lower_extend here, then moving the move-emission below (will comment separately)?

});
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With the above pass_through_lower, could we do an else if pass_through_lower { ctx.emit(/* move */) } here? I like that arrangement a bit better as it gives a clear separation between "produce lower register" and "produce upper register" parts of the code.

@afonso360 afonso360 force-pushed the aarch64-i128-extend branch from c771ab3 to f25f5b2 Compare June 22, 2021 11:24
@afonso360 afonso360 requested a review from cfallin June 22, 2021 11:53
Copy link
Copy Markdown
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

Thanks!

@cfallin cfallin merged commit fa1a04d into bytecodealliance:main Jun 22, 2021
@afonso360 afonso360 deleted the aarch64-i128-extend branch June 25, 2021 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift:area:aarch64 Issues related to AArch64 backend. cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants