mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
initial RISC-V support (#2614)
Unlike related PR #2344 that simply warns about unsupported FTZ, this PR attempts to correctly handle FTZ on RISC-V. RISC-V 'f' extension does not support any way to enable/disable flushing subnormals to zero, implementations are required to always support subnormals. Therefore this PR re-uses FTZ handling code from PPC, where flushing also has to be explicitly performed.
This commit is contained in:
@@ -201,6 +201,7 @@ RoundingMode get_round(void)
|
||||
#elif defined(__mips__)
|
||||
#include "mips/m32c1.h"
|
||||
#endif
|
||||
|
||||
void *FlushToZero(void)
|
||||
{
|
||||
#if defined(__APPLE__) || defined(__linux__) || defined(_WIN32)
|
||||
@@ -231,6 +232,8 @@ void *FlushToZero(void)
|
||||
#elif defined(__mips__)
|
||||
fpa_bissr(FPA_CSR_FS);
|
||||
return NULL;
|
||||
#elif defined(__riscv)
|
||||
return NULL;
|
||||
#else
|
||||
#error Unknown arch
|
||||
#endif
|
||||
@@ -266,6 +269,8 @@ void UnFlushToZero(void *p)
|
||||
_FPU_SETCW(flags);
|
||||
#elif defined(__mips__)
|
||||
fpa_bicsr(FPA_CSR_FS);
|
||||
#elif defined(__riscv)
|
||||
return;
|
||||
#else
|
||||
#error Unknown arch
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user