[Mesa-dev] [PATCH v10 09/20] clover: Track flags per module section
Francisco Jerez
currojerez at riseup.net
Sat Jan 19 00:04:43 UTC 2019
Pierre Moreau <pierre.morrow at free.fr> 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 <awatry at gmail.com>
>
> Changes since:
> * v3: drop the modification to the tgsi backend, as already dropped
> (Aaron Watry)
>
> Signed-off-by: Pierre Moreau <pierre.morrow at free.fr>
> ---
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190118/4f26c240/attachment-0001.sig>
More information about the mesa-dev
mailing list