2 * Power ISA decode for Storage Control instructions
4 * Copyright (c) 2022 Instituto de Pesquisas Eldorado (eldorado.org.br)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
21 * Processor Control Instructions
24 static bool trans_MSGCLR(DisasContext *ctx, arg_X_rb *a)
26 if (!(ctx->insns_flags2 & PPC2_ISA207S)) {
28 * Before Power ISA 2.07, processor control instructions were only
29 * implemented in the "Embedded.Processor Control" category.
31 REQUIRE_INSNS_FLAGS2(ctx, PRCNTL);
36 #if !defined(CONFIG_USER_ONLY)
37 if (is_book3s_arch2x(ctx)) {
38 gen_helper_book3s_msgclr(cpu_env, cpu_gpr[a->rb]);
40 gen_helper_msgclr(cpu_env, cpu_gpr[a->rb]);
43 qemu_build_not_reached();
48 static bool trans_MSGSND(DisasContext *ctx, arg_X_rb *a)
50 if (!(ctx->insns_flags2 & PPC2_ISA207S)) {
52 * Before Power ISA 2.07, processor control instructions were only
53 * implemented in the "Embedded.Processor Control" category.
55 REQUIRE_INSNS_FLAGS2(ctx, PRCNTL);
60 #if !defined(CONFIG_USER_ONLY)
61 if (is_book3s_arch2x(ctx)) {
62 gen_helper_book3s_msgsnd(cpu_gpr[a->rb]);
64 gen_helper_msgsnd(cpu_gpr[a->rb]);
67 qemu_build_not_reached();
72 static bool trans_MSGCLRP(DisasContext *ctx, arg_X_rb *a)
75 REQUIRE_INSNS_FLAGS2(ctx, ISA207S);
77 #if !defined(CONFIG_USER_ONLY) && defined(TARGET_PPC64)
78 gen_helper_book3s_msgclrp(cpu_env, cpu_gpr[a->rb]);
80 qemu_build_not_reached();
85 static bool trans_MSGSNDP(DisasContext *ctx, arg_X_rb *a)
88 REQUIRE_INSNS_FLAGS2(ctx, ISA207S);
90 #if !defined(CONFIG_USER_ONLY) && defined(TARGET_PPC64)
91 gen_helper_book3s_msgsndp(cpu_env, cpu_gpr[a->rb]);
93 qemu_build_not_reached();
98 static bool trans_MSGSYNC(DisasContext *ctx, arg_MSGSYNC *a)
100 REQUIRE_INSNS_FLAGS2(ctx, ISA300);
103 /* interpreted as no-op */