// Copyright Advanced Micro Devices, Inc., or its affiliates. // SPDX-License-Identifier: MIT #pragma once #include namespace rocRoller { // GetGenerator function will return the Generator to use based on the provided arguments. template <> std::shared_ptr> GetGenerator(Register::ValuePtr dst, Register::ValuePtr arg, Expression::BitwiseNegate const&); // Templated Generator class based on the return type. class BitwiseNegateGenerator : public UnaryArithmeticGenerator { public: BitwiseNegateGenerator(ContextPtr c) : UnaryArithmeticGenerator(c) { } // Match function required by Component system for selecting the correct // generator. static bool Match(typename UnaryArithmeticGenerator::Argument const& arg) { ContextPtr ctx; Register::Type registerType; DataType dataType; std::tie(ctx, registerType, dataType) = arg; return true; } // Build function required by Component system to return the generator. static std::shared_ptr::Base> Build(typename UnaryArithmeticGenerator::Argument const& arg) { if(!Match(arg)) return nullptr; return std::make_shared(std::get<0>(arg)); } // Method to generate instructions Generator generate(Register::ValuePtr dst, Register::ValuePtr arg, Expression::BitwiseNegate const&); inline static const std::string Name = "BitwiseNegateGenerator"; }; }