x64: Add shuffle specialization for palignr (#5999)
* x64: Add `shuffle` specialization for `palignr` This commit adds specializations for the `palignr` instruction to the x64 backend to specialize some more patterns of byte shuffles. * Fix tests
This commit is contained in:
@@ -1117,6 +1117,16 @@ impl Context for IsleContext<'_, '_, MInst, X64Backend> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
fn palignr_imm_from_immediate(&mut self, imm: Immediate) -> Option<u8> {
|
||||
let bytes = self.lower_ctx.get_immediate_data(imm).as_slice();
|
||||
|
||||
if bytes.windows(2).all(|a| a[0] + 1 == a[1]) {
|
||||
Some(bytes[0])
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl IsleContext<'_, '_, MInst, X64Backend> {
|
||||
|
||||
Reference in New Issue
Block a user