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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceInst.def - X-macros for ICE instructions -*- C++ -*-===// 1 //===- subzero/src/IceInst.def - X-macros for ICE instructions -*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file defines properties of ICE instructions in the form of x-macros. 10 // This file defines properties of ICE instructions in the form of x-macros.
11 // 11 //
12 //===----------------------------------------------------------------------===// 12 //===----------------------------------------------------------------------===//
13 13
14 #ifndef SUBZERO_SRC_ICEINST_DEF 14 #ifndef SUBZERO_SRC_ICEINST_DEF
15 #define SUBZERO_SRC_ICEINST_DEF 15 #define SUBZERO_SRC_ICEINST_DEF
16 16
17 // Floating point addition and multiplication are commutative.
18 // 1) non-special values and infinities are required to commute.
19 // 2) signed zeroes are handled by:
20 // From IEEE standard 754-2008:
21 // When the sum of two operands with opposite signs (or the difference of
22 // two operands with like signs) is exactly zero, the sign of that sum
23 // (or difference) shall be +0 in all rounding-direction attributes
24 // except roundTowardNegative; under that attribute, the sign of an exact
25 // zero sum (or difference) shall be −0.
26 // 3) NaNs are handled by:
27 // http://grouper.ieee.org/groups/1788/email/msg03558.html
28 // clause of 754 at work is 6.2.3 NaN propagation:
29 // "If two or more inputs are NaN, then the payload of the resulting NaN
30 // should be identical to the payload of one of the input NaNs if
31 // representable in the destination format. This standard does not
32 // specify which of the input NaNs will provide the payload."
33
17 #define ICEINSTARITHMETIC_TABLE \ 34 #define ICEINSTARITHMETIC_TABLE \
18 /* enum value, printable string, commutative */ \ 35 /* enum value, printable string, commutative */ \
19 X(Add, "add", 1) \ 36 X(Add, "add", 1) \
20 X(Fadd, "fadd", 0) \ 37 X(Fadd, "fadd", 1) \
21 X(Sub, "sub", 0) \ 38 X(Sub, "sub", 0) \
22 X(Fsub, "fsub", 0) \ 39 X(Fsub, "fsub", 0) \
23 X(Mul, "mul", 1) \ 40 X(Mul, "mul", 1) \
24 X(Fmul, "fmul", 0) \ 41 X(Fmul, "fmul", 1) \
25 X(Udiv, "udiv", 0) \ 42 X(Udiv, "udiv", 0) \
26 X(Sdiv, "sdiv", 0) \ 43 X(Sdiv, "sdiv", 0) \
27 X(Fdiv, "fdiv", 0) \ 44 X(Fdiv, "fdiv", 0) \
28 X(Urem, "urem", 0) \ 45 X(Urem, "urem", 0) \
29 X(Srem, "srem", 0) \ 46 X(Srem, "srem", 0) \
30 X(Frem, "frem", 0) \ 47 X(Frem, "frem", 0) \
31 X(Shl, "shl", 0) \ 48 X(Shl, "shl", 0) \
32 X(Lshr, "lshr", 0) \ 49 X(Lshr, "lshr", 0) \
33 X(Ashr, "ashr", 0) \ 50 X(Ashr, "ashr", 0) \
34 X(And, "and", 1) \ 51 X(And, "and", 1) \
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 X(Uge, "uge") \ 95 X(Uge, "uge") \
79 X(Ult, "ult") \ 96 X(Ult, "ult") \
80 X(Ule, "ule") \ 97 X(Ule, "ule") \
81 X(Sgt, "sgt") \ 98 X(Sgt, "sgt") \
82 X(Sge, "sge") \ 99 X(Sge, "sge") \
83 X(Slt, "slt") \ 100 X(Slt, "slt") \
84 X(Sle, "sle") 101 X(Sle, "sle")
85 //#define X(tag, str) 102 //#define X(tag, str)
86 103
87 #endif // SUBZERO_SRC_ICEINST_DEF 104 #endif // SUBZERO_SRC_ICEINST_DEF
OLDNEW
« 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