@@ -537,6 +537,33 @@ const char*
537
537
= " b8_AVX_" ;
538
538
#endif
539
539
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
+
540
567
541
568
542
569
std::unique_ptr<BatchedBackendLLVM::TargetLibraryHelper>
@@ -592,6 +619,17 @@ BatchedBackendLLVM::TargetLibraryHelper::build(ShadingContext* context,
592
619
default : break ;
593
620
}
594
621
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
+
595
633
default : OSL_ASSERT (0 && " unsupported vector width" );
596
634
}
597
635
std::cerr << " Build is not configured to support TargetISA of "
@@ -735,6 +773,9 @@ BatchedBackendLLVM::llvm_type_batched_texture_options()
735
773
{
736
774
std::vector<unsigned int > offset_by_index;
737
775
switch (m_width) {
776
+ case 4 :
777
+ build_offsets_of_BatchedTextureOptions<4 >(offset_by_index);
778
+ break ;
738
779
case 8 :
739
780
build_offsets_of_BatchedTextureOptions<8 >(offset_by_index);
740
781
break ;
@@ -2698,6 +2739,9 @@ BatchedBackendLLVM::run()
2698
2739
{
2699
2740
std::vector<unsigned int > offset_by_index;
2700
2741
switch (m_width) {
2742
+ case 4 :
2743
+ build_offsets_of_BatchedShaderGlobals<4 >(offset_by_index);
2744
+ break ;
2701
2745
case 8 :
2702
2746
build_offsets_of_BatchedShaderGlobals<8 >(offset_by_index);
2703
2747
break ;
0 commit comments