[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-2.1 02/14] tcg: Use "unspecified behavior" for s
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH for-2.1 02/14] tcg: Use "unspecified behavior" for shifts |
Date: |
Wed, 16 Apr 2014 09:47:28 -0700 |
Change the definition such that shifts are not allowed to crash
for any input.
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/README | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/tcg/README b/tcg/README
index f178212..776e925 100644
--- a/tcg/README
+++ b/tcg/README
@@ -36,6 +36,12 @@ or a memory location which is stored in a register outside
QEMU TBs
A TCG "basic block" corresponds to a list of instructions terminated
by a branch instruction.
+An operation with "undefined behavior" may result in a crash.
+
+An operation with "unspecified behavior" shall not crash. However,
+the result may be one of several possibilities so may be considered
+an "undefined result".
+
3) Intermediate representation
3.1) Introduction
@@ -239,23 +245,25 @@ t0=t1|~t2
* shl_i32/i64 t0, t1, t2
-t0=t1 << t2. Undefined behavior if t2 < 0 or t2 >= 32 (resp 64)
+t0=t1 << t2. Unspecified behavior if t2 < 0 or t2 >= 32 (resp 64)
* shr_i32/i64 t0, t1, t2
-t0=t1 >> t2 (unsigned). Undefined behavior if t2 < 0 or t2 >= 32 (resp 64)
+t0=t1 >> t2 (unsigned). Unspecified behavior if t2 < 0 or t2 >= 32 (resp 64)
* sar_i32/i64 t0, t1, t2
-t0=t1 >> t2 (signed). Undefined behavior if t2 < 0 or t2 >= 32 (resp 64)
+t0=t1 >> t2 (signed). Unspecified behavior if t2 < 0 or t2 >= 32 (resp 64)
* rotl_i32/i64 t0, t1, t2
-Rotation of t2 bits to the left. Undefined behavior if t2 < 0 or t2 >= 32
(resp 64)
+Rotation of t2 bits to the left.
+Unspecified behavior if t2 < 0 or t2 >= 32 (resp 64)
* rotr_i32/i64 t0, t1, t2
-Rotation of t2 bits to the right. Undefined behavior if t2 < 0 or t2 >= 32
(resp 64)
+Rotation of t2 bits to the right.
+Unspecified behavior if t2 < 0 or t2 >= 32 (resp 64)
********* Misc
--
1.9.0
- [Qemu-devel] [PATCH for-2.1 00/14] tcg: collection of patches, Richard Henderson, 2014/04/16
- [Qemu-devel] [PATCH for-2.1 02/14] tcg: Use "unspecified behavior" for shifts,
Richard Henderson <=
- [Qemu-devel] [PATCH for-2.1 01/14] tcg: Fix warning (1 bit signed bitfield entry) and replace int by bool, Richard Henderson, 2014/04/16
- [Qemu-devel] [PATCH for-2.1 03/14] tcg: Mask shift quantities while folding, Richard Henderson, 2014/04/16
- [Qemu-devel] [PATCH for-2.1 04/14] tci: Mask shift counts to avoid undefined behavior, Richard Henderson, 2014/04/16
- [Qemu-devel] [PATCH for-2.1 06/14] tcg: Add TCGType parameter to tcg_target_const_match, Richard Henderson, 2014/04/16
- [Qemu-devel] [PATCH for-2.1 05/14] tcg: Fix out of range shift in deposit optimizations, Richard Henderson, 2014/04/16
- [Qemu-devel] [PATCH for-2.1 07/14] tcg-aarch64: Remove w constraint, Richard Henderson, 2014/04/16
- [Qemu-devel] [PATCH for-2.1 08/14] tcg-ppc64: Use the type parameter to tcg_target_const_match, Richard Henderson, 2014/04/16
- [Qemu-devel] [PATCH for-2.1 09/14] tcg-sparc: Use the type parameter to tcg_target_const_match, Richard Henderson, 2014/04/16
- [Qemu-devel] [PATCH for-2.1 10/14] tcg-s390: Remove W constraint, Richard Henderson, 2014/04/16
- [Qemu-devel] [PATCH for-2.1 11/14] tcg: Relax requirement for mulu2_i32 on 32-bit hosts, Richard Henderson, 2014/04/16