SpirvShader: Implement GLSLstd450Exp

Bug: b/126873455
Tests: dEQP-VK.glsl.builtin.precision.exp.*
Change-Id: I35a28475b56d820b6306782188d72a151845fe58
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28440
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Pipeline/SpirvShader.cpp b/src/Pipeline/SpirvShader.cpp
index e92c8b1..bc82fdb 100644
--- a/src/Pipeline/SpirvShader.cpp
+++ b/src/Pipeline/SpirvShader.cpp
@@ -3414,7 +3414,11 @@
 		}
 		case GLSLstd450Exp:
 		{
-			UNIMPLEMENTED("GLSLstd450Exp");
+			auto val = GenericValue(this, routine, insn.word(5));
+			for (auto i = 0u; i < type.sizeInComponents; i++)
+			{
+				dst.move(i, Exp(val.Float(i)));
+			}
 			break;
 		}
 		case GLSLstd450Log:
diff --git a/src/Reactor/LLVMReactor.cpp b/src/Reactor/LLVMReactor.cpp
index c04b300..e65f3fa 100644
--- a/src/Reactor/LLVMReactor.cpp
+++ b/src/Reactor/LLVMReactor.cpp
@@ -567,6 +567,7 @@
 			func_.emplace("atanhf", reinterpret_cast<void*>(atanhf));
 			func_.emplace("atan2f", reinterpret_cast<void*>(atan2f));
 			func_.emplace("powf", reinterpret_cast<void*>(powf));
+			func_.emplace("expf", reinterpret_cast<void*>(expf));
 
 #ifdef __APPLE__
 			// LLVM uses this function on macOS for tan.
@@ -3182,6 +3183,12 @@
 		return RValue<Float4>(V(::builder->CreateCall(func, { V(x.value), V(y.value) })));
 	}
 
+	RValue<Float4> Exp(RValue<Float4> v)
+	{
+		auto func = llvm::Intrinsic::getDeclaration(::module, llvm::Intrinsic::exp, { T(Float4::getType()) } );
+		return RValue<Float4>(V(::builder->CreateCall(func, { V(v.value) })));
+	}
+
 	Type *Float4::getType()
 	{
 		return T(llvm::VectorType::get(T(Float::getType()), 4));
diff --git a/src/Reactor/Reactor.hpp b/src/Reactor/Reactor.hpp
index 26b06fe..59f87ce 100644
--- a/src/Reactor/Reactor.hpp
+++ b/src/Reactor/Reactor.hpp
@@ -2225,6 +2225,7 @@
 	// Exponential functions
 	// TODO: Currentlhy unimplemented for Subzero.
 	RValue<Float4> Pow(RValue<Float4> x, RValue<Float4> y);
+	RValue<Float4> Exp(RValue<Float4> x);
 
 	template<class T>
 	class Pointer : public LValue<Pointer<T>>