Statistics
| Branch: | Revision:

root / target-i386 / translate.c @ c09b437b

History | View | Annotate | Download (283.2 kB)

# Date Author Comment
d640045a 04/13/2013 02:51 pm Aurelien Jarno

target-i386: add AES-NI instructions

Reviewed-by: Edgar E. Iglesias <>
Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

e71827bc 04/13/2013 02:51 pm Aurelien Jarno

target-i386: add pclmulqdq instruction

Reviewed-by: Richard Henderson <>
Reviewed-by: Edgar E. Iglesias <>
Signed-off-by: Aurelien Jarno <>

34c6addd 04/01/2013 07:49 pm Aurelien Jarno

target-i386: SSE4.1: fix pinsrb instruction

gen_op_mov_TN_reg() loads the value in cpu_T0, so this temporary should
be used instead of cpu_tmp0.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

c53de1a2 03/23/2013 04:26 pm Richard Henderson

target-i386: Fix flags computation for ADOX

When starting from CC_OP_DYNAMIC, and issuing adox before adcx,
a typo used the wrong value for the resulting CC_OP.

Cc: Blue Swirl <>
Reported-by: Torbjorn Granlund <>
Signed-off-by: Richard Henderson <>...

085d8134 03/22/2013 02:25 pm Peter Maydell

Fix typos and misspellings

Fix various typos and misspellings. The bulk of these were found with
codespell.

Signed-off-by: Peter Maydell <>
Reviewed-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

806f352d 03/03/2013 04:29 pm Peter Maydell

gen-icount.h: Rename gen_icount_start/end to gen_tb_start/end

The gen_icount_start/end functions are now somewhat misnamed since they
are useful for generic "start/end of TB" code, used for more than just
icount. Rename them to gen_tb_start/end.

Signed-off-by: Peter Maydell <>...

a4bcea3d 02/27/2013 09:06 pm Richard Henderson

target-i386: Use mulu2 and muls2

These correspond very closely to the insns that we're emulating.

Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

76f13133 02/23/2013 07:25 pm Richard Henderson

target-i386: Use add2 to implement the ADX extension

Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

a41f62f5 02/20/2013 09:05 am Richard Henderson

target-i386: Use movcond to implement shift flags.

With this being all straight-line code, it can get deleted
when the cc variables die.

Signed-off-by: Richard Henderson <>

34d80a55 02/20/2013 09:05 am Richard Henderson

target-i386: Use movcond to implement rotate flags.

With this being all straight-line code, it can get deleted
when the cc variables die.

Signed-off-by: Richard Henderson <>

e2f515cf 02/20/2013 09:05 am Richard Henderson

target-i386: Discard CC_OP computation in set_cc_op also

The shift and rotate insns use movcond to set CC_OP, and thus
achieve a conditional EFLAGS setting. By discarding CC_OP in
a later flags setting insn, we can discard that movcond.

Signed-off-by: Richard Henderson <>

f437d0a3 02/20/2013 09:05 am Richard Henderson

target-i386: Use movcond to implement shiftd.

With this being all straight-line code, it can get deleted
when the cc variables die.

Signed-off-by: Richard Henderson <>

cd7f97ca 02/20/2013 09:05 am Richard Henderson

target-i386: Implement ADX extension

Signed-off-by: Richard Henderson <>

321c5351 02/20/2013 09:05 am Richard Henderson

target-i386: Implement tzcnt and fix lzcnt

We weren't computing flags for lzcnt at all. At the same time,
adjust the implementation of bsf/bsr to avoid the local branch,
using movcond instead.

Signed-off-by: Richard Henderson <>

436ff2d2 02/20/2013 09:05 am Richard Henderson

target-i386: Add CC_OP_CLR

Special case xor with self. We need not even store the known
zero into cc_src.

Signed-off-by: Richard Henderson <>

02ea1e6b 02/19/2013 01:52 am Richard Henderson

target-i386: Implement BZHI

Signed-off-by: Richard Henderson <>

5f1f4b17 02/19/2013 01:52 am Richard Henderson

target-i386: Implement MULX

Signed-off-by: Richard Henderson <>

0592f74a 02/19/2013 01:52 am Richard Henderson

target-i386: Implement PDEP, PEXT

Signed-off-by: Richard Henderson <>

4a554890 02/19/2013 01:52 am Richard Henderson

target-i386: Implement SHLX, SARX, SHRX

Signed-off-by: Richard Henderson <>

e2c3c2c5 02/19/2013 01:52 am Richard Henderson

