Prevent clang-format from splitting shift operator
The expression "IfThenElse(e < 24, mantissa >> e, Int(0))" gets
rewritten into "IfThenElse(e<24, mantissa> > e, Int(0))" by some
versions of clang-format, thus breaking the build.
It's likely a clang-format bug that should be fixed, but the workaround
is simple and still quite elegant:
"IfThenElse(e < 24, (mantissa >> e), Int(0))"
Bug: b/144825072
Change-Id: I9cc19c6cae31bb0452b4e5402f6a742d15c45e55
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/39428
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Reactor/Reactor.cpp b/src/Reactor/Reactor.cpp
index 07e83c5..7767c0f 100644
--- a/src/Reactor/Reactor.cpp
+++ b/src/Reactor/Reactor.cpp
@@ -3778,7 +3778,7 @@
{
Int mantissa = (abs & 0x007FFFFF) | 0x00800000;
Int e = 113 - (abs >> 23);
- abs = IfThenElse(e < 24, mantissa >> e, Int(0));
+ abs = IfThenElse(e < 24, (mantissa >> e), Int(0));
fp16i |= UShort((abs + 0x00000FFF + ((abs >> 13) & 1)) >> 13);
}
Else