/* * Copyright (c) 2022-present Trail of Bits, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "remill/Arch/PPC/Runtime/State.h" #include "remill/Arch/Runtime/Float.h" #include "remill/Arch/Runtime/Intrinsics.h" #include "remill/Arch/Runtime/Operators.h" // A definition is required to ensure that LLVM doesn't optimize the `State` type out of the bytecode // See https://github.com/lifting-bits/remill/pull/631#issuecomment-1279989004f State __remill_state; #define HYPER_CALL state.hyper_call namespace { DEF_SEM(HandleUnsupported) { return __remill_sync_hyper_call(state, memory, SyncHyperCall::kPPCEmulateInstruction); } DEF_SEM(HandleInvalidInstruction) { HYPER_CALL = AsyncHyperCall::kInvalidInstruction; return memory; } } // namespace DEF_ISEL(UNSUPPORTED_INSTRUCTION) = HandleUnsupported; DEF_ISEL(INVALID_INSTRUCTION) = HandleInvalidInstruction;