@@ -537,6 +537,33 @@ const char*
537537 = " b8_AVX_" ;
538538#endif
539539
540+ #ifdef __OSL_SUPPORTS_b4_SSE2
541+ template <>
542+ const NameAndSignature
543+ ConcreteTargetLibraryHelper<4 , TargetISA::x64>::library_functions[]
544+ = {
545+ # define DECL_INDIRECT (name, signature ) \
546+ NameAndSignature { #name, signature },
547+ # define DECL (name, signature ) DECL_INDIRECT(name, signature)
548+ # define __OSL_WIDTH 4
549+ # define __OSL_TARGET_ISA SSE2
550+ // Don't allow order of xmacro includes be rearranged
551+ // clang-format off
552+ # include " wide/define_opname_macros.h"
553+ # include " builtindecl_wide_xmacro.h"
554+ # include " wide/undef_opname_macros.h"
555+ // clang-format on
556+ # undef __OSL_TARGET_ISA
557+ # undef __OSL_WIDTH
558+ # undef DECL
559+ # undef DECL_INDIRECT
560+ };
561+ template <>
562+ const char *
563+ ConcreteTargetLibraryHelper<4 , TargetISA::x64>::library_selector_string
564+ = " b4_SSE2_" ;
565+ #endif
566+
540567
541568
542569std::unique_ptr<BatchedBackendLLVM::TargetLibraryHelper>
@@ -592,6 +619,17 @@ BatchedBackendLLVM::TargetLibraryHelper::build(ShadingContext* context,
592619 default : break ;
593620 }
594621 break ;
622+ case 4 :
623+ switch (target_isa) {
624+ #ifdef __OSL_SUPPORTS_b4_SSE2
625+ case TargetISA::x64:
626+ return RetType (
627+ new ConcreteTargetLibraryHelper<4 , TargetISA::x64>());
628+ #endif
629+ default : break ;
630+ }
631+ break ;
632+
595633 default : OSL_ASSERT (0 && " unsupported vector width" );
596634 }
597635 std::cerr << " Build is not configured to support TargetISA of "
@@ -735,6 +773,9 @@ BatchedBackendLLVM::llvm_type_batched_texture_options()
735773 {
736774 std::vector<unsigned int > offset_by_index;
737775 switch (m_width) {
776+ case 4 :
777+ build_offsets_of_BatchedTextureOptions<4 >(offset_by_index);
778+ break ;
738779 case 8 :
739780 build_offsets_of_BatchedTextureOptions<8 >(offset_by_index);
740781 break ;
@@ -2698,6 +2739,9 @@ BatchedBackendLLVM::run()
26982739 {
26992740 std::vector<unsigned int > offset_by_index;
27002741 switch (m_width) {
2742+ case 4 :
2743+ build_offsets_of_BatchedShaderGlobals<4 >(offset_by_index);
2744+ break ;
27012745 case 8 :
27022746 build_offsets_of_BatchedShaderGlobals<8 >(offset_by_index);
27032747 break ;
0 commit comments