mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +00:00
LibWasm: Remove unused vector methods of the interpreter
This commit is contained in:
parent
9cc3e7d32d
commit
4e8376d07e
Notes:
github-actions[bot]
2024-07-24 21:24:03 +00:00
Author: https://github.com/dzfrias
Commit: 4e8376d07e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/794
Reviewed-by: https://github.com/alimpfard
2 changed files with 5 additions and 30 deletions
|
@ -236,32 +236,9 @@ void BytecodeInterpreter::pop_and_push_m_splat(Wasm::Configuration& configuratio
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename M, template<typename> typename SetSign, typename VectorType>
|
template<typename M, template<typename> typename SetSign, typename VectorType>
|
||||||
Optional<VectorType> BytecodeInterpreter::pop_vector(Configuration& configuration)
|
VectorType BytecodeInterpreter::pop_vector(Configuration& configuration)
|
||||||
{
|
{
|
||||||
auto value = peek_vector<M, SetSign, VectorType>(configuration);
|
return bit_cast<VectorType>(configuration.stack().pop().get<Value>().value().get<u128>());
|
||||||
if (value.has_value())
|
|
||||||
configuration.stack().pop();
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename M, template<typename> typename SetSign, typename VectorType>
|
|
||||||
Optional<VectorType> BytecodeInterpreter::peek_vector(Configuration& configuration)
|
|
||||||
{
|
|
||||||
auto& entry = configuration.stack().peek();
|
|
||||||
auto value = entry.get<Value>().value().get_pointer<u128>();
|
|
||||||
if (!value)
|
|
||||||
return {};
|
|
||||||
auto vector = bit_cast<VectorType>(*value);
|
|
||||||
dbgln_if(WASM_TRACE_DEBUG, "stack({}) peek-> vector({:x})", *value, bit_cast<u128>(vector));
|
|
||||||
return vector;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename VectorType>
|
|
||||||
static u128 shuffle_vector(VectorType values, VectorType indices)
|
|
||||||
{
|
|
||||||
auto vector = bit_cast<VectorType>(values);
|
|
||||||
auto indices_vector = bit_cast<VectorType>(indices);
|
|
||||||
return bit_cast<u128>(shuffle_or_0(vector, indices_vector));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BytecodeInterpreter::call_address(Configuration& configuration, FunctionAddress address)
|
void BytecodeInterpreter::call_address(Configuration& configuration, FunctionAddress address)
|
||||||
|
@ -1290,8 +1267,8 @@ void BytecodeInterpreter::interpret(Configuration& configuration, InstructionPoi
|
||||||
return pop_and_push_m_splat<64, NativeFloatingType>(configuration, instruction);
|
return pop_and_push_m_splat<64, NativeFloatingType>(configuration, instruction);
|
||||||
case Instructions::i8x16_shuffle.value(): {
|
case Instructions::i8x16_shuffle.value(): {
|
||||||
auto& arg = instruction.arguments().get<Instruction::ShuffleArgument>();
|
auto& arg = instruction.arguments().get<Instruction::ShuffleArgument>();
|
||||||
auto b = *pop_vector<u8, MakeUnsigned>(configuration);
|
auto b = pop_vector<u8, MakeUnsigned>(configuration);
|
||||||
auto a = *pop_vector<u8, MakeUnsigned>(configuration);
|
auto a = pop_vector<u8, MakeUnsigned>(configuration);
|
||||||
using VectorType = Native128ByteVectorOf<u8, MakeUnsigned>;
|
using VectorType = Native128ByteVectorOf<u8, MakeUnsigned>;
|
||||||
VectorType result;
|
VectorType result;
|
||||||
for (size_t i = 0; i < 16; ++i)
|
for (size_t i = 0; i < 16; ++i)
|
||||||
|
|
|
@ -65,9 +65,7 @@ protected:
|
||||||
template<size_t M, template<size_t> typename NativeType>
|
template<size_t M, template<size_t> typename NativeType>
|
||||||
void pop_and_push_m_splat(Configuration&, Instruction const&);
|
void pop_and_push_m_splat(Configuration&, Instruction const&);
|
||||||
template<typename M, template<typename> typename SetSign, typename VectorType = Native128ByteVectorOf<M, SetSign>>
|
template<typename M, template<typename> typename SetSign, typename VectorType = Native128ByteVectorOf<M, SetSign>>
|
||||||
Optional<VectorType> pop_vector(Configuration&);
|
VectorType pop_vector(Configuration&);
|
||||||
template<typename M, template<typename> typename SetSign, typename VectorType = Native128ByteVectorOf<M, SetSign>>
|
|
||||||
Optional<VectorType> peek_vector(Configuration&);
|
|
||||||
void store_to_memory(Configuration&, Instruction::MemoryArgument const&, ReadonlyBytes data, u32 base);
|
void store_to_memory(Configuration&, Instruction::MemoryArgument const&, ReadonlyBytes data, u32 base);
|
||||||
void call_address(Configuration&, FunctionAddress);
|
void call_address(Configuration&, FunctionAddress);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue