2012-04-29 16:21:21 +04:00
|
|
|
/*
|
|
|
|
* x86 condition code helpers
|
|
|
|
*
|
|
|
|
* Copyright (c) 2003 Fabrice Bellard
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "cpu.h"
|
|
|
|
#include "helper.h"
|
|
|
|
|
|
|
|
const uint8_t parity_table[256] = {
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,
|
|
|
|
0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
|
|
|
|
};
|
|
|
|
|
|
|
|
#define SHIFT 0
|
|
|
|
#include "cc_helper_template.h"
|
|
|
|
#undef SHIFT
|
|
|
|
|
|
|
|
#define SHIFT 1
|
|
|
|
#include "cc_helper_template.h"
|
|
|
|
#undef SHIFT
|
|
|
|
|
|
|
|
#define SHIFT 2
|
|
|
|
#include "cc_helper_template.h"
|
|
|
|
#undef SHIFT
|
|
|
|
|
|
|
|
#ifdef TARGET_X86_64
|
|
|
|
|
|
|
|
#define SHIFT 3
|
|
|
|
#include "cc_helper_template.h"
|
|
|
|
#undef SHIFT
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2012-04-29 16:45:34 +04:00
|
|
|
static int compute_all_eflags(CPUX86State *env)
|
2012-04-29 16:21:21 +04:00
|
|
|
{
|
|
|
|
return CC_SRC;
|
|
|
|
}
|
|
|
|
|
2012-04-29 16:45:34 +04:00
|
|
|
static int compute_c_eflags(CPUX86State *env)
|
2012-04-29 16:21:21 +04:00
|
|
|
{
|
|
|
|
return CC_SRC & CC_C;
|
|
|
|
}
|
|
|
|
|
2012-04-29 16:45:34 +04:00
|
|
|
uint32_t helper_cc_compute_all(CPUX86State *env, int op)
|
2012-04-29 16:21:21 +04:00
|
|
|
{
|
|
|
|
switch (op) {
|
|
|
|
default: /* should never happen */
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case CC_OP_EFLAGS:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_eflags(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_MULB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_mulb(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_MULW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_mulw(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_MULL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_mull(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_ADDB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_addb(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_ADDW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_addw(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_ADDL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_addl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_ADCB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_adcb(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_ADCW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_adcw(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_ADCL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_adcl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SUBB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_subb(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SUBW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_subw(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SUBL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_subl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SBBB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_sbbb(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SBBW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_sbbw(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SBBL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_sbbl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_LOGICB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_logicb(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_LOGICW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_logicw(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_LOGICL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_logicl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_INCB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_incb(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_INCW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_incw(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_INCL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_incl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_DECB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_decb(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_DECW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_decw(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_DECL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_decl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SHLB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_shlb(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SHLW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_shlw(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SHLL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_shll(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SARB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_sarb(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SARW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_sarw(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SARL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_sarl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
#ifdef TARGET_X86_64
|
|
|
|
case CC_OP_MULQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_mulq(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_ADDQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_addq(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_ADCQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_adcq(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SUBQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_subq(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SBBQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_sbbq(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_LOGICQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_logicq(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_INCQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_incq(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_DECQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_decq(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SHLQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_shlq(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SARQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_all_sarq(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-29 16:45:34 +04:00
|
|
|
uint32_t cpu_cc_compute_all(CPUX86State *env, int op)
|
2012-04-29 16:21:21 +04:00
|
|
|
{
|
2012-04-29 16:45:34 +04:00
|
|
|
return helper_cc_compute_all(env, op);
|
2012-04-29 16:21:21 +04:00
|
|
|
}
|
|
|
|
|
2012-04-29 16:45:34 +04:00
|
|
|
uint32_t helper_cc_compute_c(CPUX86State *env, int op)
|
2012-04-29 16:21:21 +04:00
|
|
|
{
|
|
|
|
switch (op) {
|
|
|
|
default: /* should never happen */
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case CC_OP_EFLAGS:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_eflags(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_MULB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_mull(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_MULW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_mull(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_MULL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_mull(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_ADDB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_addb(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_ADDW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_addw(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_ADDL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_addl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_ADCB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_adcb(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_ADCW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_adcw(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_ADCL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_adcl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SUBB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_subb(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SUBW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_subw(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SUBL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_subl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SBBB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_sbbb(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SBBW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_sbbw(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SBBL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_sbbl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_LOGICB:
|
|
|
|
return compute_c_logicb();
|
|
|
|
case CC_OP_LOGICW:
|
|
|
|
return compute_c_logicw();
|
|
|
|
case CC_OP_LOGICL:
|
|
|
|
return compute_c_logicl();
|
|
|
|
|
|
|
|
case CC_OP_INCB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_incl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_INCW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_incl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_INCL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_incl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_DECB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_incl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_DECW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_incl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_DECL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_incl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SHLB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_shlb(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SHLW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_shlw(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SHLL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_shll(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SARB:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_sarl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SARW:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_sarl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
case CC_OP_SARL:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_sarl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
#ifdef TARGET_X86_64
|
|
|
|
case CC_OP_MULQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_mull(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_ADDQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_addq(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_ADCQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_adcq(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SUBQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_subq(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SBBQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_sbbq(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_LOGICQ:
|
|
|
|
return compute_c_logicq();
|
|
|
|
|
|
|
|
case CC_OP_INCQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_incl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_DECQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_incl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SHLQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_shlq(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
|
|
|
|
case CC_OP_SARQ:
|
2012-04-29 16:45:34 +04:00
|
|
|
return compute_c_sarl(env);
|
2012-04-29 16:21:21 +04:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-29 16:45:34 +04:00
|
|
|
void helper_write_eflags(CPUX86State *env, target_ulong t0,
|
|
|
|
uint32_t update_mask)
|
2012-04-29 16:21:21 +04:00
|
|
|
{
|
|
|
|
cpu_load_eflags(env, t0, update_mask);
|
|
|
|
}
|
|
|
|
|
2012-04-29 16:45:34 +04:00
|
|
|
target_ulong helper_read_eflags(CPUX86State *env)
|
2012-04-29 16:21:21 +04:00
|
|
|
{
|
|
|
|
uint32_t eflags;
|
|
|
|
|
2012-04-29 16:45:34 +04:00
|
|
|
eflags = helper_cc_compute_all(env, CC_OP);
|
2012-04-29 16:21:21 +04:00
|
|
|
eflags |= (DF & DF_MASK);
|
|
|
|
eflags |= env->eflags & ~(VM_MASK | RF_MASK);
|
|
|
|
return eflags;
|
|
|
|
}
|
|
|
|
|
2012-04-29 16:45:34 +04:00
|
|
|
void helper_clts(CPUX86State *env)
|
2012-04-29 16:21:21 +04:00
|
|
|
{
|
|
|
|
env->cr[0] &= ~CR0_TS_MASK;
|
|
|
|
env->hflags &= ~HF_TS_MASK;
|
|
|
|
}
|
|
|
|
|
2012-04-29 16:45:34 +04:00
|
|
|
void helper_reset_rf(CPUX86State *env)
|
2012-04-29 16:21:21 +04:00
|
|
|
{
|
|
|
|
env->eflags &= ~RF_MASK;
|
|
|
|
}
|
|
|
|
|
2012-04-29 16:45:34 +04:00
|
|
|
void helper_cli(CPUX86State *env)
|
2012-04-29 16:21:21 +04:00
|
|
|
{
|
|
|
|
env->eflags &= ~IF_MASK;
|
|
|
|
}
|
|
|
|
|
2012-04-29 16:45:34 +04:00
|
|
|
void helper_sti(CPUX86State *env)
|
2012-04-29 16:21:21 +04:00
|
|
|
{
|
|
|
|
env->eflags |= IF_MASK;
|
|
|
|
}
|
|
|
|
|
2012-09-27 00:18:43 +04:00
|
|
|
void helper_clac(CPUX86State *env)
|
|
|
|
{
|
|
|
|
env->eflags &= ~AC_MASK;
|
|
|
|
}
|
|
|
|
|
|
|
|
void helper_stac(CPUX86State *env)
|
|
|
|
{
|
|
|
|
env->eflags |= AC_MASK;
|
|
|
|
}
|
|
|
|
|
2012-04-29 16:21:21 +04:00
|
|
|
#if 0
|
|
|
|
/* vm86plus instructions */
|
2012-04-29 16:45:34 +04:00
|
|
|
void helper_cli_vm(CPUX86State *env)
|
2012-04-29 16:21:21 +04:00
|
|
|
{
|
|
|
|
env->eflags &= ~VIF_MASK;
|
|
|
|
}
|
|
|
|
|
2012-04-29 16:45:34 +04:00
|
|
|
void helper_sti_vm(CPUX86State *env)
|
2012-04-29 16:21:21 +04:00
|
|
|
{
|
|
|
|
env->eflags |= VIF_MASK;
|
|
|
|
if (env->eflags & VIP_MASK) {
|
|
|
|
raise_exception(env, EXCP0D_GPF);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-04-29 16:45:34 +04:00
|
|
|
void helper_set_inhibit_irq(CPUX86State *env)
|
2012-04-29 16:21:21 +04:00
|
|
|
{
|
|
|
|
env->hflags |= HF_INHIBIT_IRQ_MASK;
|
|
|
|
}
|
|
|
|
|
2012-04-29 16:45:34 +04:00
|
|
|
void helper_reset_inhibit_irq(CPUX86State *env)
|
2012-04-29 16:21:21 +04:00
|
|
|
{
|
|
|
|
env->hflags &= ~HF_INHIBIT_IRQ_MASK;
|
|
|
|
}
|