/* * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
rm2.Set_All(); for (int i = 17; i < RegMask::CHUNK_SIZE; i++) {
rm1.Insert(i);
}
ASSERT_TRUE(rm1.is_AllStack());
rm2.SUBTRACT(rm1);
contains_expected_num_of_registers(rm1, RegMask::CHUNK_SIZE - 17);
contains_expected_num_of_registers(rm2, 17);
}
TEST_VM(RegMask, is_bound1) {
RegMask rm;
ASSERT_FALSE(rm.is_bound1()); for (int i = 0; i < RegMask::CHUNK_SIZE - 1; i++) {
rm.Insert(i);
ASSERT_TRUE(rm.is_bound1()) << "Index " << i;
ASSERT_TRUE(rm.is_bound(Op_RegI)) << "Index " << i;
contains_expected_num_of_registers(rm, 1);
rm.Remove(i);
} // AllStack bit does not count as a bound register
rm.set_AllStack();
ASSERT_FALSE(rm.is_bound1());
}
TEST_VM(RegMask, is_bound_pair) {
RegMask rm;
ASSERT_TRUE(rm.is_bound_pair()); for (int i = 0; i < RegMask::CHUNK_SIZE - 2; i++) {
rm.Insert(i);
rm.Insert(i + 1);
ASSERT_TRUE(rm.is_bound_pair()) << "Index " << i;
ASSERT_TRUE(rm.is_bound_set(2)) << "Index " << i;
ASSERT_TRUE(rm.is_bound(Op_RegI)) << "Index " << i;
contains_expected_num_of_registers(rm, 2);
rm.Clear();
} // A pair with the AllStack bit does not count as a bound pair
rm.Clear();
rm.Insert(RegMask::CHUNK_SIZE - 2);
rm.Insert(RegMask::CHUNK_SIZE - 1);
ASSERT_FALSE(rm.is_bound_pair());
}
TEST_VM(RegMask, is_bound_set) {
RegMask rm; for (int size = 1; size <= 16; size++) {
ASSERT_TRUE(rm.is_bound_set(size)); for (int i = 0; i < RegMask::CHUNK_SIZE - size; i++) { for (int j = i; j < i + size; j++) {
rm.Insert(j);
}
ASSERT_TRUE(rm.is_bound_set(size)) << "Size " << size << " Index " << i;
contains_expected_num_of_registers(rm, size);
rm.Clear();
} // A set with the AllStack bit does not count as a bound set for (int j = RegMask::CHUNK_SIZE - size; j < RegMask::CHUNK_SIZE; j++) {
rm.Insert(j);
}
ASSERT_FALSE(rm.is_bound_set(size));
rm.Clear();
}
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.