mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-25 16:29:03 +00:00
Fix 32-bit Android build for ARMv7 (#842)
Tested with currently supported Android NDK r21d. Signed-off-by: James Morrissey <james.morrissey@arm.com>
This commit is contained in:
committed by
GitHub
parent
0ee260b036
commit
dda37d93f7
@@ -4,7 +4,7 @@ set (${MODULE_NAME}_SOURCES
|
|||||||
Sleep.cpp test_conversions.cpp basic_test_conversions.cpp
|
Sleep.cpp test_conversions.cpp basic_test_conversions.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX AND "${CLConform_TARGET_ARCH}" STREQUAL "ARM")
|
if("${CLConform_TARGET_ARCH}" STREQUAL "ARM")
|
||||||
list(APPEND ${MODULE_NAME}_SOURCES fplib.cpp)
|
list(APPEND ${MODULE_NAME}_SOURCES fplib.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,9 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "fplib.h"
|
#include "fplib.h"
|
||||||
|
|
||||||
|
#if !defined(FLT_MANT_DIG)
|
||||||
#define FLT_MANT_DIG 24
|
#define FLT_MANT_DIG 24
|
||||||
|
#endif
|
||||||
#define as_float(x) (*((float *)(&x)))
|
#define as_float(x) (*((float *)(&x)))
|
||||||
#define as_long(x) (*((int64_t *)(&x)))
|
#define as_long(x) (*((int64_t *)(&x)))
|
||||||
|
|
||||||
@@ -145,6 +147,9 @@ float qcom_s64_2_f32(int64_t data, bool sat, roundingMode rnd)
|
|||||||
return as_float(result);
|
return as_float(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case qcomRoundingModeCount: {
|
||||||
|
break; // Avoid build error for unhandled enum value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
@@ -216,6 +221,9 @@ float qcom_u64_2_f32(uint64_t data, bool sat, roundingMode rnd)
|
|||||||
uint32_t result = exponent | mantissa;
|
uint32_t result = exponent | mantissa;
|
||||||
return as_float(result); // for positive inputs return RTZ result
|
return as_float(result); // for positive inputs return RTZ result
|
||||||
}
|
}
|
||||||
|
case qcomRoundingModeCount: {
|
||||||
|
break; // Avoid build error for unhandled enum value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user