1 // Copyright 2020 The SwiftShader Authors. All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #include "Reactor.hpp" 16 17 // Implementation of intrinsic functions that purport to be as optimal as 18 // possible, in contrast to the rr::emulated versions, typically by 19 // implementing approximations of the same math functions. 20 21 namespace rr { 22 namespace optimal { 23 24 Float4 Sin(RValue<Float4> x); 25 Float4 Cos(RValue<Float4> x); 26 Float4 Tan(RValue<Float4> x); 27 Float4 Asin_4_terms(RValue<Float4> x); 28 Float4 Asin_8_terms(RValue<Float4> x); 29 Float4 Acos_4_terms(RValue<Float4> x); 30 Float4 Acos_8_terms(RValue<Float4> x); 31 Float4 Atan(RValue<Float4> x); 32 Float4 Atan2(RValue<Float4> y, RValue<Float4> x); 33 Float4 Exp2(RValue<Float4> x); 34 Float4 Log2(RValue<Float4> x); 35 Float4 Exp(RValue<Float4> x); 36 Float4 Log(RValue<Float4> x); 37 Float4 Pow(RValue<Float4> x, RValue<Float4> y); 38 Float4 Sinh(RValue<Float4> x); 39 Float4 Cosh(RValue<Float4> x); 40 Float4 Tanh(RValue<Float4> x); 41 Float4 Asinh(RValue<Float4> x); 42 Float4 Acosh(RValue<Float4> x); 43 Float4 Atanh(RValue<Float4> x); 44 45 } // namespace optimal 46 } // namespace rr 47