Pierre Moreau <[email protected]> writes: > One flag that needs to be tracked is whether a library is allowed to > received mathematics optimisations or not, as the authorisation is given > when creating the library while the optimisations are specified when > creating the executable. > > Reviewed-by: Aaron Watry <[email protected]> > > Changes since: > * v3: drop the modification to the tgsi backend, as already dropped > (Aaron Watry) > > Signed-off-by: Pierre Moreau <[email protected]> > --- > src/gallium/state_trackers/clover/core/module.cpp | 1 + > src/gallium/state_trackers/clover/core/module.hpp | 13 +++++++++---- > .../state_trackers/clover/llvm/codegen/bitcode.cpp | 3 ++- > .../state_trackers/clover/llvm/codegen/common.cpp | 2 +- > 4 files changed, 13 insertions(+), 6 deletions(-) > > diff --git a/src/gallium/state_trackers/clover/core/module.cpp > b/src/gallium/state_trackers/clover/core/module.cpp > index a6c5b98d8e0..0e11506d0d7 100644 > --- a/src/gallium/state_trackers/clover/core/module.cpp > +++ b/src/gallium/state_trackers/clover/core/module.cpp > @@ -163,6 +163,7 @@ namespace { > proc(S &s, QT &x) { > _proc(s, x.id); > _proc(s, x.type); > + _proc(s, x.flags); > _proc(s, x.size); > _proc(s, x.data); > } > diff --git a/src/gallium/state_trackers/clover/core/module.hpp > b/src/gallium/state_trackers/clover/core/module.hpp > index 2ddd26426fb..ff7e9b6234a 100644 > --- a/src/gallium/state_trackers/clover/core/module.hpp > +++ b/src/gallium/state_trackers/clover/core/module.hpp > @@ -41,14 +41,19 @@ namespace clover { > data_local, > data_private > }; > + enum class flags_t {
You probably want the type to be "enum flags" for consistency with the
other enums defined here.
> + none,
> + allow_link_options
And explicitly define allow_link_options = 1u, assuming that this is
going to be a bit-mask with multiple flags.
Is this patch being used at all in this series?
> + };
>
> - section(resource_id id, enum type type, size_t size,
> - const std::vector<char> &data) :
> - id(id), type(type), size(size), data(data) { }
> - section() : id(0), type(text_intermediate), size(0), data() { }
> + section(resource_id id, enum type type, flags_t flags,
> + size_t size, const std::vector<char> &data) :
> + id(id), type(type), flags(flags), size(size), data(data) { }
> + section() : id(0), type(text_intermediate), flags(flags_t::none),
> size(0), data() { }
>
> resource_id id;
> type type;
> + flags_t flags;
> size_t size;
> std::vector<char> data;
> };
> diff --git a/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
> b/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
> index 40bb426218d..8e9d4c7e85c 100644
> --- a/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
> @@ -84,7 +84,8 @@ clover::llvm::build_module_library(const ::llvm::Module
> &mod,
> enum module::section::type section_type) {
> module m;
> const auto code = emit_code(mod);
> - m.secs.emplace_back(0, section_type, code.size(), code);
> + m.secs.emplace_back(0, section_type, module::section::flags_t::none,
> + code.size(), code);
> return m;
> }
>
> diff --git a/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
> b/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
> index ca5f78940d2..a278e675003 100644
> --- a/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
> @@ -178,7 +178,7 @@ namespace {
> make_text_section(const std::vector<char> &code) {
> const pipe_llvm_program_header header { uint32_t(code.size()) };
> module::section text { 0, module::section::text_executable,
> - header.num_bytes, {} };
> + module::section::flags_t::none,
> header.num_bytes, {} };
>
> text.data.insert(text.data.end(), reinterpret_cast<const char
> *>(&header),
> reinterpret_cast<const char *>(&header) +
> sizeof(header));
> --
> 2.20.1
signature.asc
Description: PGP signature
_______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
