Adds support for legalizing CLZ, CTZ and POPCOUNT on baseline x86_64 targets.
Changes: * Adds a new generic instruction, SELECTIF, that does value selection (a la conditional move) similarly to existing SELECT, except that it is controlled by condition code input and flags-register inputs. * Adds a new Intel x86_64 variant, 'baseline', that supports SSE2 and nothing else. * Adds new Intel x86_64 instructions BSR and BSF. * Implements generic CLZ, CTZ and POPCOUNT on x86_64 'baseline' targets using the new BSR, BSF and SELECTIF instructions. * Implements SELECTIF on x86_64 targets using conditional-moves. * new test filetests/isa/intel/baseline_clz_ctz_popcount.cton (for legalization) * new test filetests/isa/intel/baseline_clz_ctz_popcount_encoding.cton (for encoding) * Allow lib/cretonne/meta/gen_legalizer.py to generate non-snake-caseified Rust without rustc complaining. Fixes #238.
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
e3714ddd10
commit
6f8a54b6a5
@@ -2119,6 +2119,25 @@ impl<'a> Parser<'a> {
|
||||
let arg = self.match_value("expected SSA value")?;
|
||||
InstructionData::FloatCond { opcode, cond, arg }
|
||||
}
|
||||
InstructionFormat::IntSelect => {
|
||||
let cond = self.match_enum("expected intcc condition code")?;
|
||||
let guard = self.match_value("expected SSA value first operand")?;
|
||||
self.match_token(
|
||||
Token::Comma,
|
||||
"expected ',' between operands",
|
||||
)?;
|
||||
let v_true = self.match_value("expected SSA value second operand")?;
|
||||
self.match_token(
|
||||
Token::Comma,
|
||||
"expected ',' between operands",
|
||||
)?;
|
||||
let v_false = self.match_value("expected SSA value third operand")?;
|
||||
InstructionData::IntSelect {
|
||||
opcode,
|
||||
cond,
|
||||
args: [guard, v_true, v_false],
|
||||
}
|
||||
}
|
||||
InstructionFormat::Call => {
|
||||
let func_ref = self.match_fn("expected function reference").and_then(
|
||||
|num| {
|
||||
|
||||
Reference in New Issue
Block a user