1 // 2 // Copyright (c) 2017 The Khronos Group Inc. 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 // 16 #ifndef __ROUNDING_MODE_H__ 17 #define __ROUNDING_MODE_H__ 18 19 #include "compat.h" 20 21 #if (defined(_WIN32) && defined (_MSC_VER)) 22 #include "errorHelpers.h" 23 #include "testHarness.h" 24 #endif 25 26 typedef enum 27 { 28 kDefaultRoundingMode = 0, 29 kRoundToNearestEven, 30 kRoundUp, 31 kRoundDown, 32 kRoundTowardZero, 33 34 kRoundingModeCount 35 }RoundingMode; 36 37 typedef enum 38 { 39 kuchar = 0, 40 kchar = 1, 41 kushort = 2, 42 kshort = 3, 43 kuint = 4, 44 kint = 5, 45 kfloat = 6, 46 kdouble = 7, 47 kulong = 8, 48 klong = 9, 49 50 //This goes last 51 kTypeCount 52 }Type; 53 54 extern RoundingMode set_round( RoundingMode r, Type outType ); 55 extern RoundingMode get_round( void ); 56 extern void *FlushToZero( void ); 57 extern void UnFlushToZero( void *p); 58 59 60 61 #endif /* __ROUNDING_MODE_H__ */ 62