1/* 2 * RISC-V translation routines for the RVB Standard Extension. 3 * 4 * Copyright (c) 2020 Kito Cheng, kito.cheng@sifive.com 5 * Copyright (c) 2020 Frank Chang, frank.chang@sifive.com 6 * 7 * This program is free software; you can redistribute it and/or modify it 8 * under the terms and conditions of the GNU General Public License, 9 * version 2 or later, as published by the Free Software Foundation. 10 * 11 * This program is distributed in the hope it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 * more details. 15 * 16 * You should have received a copy of the GNU General Public License along with 17 * this program. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20static bool trans_clz(DisasContext *ctx, arg_clz *a) 21{ 22 REQUIRE_EXT(ctx, RVB); 23 return gen_unary(ctx, a, gen_clz); 24} 25 26static bool trans_ctz(DisasContext *ctx, arg_ctz *a) 27{ 28 REQUIRE_EXT(ctx, RVB); 29 return gen_unary(ctx, a, gen_ctz); 30} 31 32static bool trans_clzw(DisasContext *ctx, arg_clzw *a) 33{ 34 REQUIRE_64BIT(ctx); 35 REQUIRE_EXT(ctx, RVB); 36 return gen_unary(ctx, a, gen_clzw); 37} 38 39static bool trans_ctzw(DisasContext *ctx, arg_ctzw *a) 40{ 41 REQUIRE_64BIT(ctx); 42 REQUIRE_EXT(ctx, RVB); 43 return gen_unary(ctx, a, gen_ctzw); 44} 45