diff mbox

[RFC,6/9] tcg/i386: document the way 32/64-bit conversions are handled

Message ID 1436958199-5181-7-git-send-email-aurelien@aurel32.net
State New
Headers show

Commit Message

Aurelien Jarno July 15, 2015, 11:03 a.m. UTC
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 tcg/i386/tcg-target.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h
index 16f3949..d483083 100644
--- a/tcg/i386/tcg-target.h
+++ b/tcg/i386/tcg-target.h
@@ -129,7 +129,11 @@  extern bool have_bmi1;
 #define TCG_TARGET_HAS_muluh_i64        0
 #define TCG_TARGET_HAS_mulsh_i64        0
 
-/* size changing optional ops */
+/* size changing optional ops.  On x86 we ensure that all 32-bit ops
+   ignore the high bits. We therefore can implement trunc_shr_i64_i32
+   as a mov, but we need to implement ext_i32_i64 and extu_i32_i64 to
+   zero/sign extend the high bits when converting a 32-bit value into
+   a 64-bit one.  */
 #define TCG_TARGET_HAS_trunc_shr_i64_i32 0
 #define TCG_TARGET_HAS_ext_i32_i64       1
 #define TCG_TARGET_HAS_extu_i32_i64      1