Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: src/IceInst.def

Issue 1371703003: Generate better two address code by using commutativity (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Address code review comments in test Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInst.def
diff --git a/src/IceInst.def b/src/IceInst.def
index d2652135f943fd922a98f5ab01a179b256cf01ae..6bd2efbf1c8463f69bb9dcd9ea969f82209c72f9 100644
--- a/src/IceInst.def
+++ b/src/IceInst.def
@@ -14,14 +14,31 @@
#ifndef SUBZERO_SRC_ICEINST_DEF
#define SUBZERO_SRC_ICEINST_DEF
+// Floating point addition and multiplication are commutative.
+// 1) non-special values and infinities are required to commute.
+// 2) signed zeroes are handled by:
+// From IEEE standard 754-2008:
+// When the sum of two operands with opposite signs (or the difference of
+// two operands with like signs) is exactly zero, the sign of that sum
+// (or difference) shall be +0 in all rounding-direction attributes
+// except roundTowardNegative; under that attribute, the sign of an exact
+// zero sum (or difference) shall be −0.
+// 3) NaNs are handled by:
+// http://grouper.ieee.org/groups/1788/email/msg03558.html
+// clause of 754 at work is 6.2.3 NaN propagation:
+// "If two or more inputs are NaN, then the payload of the resulting NaN
+// should be identical to the payload of one of the input NaNs if
+// representable in the destination format. This standard does not
+// specify which of the input NaNs will provide the payload."
+
#define ICEINSTARITHMETIC_TABLE \
/* enum value, printable string, commutative */ \
X(Add, "add", 1) \
- X(Fadd, "fadd", 0) \
+ X(Fadd, "fadd", 1) \
X(Sub, "sub", 0) \
X(Fsub, "fsub", 0) \
X(Mul, "mul", 1) \
- X(Fmul, "fmul", 0) \
+ X(Fmul, "fmul", 1) \
X(Udiv, "udiv", 0) \
X(Sdiv, "sdiv", 0) \
X(Fdiv, "fdiv", 0) \
« no previous file with comments | « no previous file | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698