// Copyright 2019 The SwiftShader Authors. All Rights Reserved. // // 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 "Reactor.hpp" // Implementation of intrinsics that are "emulated" - that is, // implemented either in terms of Reactor code, or make use of // rr::Call to C functions. These are typically slower than implementing // in terms of direct calls to the JIT backend; however, provide a good // starting point for implementing a new backend, or for when adding // functionality to an existing backend is non-trivial. namespace rr { namespace emulated { RValue Gather(RValue> base, RValue offsets, RValue mask, unsigned int alignment, bool zeroMaskedLanes = false); RValue Gather(RValue> base, RValue offsets, RValue mask, unsigned int alignment, bool zeroMaskedLanes = false); void Scatter(RValue> base, RValue val, RValue offsets, RValue mask, unsigned int alignment); void Scatter(RValue> base, RValue val, RValue offsets, RValue mask, unsigned int alignment); RValue Exp2(RValue x); RValue Log2(RValue x); RValue Sin(RValue x); RValue Cos(RValue x); RValue Tan(RValue x); RValue Asin(RValue x); RValue Acos(RValue x); RValue Atan(RValue x); RValue Sinh(RValue x); RValue Cosh(RValue x); RValue Tanh(RValue x); RValue Asinh(RValue x); RValue Acosh(RValue x); RValue Atanh(RValue x); RValue Atan2(RValue x, RValue y); RValue Pow(RValue x, RValue y); RValue Exp(RValue x); RValue Log(RValue x); RValue Exp2(RValue x); RValue Log2(RValue x); RValue MinAtomic(RValue> x, RValue y, std::memory_order memoryOrder); RValue MinAtomic(RValue> x, RValue y, std::memory_order memoryOrder); RValue MaxAtomic(RValue> x, RValue y, std::memory_order memoryOrder); RValue MaxAtomic(RValue> x, RValue y, std::memory_order memoryOrder); RValue FRem(RValue lhs, RValue rhs); } // namespace emulated } // namespace rr