target-i386: Implement RORX

Signed-off-by: Richard Henderson <>

bc4b43dc 02/19/2013 01:52 am Richard Henderson

target-i386: Implement BLSR, BLSMSK, BLSI

Do all of group 17 at one time for ease.

Signed-off-by: Richard Henderson <>

701ed211 02/19/2013 01:39 am Richard Henderson

target-i386: Decode the VEX prefixes

No actual required uses of these encodings yet.

Signed-off-by: Richard Henderson <>

111994ee 02/19/2013 01:39 am Richard Henderson

target-i386: Implement MOVBE

Signed-off-by: Richard Henderson <>

7073fbad 02/19/2013 01:39 am Richard Henderson

target-i386: Implement ANDN

As this is the first of the BMI insns to be implemented,
this carries quite a bit more baggage than normal.

Signed-off-by: Richard Henderson <>

c7ab7565 02/19/2013 01:39 am Richard Henderson

target-i386: Implement BEXTR

Signed-off-by: Richard Henderson <>

4a6fd938 02/19/2013 01:39 am Richard Henderson

target-i386: Tidy prefix parsing

Avoid duplicating switch statement between 32 and 64-bit modes.

Signed-off-by: Richard Henderson <>

988c3eb0 02/19/2013 01:39 am Richard Henderson

target-i386: Use CC_SRC2 for ADC and SBB

Add another slot in ENV and store two of the three inputs. This lets us
do less work when carry-out is not needed, and avoids the unpredictable
CC_OP after translating these insns.

Signed-off-by: Richard Henderson <>

db9f2597 02/19/2013 01:25 am Richard Henderson

target-i386: Make helper_cc_compute_{all,c} const

Pass the data in explicitly, rather than indirectly via env.
This avoids all sorts of unnecessary register spillage.

Signed-off-by: Richard Henderson <>

63633fe6 02/19/2013 01:03 am Richard Henderson

target-i386: use gen_op for cmps/scas

Replace low-level ops with a higher-level "cmp %al, (A0)" in the case
of scas, and "cmp T0, (A0)" in the case of cmps.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Richard Henderson <>

dc259201 02/19/2013 01:03 am Richard Henderson

target-i386: introduce gen_jcc1_noeob

A jump that ends a basic block or otherwise falls back to CC_OP_DYNAMIC
will always have to call gen_op_set_cc_op. However, not all jumps end
a basic block, so introduce a variant that does not do this.

This was partially undone earlier (i386: drop cc_op argument of gen_jcc1),...

891a5133 02/19/2013 01:03 am Richard Henderson

target-i386: Update cc_op before TCG branches

Placing the CC_OP_DYNAMIC at the join is less effective than
before the branch, as the branch will have forced global registers
to their home locations. This way we have a chance to discard
CC_SRC2 before it gets stored....

a3251186 02/19/2013 01:03 am Richard Henderson

target-i386: optimize flags checking after sub using CC_SRCT

After a comparison or subtraction, the original value of the LHS will
currently be reconstructed using an addition. However, in most cases
it is already available: store it in a temp-local variable and save 1...

086c4077 02/19/2013 01:03 am Richard Henderson

target-i386: do not call helper to compute ZF/SF

ZF, SF and PF can always be computed from CC_DST except in the
CC_OP_EFLAGS case (and CC_OP_DYNAMIC, which just resolves to CC_OP_EFLAGS
in gen_compute_eflags). Use setcond to compute ZF and SF.

We could also use a table lookup to compute PF....

8115f117 02/19/2013 01:03 am Richard Henderson

target-i386: use inverted setcond when computing NS or NZ

Make gen_compute_eflags_z and gen_compute_eflags_s able to compute the
inverted condition, and use this in gen_setcc_slow_T0. We cannot do it
yet in gen_compute_eflags_c, but prepare the code for it anyway. It is...

06847f1f 02/19/2013 01:03 am Richard Henderson

target-i386: convert gen_compute_eflags_c to TCG

Do the switch at translation time, converting the helper templates to
TCG opcodes. In some cases CF can be computed with a single setcond,
though others it may require a little more work.

In the CC_OP_DYNAMIC case, compute the whole EFLAGS, same as for ZF/SF/PF....

1a5c6359 02/19/2013 01:03 am Paolo Bonzini

target-i386: change gen_setcc_slow_T0 to gen_setcc_slow

Do not hard code the destination register.

Reviewed-by: Blue Swirl <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Richard Henderson <>

