Browse Source

Fix incorrect assertion for `insertlane` (#1355)

Previously, the assertion checked for `lane > 0` when it should have been `lane >= 0`; since lane is unsigned, this half of the assertion can be entirely removed.
pull/1019/head
Andrew Brown 5 years ago
committed by GitHub
parent
commit
fd04ea2b06
  1. 2
      cranelift/codegen/src/isa/x86/enc_tables.rs

2
cranelift/codegen/src/isa/x86/enc_tables.rs

@ -1173,7 +1173,7 @@ fn convert_insertlane(
// Floats are already in XMM registers and can stay there.
match value_type {
F32X4 => {
assert!(lane > 0 && lane <= 3);
assert!(lane <= 3);
let immediate = 0b00_00_00_00 | lane << 4;
// Insert 32-bits from replacement (at index 00, bits 7:8) to vector (lane
// shifted into bits 5:6).

Loading…
Cancel
Save