Generate new_vec using an iterator chain

Copyright (c) 2021, Arm Limited
This commit is contained in:
dheaton-arm
2021-09-20 10:31:34 +01:00
parent 3b9bfc8187
commit 8abb19cbd8

View File

@@ -850,14 +850,19 @@ where
let new_type = ctrl_ty.merge_lanes().unwrap(); let new_type = ctrl_ty.merge_lanes().unwrap();
let arg0 = extractlanes(&arg(0)?, ctrl_ty.lane_type())?; let arg0 = extractlanes(&arg(0)?, ctrl_ty.lane_type())?;
let arg1 = extractlanes(&arg(1)?, ctrl_ty.lane_type())?; let arg1 = extractlanes(&arg(1)?, ctrl_ty.lane_type())?;
let mut new_vec = SimdVec::new(); let new_vec = arg0
for (x, y) in arg0.chunks(2).into_iter().zip(arg1.chunks(2).into_iter()) { .chunks(2)
let mut z = 0i128; .into_iter()
for (lhs, rhs) in x.into_iter().zip(y.into_iter()) { .zip(arg1.chunks(2))
z += lhs.clone().into_int()? * rhs.clone().into_int()?; .into_iter()
} .map(|(x, y)| {
new_vec.push(Value::int(z, new_type.lane_type())?); let mut z = 0i128;
} for (lhs, rhs) in x.into_iter().zip(y.into_iter()) {
z += lhs.clone().into_int()? * rhs.clone().into_int()?;
}
Value::int(z, new_type.lane_type())
})
.collect::<ValueResult<Vec<_>>>()?;
assign(vectorizelanes(&new_vec, new_type)?) assign(vectorizelanes(&new_vec, new_type)?)
} }
Opcode::SqmulRoundSat => unimplemented!("SqmulRoundSat"), Opcode::SqmulRoundSat => unimplemented!("SqmulRoundSat"),