2cb47645 02/19/2013 01:03 am Richard Henderson

target-i386: optimize setbe

This is looking at EFLAGS, but it can do so more efficiently with
setcond.

Reviewed-by: Blue Swirl <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Richard Henderson <>

be10b289 02/19/2013 01:03 am Richard Henderson

target-i386: optimize setle

And allow gen_setcc_slow to operate on cpu_cc_src.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Richard Henderson <>

c365395e 02/19/2013 01:03 am Paolo Bonzini

target-i386: optimize setcc instructions

Reconstruct the arguments for complex conditions involving CC_OP_SUBx (BE,
L, LE). In the others do it via setcond and gen_setcc_slow (which is
not that slow in many cases).

Signed-off-by: Paolo Bonzini <>...

bec93d72 02/19/2013 01:03 am Richard Henderson

target-i386: introduce CCPrepare

Introduce a struct that describes how to build a cond operation
that checks for a given x86 condition code. For now, just change
gen_compute_eflags_
to return the new struct, generate code for
the CCPrepare struct, and go on as before....

276e6b5f 02/19/2013 01:03 am Richard Henderson

target-i386: introduce gen_prepare_cc

This makes the i386 front-end able to create CCPrepare structs for all
condition, not just those that come from a single flag. In particular,
JCC_L and JCC_LE can be optimized because gen_prepare_cc is not forced
to return a result in bit 0 (unlike gen_setcc_slow)....

943131ca 02/19/2013 01:03 am Paolo Bonzini

target-i386: use CCPrepare to generate conditional jumps

This simplifies all the jump generation code. CCPrepare allows the
code to create an efficient brcond always, so there is no need to
duplicate the setcc and jcc code.

Signed-off-by: Paolo Bonzini <>...

69d1aa31 02/19/2013 01:03 am Richard Henderson

target-i386: inline gen_prepare_cc_slow

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Richard Henderson <>

cc8b6f5b 02/19/2013 01:03 am Paolo Bonzini

target-i386: cleanup temporary macros for CCPrepare

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Richard Henderson <>

f32d3781 02/19/2013 01:03 am Paolo Bonzini

target-i386: introduce gen_cmovcc1

Signed-off-by: Richard Henderson <>

57eb0cc8 02/19/2013 01:03 am Richard Henderson

target-i386: expand cmov via movcond

Signed-off-by: Richard Henderson <>

3b9d3cf1 02/19/2013 01:03 am Paolo Bonzini

target-i386: kill cpu_T3

It is almost unused, and it is simpler to pass a TCG value directly
to gen_shiftd_rm_T1_T3. This value is then written to t2 without
going through a temporary register.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Richard Henderson <>

f5847c91 02/19/2013 01:03 am Paolo Bonzini

target-i386: compute eflags outside rcl/rcr helper

Always compute EFLAGS first since it is needed whenever
the shift is non-zero, i.e. most of the time. This makes it possible
to remove some writes of CC_OP_EFLAGS to cpu_cc_op and more importantly
removes cases where s->cc_op becomes CC_OP_DYNAMIC. Also, we can...

6fa38ed2 02/19/2013 01:03 am Paolo Bonzini

target-i386: clean up sahf

Discard CC_DST and set s->cc_op immediately after computing EFLAGS.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Richard Henderson <>

5bdb91b0 02/19/2013 01:03 am Paolo Bonzini

target-i386: use gen_jcc1 to compile loopz

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Richard Henderson <>

c7b3c873 02/19/2013 01:03 am Paolo Bonzini

target-i386: factor gen_op_set_cc_op/tcg_gen_discard_tl around computing flags

Before computing flags we need to store the cc_op to memory. Move this
to gen_compute_eflags_c and gen_compute_eflags rather than doing it all
over the place.

Alo, after computing the flags in cpu_cc_src we are in EFLAGS mode....

fee71888 02/19/2013 01:03 am Richard Henderson

target-i386: Name the cc_op enumeration

Signed-off-by: Richard Henderson <>

3ca51d07 02/19/2013 01:03 am Richard Henderson

target-i386: Introduce set_cc_op

This will provide a good hook into which we can consolidate
all of the cc variable discards.

Signed-off-by: Richard Henderson <>

e207582f 02/19/2013 01:03 am Richard Henderson

target-i386: Don't clobber s->cc_op in gen_update_cc_op

Use a dirty flag to know whether env->cc_op is up to date,
rather than forcing s->cc_op to DYNAMIC and losing info.

Signed-off-by: Richard Henderson <>

