SpirvShader: Implement GLSLstd450Find[U,S]Msb

Bug: b/126873455
Tests: dEQP-VK.glsl.builtin.function.integer.findMSB.*
Change-Id: I6337998f725334c31d8adeae05fc441bb3895908
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28788
Tested-by: Ben Clayton <bclayton@google.com>
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/Reactor/LLVMReactor.cpp b/src/Reactor/LLVMReactor.cpp
index 8b3be66..2508508 100644
--- a/src/Reactor/LLVMReactor.cpp
+++ b/src/Reactor/LLVMReactor.cpp
@@ -3210,6 +3210,15 @@
 		return RValue<Float4>(V(::builder->CreateCall(func, { V(v.value) })));
 	}
 
+	RValue<UInt4> Ctlz(RValue<UInt4> v, bool isZeroUndef)
+	{
+		auto func = llvm::Intrinsic::getDeclaration(::module, llvm::Intrinsic::ctlz, { T(UInt4::getType()), T(Bool::getType()) } );
+		return RValue<UInt4>(V(::builder->CreateCall(func, {
+			V(v.value),
+			isZeroUndef ? ::llvm::ConstantInt::getTrue(*::context) : ::llvm::ConstantInt::getFalse(*::context)
+		})));
+	}
+
 	Type *Float4::getType()
 	{
 		return T(llvm::VectorType::get(T(Float::getType()), 4));