// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

<%inherit file="base.tpl.cpp"/>\
<%namespace name="tests" file="opivv_opivx_test.tpl.cpp"/>
<%
import numpy as np
import vec_test_helpers
template_helper = vec_test_helpers.VecTemplateHelper(op, 32)
src2, src1, rs1 = template_helper.get_test_inputs(n=5)
src1_type = template_helper.get_np_src1_type()
tmp_src1 = src1 & (src1_type(0).itemsize * 8 -1)
dest_type = template_helper.get_np_dest_type()
ref_vv = np.right_shift(vec_test_helpers.cast_to_unsigned(src2), tmp_src1).astype(dest_type)
tmp_rs1 = rs1 & (src1_type(0).itemsize * 8 - 1)
ref_vx = np.right_shift(vec_test_helpers.cast_to_unsigned(src2), tmp_rs1).astype(dest_type)
%>\
${tests.test_opivv_opivx(template_helper, src2, src1, rs1, ref_vv, ref_vx)}