773cdfcc 02/19/2013 01:03 am Richard Henderson

target-i386: Use gen_update_cc_op everywhere

All of the conditional calls to gen_op_set_cc_op go away, and
gen_op_set_cc_op itself gets inlined into its only remaining caller.

Signed-off-by: Richard Henderson <>

1608ecca 02/19/2013 01:03 am Paolo Bonzini

target-i386: add helper functions to get other flags

Introduce new functions to extract PF, SF, OF, ZF in addition to CF.
These provide single entry points for optimizing accesses to a single
flag.

Reviewed-by: Blue Swirl <>
Signed-off-by: Paolo Bonzini <>...

d229edce 02/19/2013 01:03 am Richard Henderson

target-i386: do not compute eflags multiple times consecutively

After calling gen_compute_eflags, leave the computed value in cc_reg_src
and set cc_op to CC_OP_EFLAGS. The next few patches will remove anyway
most calls to gen_compute_eflags.

As a result of this change it is more natural to remove the register...

ccfcdd09 02/19/2013 01:03 am Richard Henderson

target-i386: no need to flush out cc_op before gen_eob

This makes code more similar to the other callers of gen_eob, especially
loopz/loopnz/jcxz.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Richard Henderson <>

b666265b 02/19/2013 01:03 am Richard Henderson

target-i386: Move CC discards to set_cc_op

This gets us universal coverage, rather than scattering discards
around at various places. As a bonus, we do not emit redundant
discards e.g. between sequential logic insns.

Signed-off-by: Richard Henderson <>

93ab25d7 02/19/2013 01:03 am Paolo Bonzini

target-i386: use OT_* consistently

Reviewed-by: Blue Swirl <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Richard Henderson <>

d824df34 02/19/2013 01:03 am Paolo Bonzini

target-i386: introduce gen_ext_tl

Introduce a function that abstracts extracting an 8, 16, 32 or 64-bit value
with or without sign, generalizing gen_extu and gen_exts.

Reviewed-by: Blue Swirl <>
Signed-off-by: Paolo Bonzini <>...

91642ff8 02/19/2013 01:03 am Paolo Bonzini

target-i386: factor setting of s->cc_op handling for string functions

Set it to the appropriate CC_OP_SUBx constant in gen_scas/gen_cmps.
In the repz case it can be overridden to CC_OP_DYNAMIC after generating
the code.

Signed-off-by: Paolo Bonzini <>...

b27fc131 02/19/2013 01:03 am Paolo Bonzini

target-i386: drop cc_op argument of gen_jcc1

As in the gen_repz_scas/gen_repz_cmps case, delay setting
CC_OP_DYNAMIC in gen_jcc until after code generation. All of
gen_jcc1/is_fast_jcc/gen_setcc_slow_T0 now work on s->cc_op, which makes
things a bit easier to follow and to patch....

52320e15 02/19/2013 01:03 am Paolo Bonzini

target-i386: move carry computation for inc/dec closer to gen_op_set_cc_op

This ensures the invariant that cpu_cc_op matches s->cc_op when calling
the helpers. The next patches need this because gen_compute_eflags and
gen_compute_eflags_c will take care of setting cpu_cc_op....

0ff6addd 02/19/2013 01:03 am Paolo Bonzini

target-i386: move eflags computation closer to gen_op_set_cc_op

This ensures the invariant that cpu_cc_op matches s->cc_op when calling
the helpers. The next patches need this because gen_compute_eflags and
gen_compute_eflags_c will take care of setting cpu_cc_op....

24537a01 02/16/2013 12:44 pm Peter Maydell

qemu-log: Rename the public-facing cpu_set_log function to qemu_set_log

Rename the public-facing function cpu_set_log to qemu_set_log. This
requires us to rename the internal-only qemu_set_log() to
do_qemu_set_log().

Signed-off-by: Peter Maydell <>...

022c62cb 12/19/2012 09:31 am Paolo Bonzini

exec: move include files to include/exec/

Signed-off-by: Paolo Bonzini <>

76cad711 12/19/2012 09:29 am Paolo Bonzini

build: kill libdis, move disassemblers to disas/

Signed-off-by: Paolo Bonzini <>

ab1103de 12/08/2012 04:24 pm Evgeny Voevodin

TCG: Use gen_opc_instr_start from context instead of global variable.

Signed-off-by: Evgeny Voevodin <>
Signed-off-by: Blue Swirl <>

25983cad 12/08/2012 04:24 pm Evgeny Voevodin

