Skip to content

Commit 1538c50

Browse files
committed
fix denorm functions
1 parent cfa10db commit 1538c50

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

include/dxc/Test/HlslTestUtils.h

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -470,26 +470,19 @@ inline bool GetTestParamUseWARP(bool defaultVal) {
470470

471471
#ifdef FP_SUBNORMAL
472472

473-
inline bool isdenorm(float f) { return FP_SUBNORMAL == std::fpclassify(f); }
474-
475-
inline bool isdenorm(double d) { return FP_SUBNORMAL == std::fpclassify(d); }
473+
teamplate<typename T> inline bool isdenorm(T f) {
474+
return FP_SUBNORMAL == std::fpclassify(f);
475+
}
476476

477477
#else
478478

479-
inline bool isdenorm(float f) {
479+
template <typename T> inline bool isdenorm(T f) {
480480
return (std::numeric_limits<T>::denorm_min() <= f &&
481481
f < std::numeric_limits<T>::min()) ||
482482
(-std::numeric_limits<T>::min() < f &&
483483
f <= -std::numeric_limits<T>::denorm_min());
484484
}
485485

486-
inline bool isdenorm(double d) {
487-
return (std::numeric_limits<T>::denorm_min() <= d &&
488-
d < std::numeric_limits<T>::min()) ||
489-
(-std::numeric_limits<T>::min() < d &&
490-
d <= -std::numeric_limits<T>::denorm_min());
491-
}
492-
493486
#endif // FP_SUBNORMAL
494487

495488
inline float ifdenorm_flushf(float a) {

0 commit comments

Comments
 (0)