machinst x64: implement floating point comparisons
Note that this fixes an encoding issue in which the packed single and packed double prefixes were flipped.
This commit is contained in:
@@ -1767,8 +1767,8 @@ pub(crate) fn emit(
|
||||
|
||||
Inst::XmmRmRImm { op, src, dst, imm } => {
|
||||
let prefix = match op {
|
||||
SseOpcode::Cmpps => LegacyPrefix::_66,
|
||||
SseOpcode::Cmppd => LegacyPrefix::None,
|
||||
SseOpcode::Cmpps => LegacyPrefix::None,
|
||||
SseOpcode::Cmppd => LegacyPrefix::_66,
|
||||
SseOpcode::Cmpss => LegacyPrefix::_F3,
|
||||
SseOpcode::Cmpsd => LegacyPrefix::_F2,
|
||||
_ => unimplemented!("Opcode {:?} not implemented", op),
|
||||
|
||||
@@ -3190,6 +3190,19 @@ fn test_x64_emit() {
|
||||
"psrlq $1, %xmm3",
|
||||
));
|
||||
|
||||
// ========================================================
|
||||
// XmmRmRImm
|
||||
insns.push((
|
||||
Inst::xmm_rm_r_imm(SseOpcode::Cmppd, RegMem::reg(xmm5), w_xmm1, 2),
|
||||
"660FC2CD02",
|
||||
"cmppd $2, %xmm5, %xmm1",
|
||||
));
|
||||
insns.push((
|
||||
Inst::xmm_rm_r_imm(SseOpcode::Cmpps, RegMem::reg(xmm15), w_xmm7, 0),
|
||||
"410FC2FF00",
|
||||
"cmpps $0, %xmm15, %xmm7",
|
||||
));
|
||||
|
||||
// ========================================================
|
||||
// Misc instructions.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user