machinst x64: implement float-to-int and int-to-float conversions;
This commit is contained in:
@@ -332,7 +332,7 @@ pub(crate) enum InstructionSet {
|
||||
|
||||
/// Some scalar SSE operations requiring 2 operands r/m and r.
|
||||
/// TODO: Below only includes scalar operations. To be seen if packed will be added here.
|
||||
#[derive(Clone, PartialEq)]
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub enum SseOpcode {
|
||||
Addss,
|
||||
Addsd,
|
||||
@@ -797,3 +797,26 @@ impl BranchTarget {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An operand's size in bits.
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub enum OperandSize {
|
||||
Size32,
|
||||
Size64,
|
||||
}
|
||||
|
||||
impl OperandSize {
|
||||
pub(crate) fn to_bytes(&self) -> u8 {
|
||||
match self {
|
||||
Self::Size32 => 4,
|
||||
Self::Size64 => 8,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn to_bits(&self) -> u8 {
|
||||
match self {
|
||||
Self::Size32 => 32,
|
||||
Self::Size64 => 64,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user