Implement Insertlane for the Cranelift interpreter
Implemented `Insertlane` to insert a value in the lane specified by the immediate value, overwriting the existing value in that lane. Added `TernaryImm8` support for the `imm_value` function. Copyright (c) 2021, Arm Limited.
This commit is contained in:
@@ -672,7 +672,11 @@ where
|
||||
Opcode::Shuffle => unimplemented!("Shuffle"),
|
||||
Opcode::Swizzle => unimplemented!("Swizzle"),
|
||||
Opcode::Splat => unimplemented!("Splat"),
|
||||
Opcode::Insertlane => unimplemented!("Insertlane"),
|
||||
Opcode::Insertlane => {
|
||||
let mut vector = extractlanes(&arg(0)?, ctrl_ty.lane_type())?;
|
||||
vector[Value::into_int(imm())? as usize] = arg(1)?.into_int()?;
|
||||
assign(vectorizelanes(&vector, ctrl_ty)?)
|
||||
}
|
||||
Opcode::Extractlane => {
|
||||
let value =
|
||||
extractlanes(&arg(0)?, ctrl_ty.lane_type())?[Value::into_int(imm())? as usize];
|
||||
|
||||
Reference in New Issue
Block a user