From 4f7a169a7eb97ea4819217f14705d6c2bd125355 Mon Sep 17 00:00:00 2001 From: Sanjoy Das Date: Wed, 22 Aug 2018 13:38:15 -0700 Subject: [XLA] Define integer division overflow for CPU/GPU This implements the semantics suggested in cr/209704042 for CPU and GPU: X / 0 == -1 X % 0 == X INT_SMIN / -1 = INT_SMIN INT_SMIN % -1 = 0 PiperOrigin-RevId: 209821097 --- tensorflow/docs_src/performance/xla/operation_semantics.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tensorflow/docs_src') diff --git a/tensorflow/docs_src/performance/xla/operation_semantics.md b/tensorflow/docs_src/performance/xla/operation_semantics.md index 2de30d1b3d..c23a7ad9e2 100644 --- a/tensorflow/docs_src/performance/xla/operation_semantics.md +++ b/tensorflow/docs_src/performance/xla/operation_semantics.md @@ -1036,6 +1036,10 @@ different ranks are *not* supported, unless one of the operands is a scalar. When `Op` is `Rem`, the sign of the result is taken from the dividend, and the absolute value of the result is always less than the divisor's absolute value. +Integer division overflow (signed/unsigned division/remainder by zero or signed +divison/remainder of `INT_SMIN` with `-1`) produces an implementation defined +value. + An alternative variant with different-rank broadcasting support exists for these operations: -- cgit v1.2.3