TCG: Use gen_opc_pc from context instead of global variable.

Signed-off-by: Evgeny Voevodin <>
Signed-off-by: Blue Swirl <>

c9c99c22 12/08/2012 04:24 pm Evgeny Voevodin

TCG: Use gen_opc_icount from context instead of global variable.

Signed-off-by: Evgeny Voevodin <>
Signed-off-by: Blue Swirl <>

92414b31 11/17/2012 03:53 pm Evgeny Voevodin

TCG: Use gen_opc_buf from context instead of global variable.

Signed-off-by: Evgeny Voevodin <>
Reviewed-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

efd7f486 11/17/2012 03:53 pm Evgeny Voevodin

TCG: Use gen_opc_ptr from context instead of global variable.

Signed-off-by: Evgeny Voevodin <>
Reviewed-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

0af10c86 11/10/2012 03:49 pm Blue Swirl

target-i386: avoid using cpu_single_env

Pass around CPUArchState instead of using global cpu_single_env.

Signed-off-by: Blue Swirl <>
Reviewed-by: Andreas Färber <>

f4359b9f 11/10/2012 03:49 pm Blue Swirl

disas: avoid using cpu_single_env

Pass around CPUArchState instead of using global cpu_single_env.

Signed-off-by: Blue Swirl <>
Acked-by: Richard Henderson <>
Acked-by: Aurelien Jarno <>
Acked-by: Guan Xuetao <>

8b4a3df8 10/14/2012 01:55 pm malc

Fix popcnt in long mode

Thanks to Andriy Gapon for initial problem report.

Signed-off-by: malc <>

a9321a4d 10/01/2012 04:04 pm H. Peter Anvin

x86: Implement SMEP and SMAP

This patch implements Supervisor Mode Execution Prevention (SMEP) and
Supervisor Mode Access Prevention (SMAP) for x86. The purpose of the
patch, obviously, is to help kernel developers debug the support for
those features.
...

fdefe51c 09/27/2012 10:38 pm Richard Henderson

Emit debug_insn for CPU_LOG_TB_OP_OPT as well.

For all targets that currently call tcg_gen_debug_insn_start,
add CPU_LOG_TB_OP_OPT to the condition that gates it.

This is useful for comparing optimization dumps, when the
pre-optimization dump is merely noise....

5c73b757 08/24/2012 06:44 am Matthew Ogilvie

target-i386/translate.c: mov to/from crN/drN: ignore mod bits

This instruction is always treated as a register-to-register (MOD = 11)
instruction, regardless of the encoding of the MOD field in the MODR/M
byte.

Also, Microport UNIX System V/386 v 2.1 (ca 1987) runs fine on...

4a7443be 08/14/2012 10:01 pm Blue Swirl

x86: avoid AREG0 for misc helpers

Add an explicit CPUX86State parameter instead of relying on AREG0.

Signed-off-by: Blue Swirl <>

2999a0b2 08/14/2012 10:01 pm Blue Swirl

x86: avoid AREG0 in segmentation helpers

Add an explicit CPUX86State parameter instead of relying on AREG0.

Rename remains of op_helper.c to seg_helper.c.

Signed-off-by: Blue Swirl <>

92fc4b58 08/14/2012 10:01 pm Blue Swirl

x86: switch to AREG0 free mode

Add an explicit CPUX86State parameter instead of relying on AREG0.

Remove temporary wrappers and switch to AREG0 free mode.

Signed-off-by: Blue Swirl <>

d3eb5eae 08/14/2012 10:01 pm Blue Swirl

x86: avoid AREG0 for FPU helpers

Make FPU helpers take a parameter for CPUState instead
of relying on global env.

Introduce temporary wrappers for FPU load and store ops. Remove
wrappers for non-AREG0 code. Don't call unconverted helpers
directly.

Signed-off-by: Blue Swirl <>

f0967a1a 08/14/2012 10:01 pm Blue Swirl

x86: avoid AREG0 for condition code helpers

Add an explicit CPUX86State parameter instead of relying on AREG0.

Signed-off-by: Blue Swirl <>

7923057b 08/14/2012 10:01 pm Blue Swirl

x86: avoid AREG0 for integer helpers

Add an explicit CPUX86State parameter instead of relying on AREG0.

Signed-off-by: Blue Swirl <>

052e80d5 08/14/2012 10:01 pm Blue Swirl

x86: avoid AREG0 for SVM helpers

Add an explicit CPUX86State parameter instead of relying on AREG0.

