1 /*
2 * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 //
25 // S U P E R W O R D T R A N S F O R M
26 //
27 // SuperWords are short, fixed length vectors.
28 //
29 // Algorithm from:
30 //
31 // Exploiting SuperWord Level Parallelism with
32 // Multimedia Instruction Sets
33 // by
34 // Samuel Larsen and Saman Amarasighe
35 // MIT Laboratory for Computer Science
36 // date
37 // May 2000
38 // published in
39 // ACM SIGPLAN Notices
40 // Proceedings of ACM PLDI '00, Volume 35 Issue 5
41 //
42 // Definition 3.1 A Pack is an n-tuple, <s1, ...,sn>, where
43 // s1,...,sn are independent isomorphic statements in a basic
490 protected:
491 Node* _p1;
492 Node* _p2;
493 public:
494 OrderedPair() : _p1(NULL), _p2(NULL) {}
495 OrderedPair(Node* p1, Node* p2) {
496 if (p1->_idx < p2->_idx) {
497 _p1 = p1; _p2 = p2;
498 } else {
499 _p1 = p2; _p2 = p1;
500 }
501 }
502
503 bool operator==(const OrderedPair &rhs) {
504 return _p1 == rhs._p1 && _p2 == rhs._p2;
505 }
506 void print() { tty->print(" (%d, %d)", _p1->_idx, _p2->_idx); }
507
508 static const OrderedPair initial;
509 };
|
1 /*
2 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 #ifndef SHARE_VM_OPTO_SUPERWORD_HPP
25 #define SHARE_VM_OPTO_SUPERWORD_HPP
26
27 #include "opto/connode.hpp"
28 #include "opto/loopnode.hpp"
29 #include "opto/node.hpp"
30 #include "opto/phaseX.hpp"
31 #include "opto/vectornode.hpp"
32 #include "utilities/growableArray.hpp"
33
34 //
35 // S U P E R W O R D T R A N S F O R M
36 //
37 // SuperWords are short, fixed length vectors.
38 //
39 // Algorithm from:
40 //
41 // Exploiting SuperWord Level Parallelism with
42 // Multimedia Instruction Sets
43 // by
44 // Samuel Larsen and Saman Amarasighe
45 // MIT Laboratory for Computer Science
46 // date
47 // May 2000
48 // published in
49 // ACM SIGPLAN Notices
50 // Proceedings of ACM PLDI '00, Volume 35 Issue 5
51 //
52 // Definition 3.1 A Pack is an n-tuple, <s1, ...,sn>, where
53 // s1,...,sn are independent isomorphic statements in a basic
500 protected:
501 Node* _p1;
502 Node* _p2;
503 public:
504 OrderedPair() : _p1(NULL), _p2(NULL) {}
505 OrderedPair(Node* p1, Node* p2) {
506 if (p1->_idx < p2->_idx) {
507 _p1 = p1; _p2 = p2;
508 } else {
509 _p1 = p2; _p2 = p1;
510 }
511 }
512
513 bool operator==(const OrderedPair &rhs) {
514 return _p1 == rhs._p1 && _p2 == rhs._p2;
515 }
516 void print() { tty->print(" (%d, %d)", _p1->_idx, _p2->_idx); }
517
518 static const OrderedPair initial;
519 };
520
521 #endif // SHARE_VM_OPTO_SUPERWORD_HPP
|