Signed-off-by: Blue Swirl <>

608badfc 08/14/2012 10:01 pm Blue Swirl

x86: avoid AREG0 for SMM helpers

Add an explicit CPUX86State parameter instead of relying on AREG0.

Signed-off-by: Blue Swirl <>

7162ab21 07/29/2012 11:45 am Vitaly Chipounov

x86: Fixed incorrect segment base address addition in 64-bits mode

According to the Intel manual
"Intel® 64 and IA-32 Architectures Software Developer’s Manual
Volume 3", "3.4.4 Segment Loading Instructions in IA-32e Mode":

"When in compatibility mode, FS and GS overrides operate as defined by...

bedc2ac1 07/07/2012 12:06 pm Peter Maydell

target-i386: make it clearer that op table accesses don't overrun

Rephrase some of the expressions used to select an entry
in the SSE op table arrays so that it's clearer that they
don't overrun the op table array size.

Signed-off-by: Peter Maydell <>...

96d7073f 07/07/2012 12:05 pm Peter Maydell

target-i386: Remove confusing X86_64_DEF macro

The X86_64_DEF macro is a confusing way of making some terms
in a conditional only appear if TARGET_X86_64 is defined. We
only use it in two places, and in both cases this is for making
the same test, so abstract that check out into a function...

a87dacc8 07/07/2012 12:05 pm Peter Maydell

target-i386: Remove unused macros

Commit 11f8cdb removed all the uses of the X86_64_ONLY
macro. The BUGGY_64() macro has been unused for a long time:
it originally marked some ops which couldn't be enabled
because of issues with the pre-TCG code generation scheme....

11f8cdbc 07/05/2012 09:55 pm Stefan Weil

target-i386: Fix compilation with --enable-debug

commit c4baa0503d9623f1ce891f525ccd140c598bc29a improved SSE table
type safety which now raises compiler errors when latest QEMU was
configured with --enable-debug.

Fix this by splitting the SSE tables even further to separate...

77b2bc2c 06/28/2012 11:28 pm Blue Swirl

x86: avoid AREG0 for exceptions

Add an explicit CPUX86State parameter instead of relying on AREG0.

Merge raise_exception_env() to raise_exception(), likewise with
raise_exception_err_env() and raise_exception_err().

Introduce cpu_svm_check_intercept_param() and cpu_vmexit()...

c4baa050 06/28/2012 11:28 pm Blue Swirl

x86: improve SSE table type safety

SSE function tables could easily be corrupted because of use
of void pointers.

Introduce function pointer types and helper variables in order
to improve type safety.

Split sse_op_table3 according to types used.

Signed-off-by: Blue Swirl <>

317ac620 03/14/2012 11:20 pm Andreas Färber

target-i386: Don't overuse CPUState

Scripted conversion:
sed -i "s/CPUState/CPUX86State/g" target-i386/*.[hc]
sed -i "s/#define CPUX86State/#define CPUState/" target-i386/cpu.h

Signed-off-by: Andreas Färber <>
Acked-by: Anthony Liguori <>

20f8bd48 01/13/2012 05:01 pm Aurelien Jarno

target-i386: fix compilation with --enable-debug-tcg

Commit 2355c16e74ffa4d14e7fc2b4a23b055565ac0221 introduced a new ldmxcsr
helper taking an i32 argument, but the helper is actually passed a long.
Fix that by truncating the long to i32.

Signed-off-by: Aurelien Jarno <>

2355c16e 01/11/2012 10:55 am Aurelien Jarno

target-i386: fix SSE rounding and flush to zero

SSE rounding and flush to zero control has never been implemented. However
given that softfloat-native was using a single state for FPU and SSE and
given that glibc is setting both FPU and SSE state in fesetround(), this...

f7e80adf 12/11/2011 10:46 pm Andreas Gustafsson

target-i386: fix cmpxchg instruction emulation

When the i386 cmpxchg instruction is executed with a memory operand
and the comparison result is "unequal", do the memory write before
changing the accumulator instead of the other way around, because
otherwise the new accumulator value will incorrectly be used in the...

86ce7a5e 10/01/2011 09:21 am Jan Kiszka

target-i386: Remove redundant word mask in port out instructions

T0 was already masked to 16 bits when loading it.

Signed-off-by: Jan Kiszka <>
Reviewed-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

782ea2c7 09/21/2011 12:49 pm Stefan Weil

target-i386: Remove data type CCTable

Remove also two assert statements which were the last remaining users.

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>