| 1 | /* |
| 2 | * Copyright (C) 2019 Apple Inc. All rights reserved. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * 1. Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution. |
| 12 | * |
| 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY |
| 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
| 17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | |
| 26 | #include "AirCode.h" |
| 27 | #include "AirInstInlines.h" |
| 28 | #include "AirValidate.h" |
| 29 | #include "AllowMacroScratchRegisterUsage.h" |
| 30 | #include "B3ArgumentRegValue.h" |
| 31 | #include "B3AtomicValue.h" |
| 32 | #include "B3BasicBlockInlines.h" |
| 33 | #include "B3BreakCriticalEdges.h" |
| 34 | #include "B3CCallValue.h" |
| 35 | #include "B3Compilation.h" |
| 36 | #include "B3Compile.h" |
| 37 | #include "B3ComputeDivisionMagic.h" |
| 38 | #include "B3Const32Value.h" |
| 39 | #include "B3Const64Value.h" |
| 40 | #include "B3ConstPtrValue.h" |
| 41 | #include "B3Effects.h" |
| 42 | #include "B3FenceValue.h" |
| 43 | #include "B3FixSSA.h" |
| 44 | #include "B3Generate.h" |
| 45 | #include "B3LowerToAir.h" |
| 46 | #include "B3MathExtras.h" |
| 47 | #include "B3MemoryValue.h" |
| 48 | #include "B3MoveConstants.h" |
| 49 | #include "B3NativeTraits.h" |
| 50 | #include "B3Procedure.h" |
| 51 | #include "B3ReduceLoopStrength.h" |
| 52 | #include "B3ReduceStrength.h" |
| 53 | #include "B3SlotBaseValue.h" |
| 54 | #include "B3StackSlot.h" |
| 55 | #include "B3StackmapGenerationParams.h" |
| 56 | #include "B3SwitchValue.h" |
| 57 | #include "B3UpsilonValue.h" |
| 58 | #include "B3UseCounts.h" |
| 59 | #include "B3Validate.h" |
| 60 | #include "B3ValueInlines.h" |
| 61 | #include "B3VariableValue.h" |
| 62 | #include "B3WasmAddressValue.h" |
| 63 | #include "B3WasmBoundsCheckValue.h" |
| 64 | #include "CCallHelpers.h" |
| 65 | #include "FPRInfo.h" |
| 66 | #include "GPRInfo.h" |
| 67 | #include "InitializeThreading.h" |
| 68 | #include "JSCInlines.h" |
| 69 | #include "LinkBuffer.h" |
| 70 | #include "PureNaN.h" |
| 71 | #include <cmath> |
| 72 | #include <string> |
| 73 | #include <wtf/FastTLS.h> |
| 74 | #include <wtf/IndexSet.h> |
| 75 | #include <wtf/ListDump.h> |
| 76 | #include <wtf/Lock.h> |
| 77 | #include <wtf/NumberOfCores.h> |
| 78 | #include <wtf/StdList.h> |
| 79 | #include <wtf/Threading.h> |
| 80 | #include <wtf/text/StringCommon.h> |
| 81 | |
| 82 | // We don't have a NO_RETURN_DUE_TO_EXIT, nor should we. That's ridiculous. |
| 83 | inline bool hiddenTruthBecauseNoReturnIsStupid() { return true; } |
| 84 | |
| 85 | inline void usage() |
| 86 | { |
| 87 | dataLog("Usage: testb3 [<filter>]\n" ); |
| 88 | if (hiddenTruthBecauseNoReturnIsStupid()) |
| 89 | exit(1); |
| 90 | } |
| 91 | |
| 92 | #if ENABLE(B3_JIT) |
| 93 | |
| 94 | using namespace JSC; |
| 95 | using namespace JSC::B3; |
| 96 | |
| 97 | inline bool shouldBeVerbose() |
| 98 | { |
| 99 | return shouldDumpIR(B3Mode); |
| 100 | } |
| 101 | |
| 102 | extern Lock crashLock; |
| 103 | |
| 104 | // Nothing fancy for now; we just use the existing WTF assertion machinery. |
| 105 | #define CHECK(x) do { \ |
| 106 | if (!!(x)) \ |
| 107 | break; \ |
| 108 | crashLock.lock(); \ |
| 109 | WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, #x); \ |
| 110 | CRASH(); \ |
| 111 | } while (false) |
| 112 | |
| 113 | #define CHECK_EQ(x, y) do { \ |
| 114 | auto __x = (x); \ |
| 115 | auto __y = (y); \ |
| 116 | if (__x == __y) \ |
| 117 | break; \ |
| 118 | crashLock.lock(); \ |
| 119 | WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, toCString(#x " == " #y, " (" #x " == ", __x, ", " #y " == ", __y, ")").data()); \ |
| 120 | CRASH(); \ |
| 121 | } while (false) |
| 122 | |
| 123 | #define PREFIX "O", Options::defaultB3OptLevel(), ": " |
| 124 | |
| 125 | #define RUN(test) do { \ |
| 126 | if (!shouldRun(filter, #test)) \ |
| 127 | break; \ |
| 128 | tasks.append( \ |
| 129 | createSharedTask<void()>( \ |
| 130 | [&] () { \ |
| 131 | dataLog(PREFIX #test "...\n"); \ |
| 132 | test; \ |
| 133 | dataLog(PREFIX #test ": OK!\n"); \ |
| 134 | })); \ |
| 135 | } while (false); |
| 136 | |
| 137 | #define RUN_UNARY(test, values) \ |
| 138 | for (auto a : values) { \ |
| 139 | CString testStr = toCString(PREFIX #test, "(", a.name, ")"); \ |
| 140 | if (!shouldRun(filter, testStr.data())) \ |
| 141 | continue; \ |
| 142 | tasks.append(createSharedTask<void()>( \ |
| 143 | [=] () { \ |
| 144 | dataLog(toCString(testStr, "...\n")); \ |
| 145 | test(a.value); \ |
| 146 | dataLog(toCString(testStr, ": OK!\n")); \ |
| 147 | })); \ |
| 148 | } |
| 149 | |
| 150 | #define RUN_NOW(test) do { \ |
| 151 | if (!shouldRun(filter, #test)) \ |
| 152 | break; \ |
| 153 | dataLog(PREFIX #test "...\n"); \ |
| 154 | test; \ |
| 155 | dataLog(PREFIX #test ": OK!\n"); \ |
| 156 | } while (false) |
| 157 | |
| 158 | #define RUN_BINARY(test, valuesA, valuesB) \ |
| 159 | for (auto a : valuesA) { \ |
| 160 | for (auto b : valuesB) { \ |
| 161 | CString testStr = toCString(PREFIX #test, "(", a.name, ", ", b.name, ")"); \ |
| 162 | if (!shouldRun(filter, testStr.data())) \ |
| 163 | continue; \ |
| 164 | tasks.append(createSharedTask<void()>( \ |
| 165 | [=] () { \ |
| 166 | dataLog(toCString(testStr, "...\n")); \ |
| 167 | test(a.value, b.value); \ |
| 168 | dataLog(toCString(testStr, ": OK!\n")); \ |
| 169 | })); \ |
| 170 | } \ |
| 171 | } |
| 172 | #define RUN_TERNARY(test, valuesA, valuesB, valuesC) \ |
| 173 | for (auto a : valuesA) { \ |
| 174 | for (auto b : valuesB) { \ |
| 175 | for (auto c : valuesC) { \ |
| 176 | CString testStr = toCString(#test, "(", a.name, ", ", b.name, ",", c.name, ")"); \ |
| 177 | if (!shouldRun(filter, testStr.data())) \ |
| 178 | continue; \ |
| 179 | tasks.append(createSharedTask<void()>( \ |
| 180 | [=] () { \ |
| 181 | dataLog(toCString(testStr, "...\n")); \ |
| 182 | test(a.value, b.value, c.value); \ |
| 183 | dataLog(toCString(testStr, ": OK!\n")); \ |
| 184 | })); \ |
| 185 | } \ |
| 186 | } \ |
| 187 | } |
| 188 | |
| 189 | |
| 190 | inline std::unique_ptr<Compilation> compileProc(Procedure& procedure, unsigned optLevel = Options::defaultB3OptLevel()) |
| 191 | { |
| 192 | procedure.setOptLevel(optLevel); |
| 193 | return makeUnique<Compilation>(B3::compile(procedure)); |
| 194 | } |
| 195 | |
| 196 | template<typename T, typename... Arguments> |
| 197 | T invoke(MacroAssemblerCodePtr<B3CompilationPtrTag> ptr, Arguments... arguments) |
| 198 | { |
| 199 | void* executableAddress = untagCFunctionPtr<B3CompilationPtrTag>(ptr.executableAddress()); |
| 200 | T (*function)(Arguments...) = bitwise_cast<T(*)(Arguments...)>(executableAddress); |
| 201 | return function(arguments...); |
| 202 | } |
| 203 | |
| 204 | template<typename T, typename... Arguments> |
| 205 | T invoke(const Compilation& code, Arguments... arguments) |
| 206 | { |
| 207 | return invoke<T>(code.code(), arguments...); |
| 208 | } |
| 209 | |
| 210 | template<typename T, typename... Arguments> |
| 211 | T compileAndRun(Procedure& procedure, Arguments... arguments) |
| 212 | { |
| 213 | return invoke<T>(*compileProc(procedure), arguments...); |
| 214 | } |
| 215 | |
| 216 | inline void lowerToAirForTesting(Procedure& proc) |
| 217 | { |
| 218 | proc.resetReachability(); |
| 219 | |
| 220 | if (shouldBeVerbose()) |
| 221 | dataLog("B3 before lowering:\n" , proc); |
| 222 | |
| 223 | validate(proc); |
| 224 | lowerToAir(proc); |
| 225 | |
| 226 | if (shouldBeVerbose()) |
| 227 | dataLog("Air after lowering:\n" , proc.code()); |
| 228 | |
| 229 | Air::validate(proc.code()); |
| 230 | } |
| 231 | |
| 232 | template<typename Func> |
| 233 | void checkDisassembly(Compilation& compilation, const Func& func, const CString& failText) |
| 234 | { |
| 235 | CString disassembly = compilation.disassembly(); |
| 236 | if (func(disassembly.data())) |
| 237 | return; |
| 238 | |
| 239 | crashLock.lock(); |
| 240 | dataLog("Bad lowering! " , failText, "\n" ); |
| 241 | dataLog(disassembly); |
| 242 | CRASH(); |
| 243 | } |
| 244 | |
| 245 | inline void checkUsesInstruction(Compilation& compilation, const char* text) |
| 246 | { |
| 247 | checkDisassembly( |
| 248 | compilation, |
| 249 | [&] (const char* disassembly) -> bool { |
| 250 | return strstr(disassembly, text); |
| 251 | }, |
| 252 | toCString("Expected to find " , text, " but didnt!" )); |
| 253 | } |
| 254 | |
| 255 | inline void checkDoesNotUseInstruction(Compilation& compilation, const char* text) |
| 256 | { |
| 257 | checkDisassembly( |
| 258 | compilation, |
| 259 | [&] (const char* disassembly) -> bool { |
| 260 | return !strstr(disassembly, text); |
| 261 | }, |
| 262 | toCString("Did not expected to find " , text, " but it's there!" )); |
| 263 | } |
| 264 | |
| 265 | template<typename Type> |
| 266 | struct Operand { |
| 267 | const char* name; |
| 268 | Type value; |
| 269 | }; |
| 270 | |
| 271 | typedef Operand<int64_t> Int64Operand; |
| 272 | typedef Operand<int32_t> Int32Operand; |
| 273 | typedef Operand<int16_t> Int16Operand; |
| 274 | typedef Operand<int8_t> Int8Operand; |
| 275 | |
| 276 | #define MAKE_OPERAND(value) Operand<decltype(value)> { #value, value } |
| 277 | |
| 278 | template<typename FloatType> |
| 279 | void populateWithInterestingValues(Vector<Operand<FloatType>>& operands) |
| 280 | { |
| 281 | operands.append({ "0." , static_cast<FloatType>(0.) }); |
| 282 | operands.append({ "-0." , static_cast<FloatType>(-0.) }); |
| 283 | operands.append({ "0.4" , static_cast<FloatType>(0.5) }); |
| 284 | operands.append({ "-0.4" , static_cast<FloatType>(-0.5) }); |
| 285 | operands.append({ "0.5" , static_cast<FloatType>(0.5) }); |
| 286 | operands.append({ "-0.5" , static_cast<FloatType>(-0.5) }); |
| 287 | operands.append({ "0.6" , static_cast<FloatType>(0.6) }); |
| 288 | operands.append({ "-0.6" , static_cast<FloatType>(-0.6) }); |
| 289 | operands.append({ "1." , static_cast<FloatType>(1.) }); |
| 290 | operands.append({ "-1." , static_cast<FloatType>(-1.) }); |
| 291 | operands.append({ "2." , static_cast<FloatType>(2.) }); |
| 292 | operands.append({ "-2." , static_cast<FloatType>(-2.) }); |
| 293 | operands.append({ "M_PI" , static_cast<FloatType>(M_PI) }); |
| 294 | operands.append({ "-M_PI" , static_cast<FloatType>(-M_PI) }); |
| 295 | operands.append({ "min" , std::numeric_limits<FloatType>::min() }); |
| 296 | operands.append({ "max" , std::numeric_limits<FloatType>::max() }); |
| 297 | operands.append({ "lowest" , std::numeric_limits<FloatType>::lowest() }); |
| 298 | operands.append({ "epsilon" , std::numeric_limits<FloatType>::epsilon() }); |
| 299 | operands.append({ "infiniti" , std::numeric_limits<FloatType>::infinity() }); |
| 300 | operands.append({ "-infiniti" , - std::numeric_limits<FloatType>::infinity() }); |
| 301 | operands.append({ "PNaN" , static_cast<FloatType>(PNaN) }); |
| 302 | } |
| 303 | |
| 304 | template<typename FloatType> |
| 305 | Vector<Operand<FloatType>> floatingPointOperands() |
| 306 | { |
| 307 | Vector<Operand<FloatType>> operands; |
| 308 | populateWithInterestingValues(operands); |
| 309 | return operands; |
| 310 | }; |
| 311 | |
| 312 | inline Vector<Int64Operand> int64Operands() |
| 313 | { |
| 314 | Vector<Int64Operand> operands; |
| 315 | operands.append({ "0" , 0 }); |
| 316 | operands.append({ "1" , 1 }); |
| 317 | operands.append({ "-1" , -1 }); |
| 318 | operands.append({ "42" , 42 }); |
| 319 | operands.append({ "-42" , -42 }); |
| 320 | operands.append({ "int64-max" , std::numeric_limits<int64_t>::max() }); |
| 321 | operands.append({ "int64-min" , std::numeric_limits<int64_t>::min() }); |
| 322 | operands.append({ "int32-max" , std::numeric_limits<int32_t>::max() }); |
| 323 | operands.append({ "int32-min" , std::numeric_limits<int32_t>::min() }); |
| 324 | operands.append({ "uint64-max" , static_cast<int64_t>(std::numeric_limits<uint64_t>::max()) }); |
| 325 | operands.append({ "uint64-min" , static_cast<int64_t>(std::numeric_limits<uint64_t>::min()) }); |
| 326 | operands.append({ "uint32-max" , static_cast<int64_t>(std::numeric_limits<uint32_t>::max()) }); |
| 327 | operands.append({ "uint32-min" , static_cast<int64_t>(std::numeric_limits<uint32_t>::min()) }); |
| 328 | |
| 329 | return operands; |
| 330 | } |
| 331 | |
| 332 | inline Vector<Int32Operand> int32Operands() |
| 333 | { |
| 334 | Vector<Int32Operand> operands({ |
| 335 | { "0" , 0 }, |
| 336 | { "1" , 1 }, |
| 337 | { "-1" , -1 }, |
| 338 | { "42" , 42 }, |
| 339 | { "-42" , -42 }, |
| 340 | { "int32-max" , std::numeric_limits<int32_t>::max() }, |
| 341 | { "int32-min" , std::numeric_limits<int32_t>::min() }, |
| 342 | { "uint32-max" , static_cast<int32_t>(std::numeric_limits<uint32_t>::max()) }, |
| 343 | { "uint32-min" , static_cast<int32_t>(std::numeric_limits<uint32_t>::min()) } |
| 344 | }); |
| 345 | return operands; |
| 346 | } |
| 347 | |
| 348 | inline Vector<Int16Operand> int16Operands() |
| 349 | { |
| 350 | Vector<Int16Operand> operands({ |
| 351 | { "0" , 0 }, |
| 352 | { "1" , 1 }, |
| 353 | { "-1" , -1 }, |
| 354 | { "42" , 42 }, |
| 355 | { "-42" , -42 }, |
| 356 | { "int16-max" , std::numeric_limits<int16_t>::max() }, |
| 357 | { "int16-min" , std::numeric_limits<int16_t>::min() }, |
| 358 | { "uint16-max" , static_cast<int16_t>(std::numeric_limits<uint16_t>::max()) }, |
| 359 | { "uint16-min" , static_cast<int16_t>(std::numeric_limits<uint16_t>::min()) } |
| 360 | }); |
| 361 | return operands; |
| 362 | } |
| 363 | |
| 364 | inline Vector<Int8Operand> int8Operands() |
| 365 | { |
| 366 | Vector<Int8Operand> operands({ |
| 367 | { "0" , 0 }, |
| 368 | { "1" , 1 }, |
| 369 | { "-1" , -1 }, |
| 370 | { "42" , 42 }, |
| 371 | { "-42" , -42 }, |
| 372 | { "int8-max" , std::numeric_limits<int8_t>::max() }, |
| 373 | { "int8-min" , std::numeric_limits<int8_t>::min() }, |
| 374 | { "uint8-max" , static_cast<int8_t>(std::numeric_limits<uint8_t>::max()) }, |
| 375 | { "uint8-min" , static_cast<int8_t>(std::numeric_limits<uint8_t>::min()) } |
| 376 | }); |
| 377 | return operands; |
| 378 | } |
| 379 | |
| 380 | inline void add32(CCallHelpers& jit, GPRReg src1, GPRReg src2, GPRReg dest) |
| 381 | { |
| 382 | if (src2 == dest) |
| 383 | jit.add32(src1, dest); |
| 384 | else { |
| 385 | jit.move(src1, dest); |
| 386 | jit.add32(src2, dest); |
| 387 | } |
| 388 | } |
| 389 | |
| 390 | template<typename LoadedType, typename EffectiveType> |
| 391 | EffectiveType modelLoad(EffectiveType value); |
| 392 | |
| 393 | template<typename LoadedType, typename EffectiveType> |
| 394 | EffectiveType modelLoad(EffectiveType value) |
| 395 | { |
| 396 | union { |
| 397 | EffectiveType original; |
| 398 | LoadedType loaded; |
| 399 | } u; |
| 400 | |
| 401 | u.original = value; |
| 402 | if (std::is_signed<LoadedType>::value) |
| 403 | return static_cast<EffectiveType>(u.loaded); |
| 404 | return static_cast<EffectiveType>(static_cast<typename std::make_unsigned<EffectiveType>::type>(u.loaded)); |
| 405 | } |
| 406 | |
| 407 | template<> |
| 408 | inline float modelLoad<float, float>(float value) { return value; } |
| 409 | |
| 410 | template<> |
| 411 | inline double modelLoad<double, double>(double value) { return value; } |
| 412 | |
| 413 | void run(const char* filter); |
| 414 | void testBitAndSExt32(int32_t value, int64_t mask); |
| 415 | void testBasicSelect(); |
| 416 | void testSelectTest(); |
| 417 | void testSelectCompareDouble(); |
| 418 | void testSelectCompareFloat(float, float); |
| 419 | void testSelectCompareFloatToDouble(float, float); |
| 420 | void testSelectDouble(); |
| 421 | void testSelectDoubleTest(); |
| 422 | void testSelectDoubleCompareDouble(); |
| 423 | void testSelectDoubleCompareFloat(float, float); |
| 424 | void testSelectFloatCompareFloat(float, float); |
| 425 | void testSelectDoubleCompareDoubleWithAliasing(); |
| 426 | void testSelectFloatCompareFloatWithAliasing(); |
| 427 | void testSelectFold(intptr_t value); |
| 428 | void testSelectInvert(); |
| 429 | void testCheckSelect(); |
| 430 | void testCheckSelectCheckSelect(); |
| 431 | void testCheckSelectAndCSE(); |
| 432 | void testPowDoubleByIntegerLoop(double xOperand, int32_t yOperand); |
| 433 | double b3Pow(double x, int y); |
| 434 | void testTruncOrHigh(); |
| 435 | void testTruncOrLow(); |
| 436 | void testBitAndOrHigh(); |
| 437 | void testBitAndOrLow(); |
| 438 | void testBranch64Equal(int64_t left, int64_t right); |
| 439 | void testBranch64EqualImm(int64_t left, int64_t right); |
| 440 | void testBranch64EqualMem(int64_t left, int64_t right); |
| 441 | void testBranch64EqualMemImm(int64_t left, int64_t right); |
| 442 | void testStore8Load8Z(int32_t value); |
| 443 | void testStore16Load16Z(int32_t value); |
| 444 | void testTrivialInfiniteLoop(); |
| 445 | void testFoldPathEqual(); |
| 446 | void testLShiftSelf32(); |
| 447 | void testRShiftSelf32(); |
| 448 | void testURShiftSelf32(); |
| 449 | void testLShiftSelf64(); |
| 450 | void testRShiftSelf64(); |
| 451 | void testURShiftSelf64(); |
| 452 | void testPatchpointDoubleRegs(); |
| 453 | void testSpillDefSmallerThanUse(); |
| 454 | void testSpillUseLargerThanDef(); |
| 455 | void testLateRegister(); |
| 456 | void interpreterPrint(Vector<intptr_t>* stream, intptr_t value); |
| 457 | void testInterpreter(); |
| 458 | void testReduceStrengthCheckBottomUseInAnotherBlock(); |
| 459 | void testResetReachabilityDanglingReference(); |
| 460 | void testEntrySwitchSimple(); |
| 461 | void testEntrySwitchNoEntrySwitch(); |
| 462 | void testEntrySwitchWithCommonPaths(); |
| 463 | void testEntrySwitchWithCommonPathsAndNonTrivialEntrypoint(); |
| 464 | void testEntrySwitchLoop(); |
| 465 | void testSomeEarlyRegister(); |
| 466 | void testBranchBitAndImmFusion(B3::Opcode valueModifier, Type valueType, int64_t constant, Air::Opcode expectedOpcode, Air::Arg::Kind firstKind); |
| 467 | void testTerminalPatchpointThatNeedsToBeSpilled(); |
| 468 | void testTerminalPatchpointThatNeedsToBeSpilled2(); |
| 469 | void testPatchpointTerminalReturnValue(bool successIsRare); |
| 470 | void testMemoryFence(); |
| 471 | void testStoreFence(); |
| 472 | void testLoadFence(); |
| 473 | void testTrappingLoad(); |
| 474 | void testTrappingStore(); |
| 475 | void testTrappingLoadAddStore(); |
| 476 | void testTrappingLoadDCE(); |
| 477 | void testTrappingStoreElimination(); |
| 478 | void testMoveConstants(); |
| 479 | void testPCOriginMapDoesntInsertNops(); |
| 480 | void testBitOrBitOrArgImmImm32(int, int, int c); |
| 481 | void testBitOrImmBitOrArgImm32(int, int, int c); |
| 482 | double bitOrDouble(double, double); |
| 483 | void testBitOrArgDouble(double); |
| 484 | void testBitOrArgsDouble(double, double); |
| 485 | void testBitOrArgImmDouble(double, double); |
| 486 | void testBitOrImmsDouble(double, double); |
| 487 | float bitOrFloat(float, float); |
| 488 | void testBitOrArgFloat(float); |
| 489 | void testBitOrArgsFloat(float, float); |
| 490 | void testBitOrArgImmFloat(float, float); |
| 491 | void testBitOrImmsFloat(float, float); |
| 492 | void testBitOrArgsFloatWithUselessDoubleConversion(float, float); |
| 493 | void testBitXorArgs(int64_t, int64_t); |
| 494 | void testBitXorSameArg(int64_t); |
| 495 | void testBitXorAndAndArgs(int64_t, int64_t, int64_t c); |
| 496 | void testBitXorAndAndArgs32(int32_t, int32_t, int32_t c); |
| 497 | void testBitXorAndSameArgs(int64_t, int64_t); |
| 498 | void testBitXorAndSameArgs32(int32_t, int32_t); |
| 499 | void testBitXorImms(int64_t, int64_t); |
| 500 | void testBitXorArgImm(int64_t, int64_t); |
| 501 | void testBitXorImmArg(int64_t, int64_t); |
| 502 | void testBitXorBitXorArgImmImm(int64_t, int64_t, int64_t c); |
| 503 | void testBitXorImmBitXorArgImm(int64_t, int64_t, int64_t c); |
| 504 | void testBitXorArgs32(int, int); |
| 505 | void testBitXorSameArg32(int); |
| 506 | void testBitXorImms32(int, int); |
| 507 | void testBitXorArgImm32(int, int); |
| 508 | void testBitXorImmArg32(int, int); |
| 509 | void testBitXorBitXorArgImmImm32(int, int, int c); |
| 510 | void testBitXorImmBitXorArgImm32(int, int, int c); |
| 511 | void testBitNotArg(int64_t); |
| 512 | void testBitNotImm(int64_t); |
| 513 | void testBitNotMem(int64_t); |
| 514 | void testBitNotArg32(int32_t); |
| 515 | void testBitNotImm32(int32_t); |
| 516 | void testBitNotMem32(int32_t); |
| 517 | void testNotOnBooleanAndBranch32(int64_t, int64_t); |
| 518 | void testBitNotOnBooleanAndBranch32(int64_t, int64_t); |
| 519 | void testShlArgs(int64_t, int64_t); |
| 520 | void testShlImms(int64_t, int64_t); |
| 521 | void testShlArgImm(int64_t, int64_t); |
| 522 | void testShlSShrArgImm(int64_t, int64_t); |
| 523 | void testShlArg32(int32_t); |
| 524 | void testShlArgs32(int32_t, int32_t); |
| 525 | void testShlImms32(int32_t, int32_t); |
| 526 | void testShlArgImm32(int32_t, int32_t); |
| 527 | void testShlZShrArgImm32(int32_t, int32_t); |
| 528 | void testClzArg64(int64_t); |
| 529 | void testClzMem64(int64_t); |
| 530 | void testClzArg32(int32_t); |
| 531 | void testClzMem32(int32_t); |
| 532 | void testAbsArg(double); |
| 533 | void testAbsImm(double); |
| 534 | void testAbsMem(double); |
| 535 | void testAbsAbsArg(double); |
| 536 | void testAbsNegArg(double); |
| 537 | void testAbsBitwiseCastArg(double); |
| 538 | void testBitwiseCastAbsBitwiseCastArg(double); |
| 539 | void testAbsArg(float); |
| 540 | void testAbsImm(float); |
| 541 | void testAbsMem(float); |
| 542 | void testAbsAbsArg(float); |
| 543 | void testAbsNegArg(float); |
| 544 | void testAbsBitwiseCastArg(float); |
| 545 | void testBitwiseCastAbsBitwiseCastArg(float); |
| 546 | void testAbsArgWithUselessDoubleConversion(float); |
| 547 | void testAbsArgWithEffectfulDoubleConversion(float); |
| 548 | void testCeilArg(double); |
| 549 | void testCeilImm(double); |
| 550 | void testCeilMem(double); |
| 551 | void testCeilCeilArg(double); |
| 552 | void testFloorCeilArg(double); |
| 553 | void testCeilIToD64(int64_t); |
| 554 | void testCeilIToD32(int64_t); |
| 555 | void testCeilArg(float); |
| 556 | void testCeilImm(float); |
| 557 | void testCeilMem(float); |
| 558 | void testCeilCeilArg(float); |
| 559 | void testFloorCeilArg(float); |
| 560 | void testCeilArgWithUselessDoubleConversion(float); |
| 561 | void testCeilArgWithEffectfulDoubleConversion(float); |
| 562 | void testFloorArg(double); |
| 563 | void testFloorImm(double); |
| 564 | void testFloorMem(double); |
| 565 | void testFloorFloorArg(double); |
| 566 | void testCeilFloorArg(double); |
| 567 | void testFloorIToD64(int64_t); |
| 568 | void testFloorIToD32(int64_t); |
| 569 | void testFloorArg(float); |
| 570 | void testFloorImm(float); |
| 571 | void testFloorMem(float); |
| 572 | void testFloorFloorArg(float); |
| 573 | void testCeilFloorArg(float); |
| 574 | void testFloorArgWithUselessDoubleConversion(float); |
| 575 | void testFloorArgWithEffectfulDoubleConversion(float); |
| 576 | double correctSqrt(double value); |
| 577 | void testSqrtArg(double); |
| 578 | void testSqrtImm(double); |
| 579 | void testSqrtMem(double); |
| 580 | void testSqrtArg(float); |
| 581 | void testSqrtImm(float); |
| 582 | void testSqrtMem(float); |
| 583 | void testSqrtArgWithUselessDoubleConversion(float); |
| 584 | void testSqrtArgWithEffectfulDoubleConversion(float); |
| 585 | void testCompareTwoFloatToDouble(float, float); |
| 586 | void testCompareOneFloatToDouble(float, double); |
| 587 | void testCompareFloatToDoubleThroughPhi(float, float); |
| 588 | void testDoubleToFloatThroughPhi(float value); |
| 589 | void testReduceFloatToDoubleValidates(); |
| 590 | void testDoubleProducerPhiToFloatConversion(float value); |
| 591 | void testDoubleProducerPhiToFloatConversionWithDoubleConsumer(float value); |
| 592 | void testDoubleProducerPhiWithNonFloatConst(float value, double constValue); |
| 593 | void testDoubleArgToInt64BitwiseCast(double value); |
| 594 | void testDoubleImmToInt64BitwiseCast(double value); |
| 595 | void testTwoBitwiseCastOnDouble(double value); |
| 596 | void testBitwiseCastOnDoubleInMemory(double value); |
| 597 | void testBitwiseCastOnDoubleInMemoryIndexed(double value); |
| 598 | void testInt64BArgToDoubleBitwiseCast(int64_t value); |
| 599 | void testInt64BImmToDoubleBitwiseCast(int64_t value); |
| 600 | void testTwoBitwiseCastOnInt64(int64_t value); |
| 601 | void testBitwiseCastOnInt64InMemory(int64_t value); |
| 602 | void testBitwiseCastOnInt64InMemoryIndexed(int64_t value); |
| 603 | void testFloatImmToInt32BitwiseCast(float value); |
| 604 | void testBitwiseCastOnFloatInMemory(float value); |
| 605 | void testInt32BArgToFloatBitwiseCast(int32_t value); |
| 606 | void testInt32BImmToFloatBitwiseCast(int32_t value); |
| 607 | void testTwoBitwiseCastOnInt32(int32_t value); |
| 608 | void testBitwiseCastOnInt32InMemory(int32_t value); |
| 609 | void testConvertDoubleToFloatArg(double value); |
| 610 | void testConvertDoubleToFloatImm(double value); |
| 611 | void testConvertDoubleToFloatMem(double value); |
| 612 | void testConvertFloatToDoubleArg(float value); |
| 613 | void testConvertFloatToDoubleImm(float value); |
| 614 | void testConvertFloatToDoubleMem(float value); |
| 615 | void testConvertDoubleToFloatToDoubleToFloat(double value); |
| 616 | void testLoadFloatConvertDoubleConvertFloatStoreFloat(float value); |
| 617 | void testFroundArg(double value); |
| 618 | void testFroundMem(double value); |
| 619 | void testIToD64Arg(); |
| 620 | void testIToF64Arg(); |
| 621 | void testIToD32Arg(); |
| 622 | void testIToF32Arg(); |
| 623 | void testIToD64Mem(); |
| 624 | void testIToF64Mem(); |
| 625 | void testIToD32Mem(); |
| 626 | void testIToF32Mem(); |
| 627 | void testIToD64Imm(int64_t value); |
| 628 | void testIToF64Imm(int64_t value); |
| 629 | void testIToD32Imm(int32_t value); |
| 630 | void testIToF32Imm(int32_t value); |
| 631 | void testIToDReducedToIToF64Arg(); |
| 632 | void testIToDReducedToIToF32Arg(); |
| 633 | void testStore32(int value); |
| 634 | void testStoreConstant(int value); |
| 635 | void testStoreConstantPtr(intptr_t value); |
| 636 | void testStore8Arg(); |
| 637 | void testStore8Imm(); |
| 638 | void testStorePartial8BitRegisterOnX86(); |
| 639 | void testStore16Arg(); |
| 640 | void testStore16Imm(); |
| 641 | void testTrunc(int64_t value); |
| 642 | void testAdd1(int value); |
| 643 | void testAdd1Ptr(intptr_t value); |
| 644 | void testNeg32(int32_t value); |
| 645 | void testNegPtr(intptr_t value); |
| 646 | void testStoreAddLoad32(int amount); |
| 647 | void testStoreRelAddLoadAcq32(int amount); |
| 648 | void testStoreAddLoadImm32(int amount); |
| 649 | void testStoreAddLoad8(int amount, B3::Opcode loadOpcode); |
| 650 | void testStoreRelAddLoadAcq8(int amount, B3::Opcode loadOpcode); |
| 651 | void testStoreRelAddFenceLoadAcq8(int amount, B3::Opcode loadOpcode); |
| 652 | void testStoreAddLoadImm8(int amount, B3::Opcode loadOpcode); |
| 653 | void testStoreAddLoad16(int amount, B3::Opcode loadOpcode); |
| 654 | void testStoreRelAddLoadAcq16(int amount, B3::Opcode loadOpcode); |
| 655 | void testStoreAddLoadImm16(int amount, B3::Opcode loadOpcode); |
| 656 | void testStoreAddLoad64(int amount); |
| 657 | void testStoreRelAddLoadAcq64(int amount); |
| 658 | void testStoreAddLoadImm64(int64_t amount); |
| 659 | void testStoreAddLoad32Index(int amount); |
| 660 | void testStoreAddLoadImm32Index(int amount); |
| 661 | void testStoreAddLoad8Index(int amount, B3::Opcode loadOpcode); |
| 662 | void testStoreAddLoadImm8Index(int amount, B3::Opcode loadOpcode); |
| 663 | void testStoreAddLoad16Index(int amount, B3::Opcode loadOpcode); |
| 664 | void testStoreAddLoadImm16Index(int amount, B3::Opcode loadOpcode); |
| 665 | void testStoreAddLoad64Index(int amount); |
| 666 | void testStoreAddLoadImm64Index(int64_t amount); |
| 667 | void testStoreSubLoad(int amount); |
| 668 | void testStoreAddLoadInterference(int amount); |
| 669 | void testStoreAddAndLoad(int amount, int mask); |
| 670 | void testStoreNegLoad32(int32_t value); |
| 671 | void testStoreNegLoadPtr(intptr_t value); |
| 672 | void testAdd1Uncommuted(int value); |
| 673 | void testLoadOffset(); |
| 674 | void testLoadOffsetNotConstant(); |
| 675 | void testLoadOffsetUsingAdd(); |
| 676 | void testLoadOffsetUsingAddInterference(); |
| 677 | void testLoadOffsetUsingAddNotConstant(); |
| 678 | void testLoadAddrShift(unsigned shift); |
| 679 | void testFramePointer(); |
| 680 | void testOverrideFramePointer(); |
| 681 | void testStackSlot(); |
| 682 | void testLoadFromFramePointer(); |
| 683 | void testStoreLoadStackSlot(int value); |
| 684 | void testStoreFloat(double input); |
| 685 | void testStoreDoubleConstantAsFloat(double input); |
| 686 | void testSpillGP(); |
| 687 | void testSpillFP(); |
| 688 | void testInt32ToDoublePartialRegisterStall(); |
| 689 | void testInt32ToDoublePartialRegisterWithoutStall(); |
| 690 | void testBranch(); |
| 691 | void testBranchPtr(); |
| 692 | void testDiamond(); |
| 693 | void testBranchNotEqual(); |
| 694 | void testBranchNotEqualCommute(); |
| 695 | void testBranchNotEqualNotEqual(); |
| 696 | void testBranchEqual(); |
| 697 | void testBranchEqualEqual(); |
| 698 | void testBranchEqualCommute(); |
| 699 | void testBranchEqualEqual1(); |
| 700 | void testBranchEqualOrUnorderedArgs(double, double); |
| 701 | void testBranchEqualOrUnorderedArgs(float, float); |
| 702 | void testBranchNotEqualAndOrderedArgs(double, double); |
| 703 | void testBranchNotEqualAndOrderedArgs(float, float); |
| 704 | void testBranchEqualOrUnorderedDoubleArgImm(double, double); |
| 705 | void testBranchEqualOrUnorderedFloatArgImm(float, float); |
| 706 | void testBranchEqualOrUnorderedDoubleImms(double, double); |
| 707 | void testBranchEqualOrUnorderedFloatImms(float, float); |
| 708 | void testBranchEqualOrUnorderedFloatWithUselessDoubleConversion(float, float); |
| 709 | void testBranchFold(int value); |
| 710 | void testDiamondFold(int value); |
| 711 | void testBranchNotEqualFoldPtr(intptr_t value); |
| 712 | void testBranchEqualFoldPtr(intptr_t value); |
| 713 | void testBranchLoadPtr(); |
| 714 | void testBranchLoad32(); |
| 715 | void testBranchLoad8S(); |
| 716 | void testBranchLoad8Z(); |
| 717 | void testBranchLoad16S(); |
| 718 | void testBranchLoad16Z(); |
| 719 | void testBranch8WithLoad8ZIndex(); |
| 720 | void testComplex(unsigned numVars, unsigned numConstructs); |
| 721 | void testBranchBitTest32TmpImm(uint32_t value, uint32_t imm); |
| 722 | void testBranchBitTest32AddrImm(uint32_t value, uint32_t imm); |
| 723 | void testBranchBitTest32TmpTmp(uint32_t value, uint32_t value2); |
| 724 | void testBranchBitTest64TmpTmp(uint64_t value, uint64_t value2); |
| 725 | void testBranchBitTest64AddrTmp(uint64_t value, uint64_t value2); |
| 726 | void testBranchBitTestNegation(uint64_t value, uint64_t value2); |
| 727 | void testBranchBitTestNegation2(uint64_t value, uint64_t value2); |
| 728 | void testSimplePatchpoint(); |
| 729 | void testSimplePatchpointWithoutOuputClobbersGPArgs(); |
| 730 | void testSimplePatchpointWithOuputClobbersGPArgs(); |
| 731 | void testSimplePatchpointWithoutOuputClobbersFPArgs(); |
| 732 | void testSimplePatchpointWithOuputClobbersFPArgs(); |
| 733 | void testPatchpointWithEarlyClobber(); |
| 734 | void testPatchpointCallArg(); |
| 735 | void testPatchpointFixedRegister(); |
| 736 | void testPatchpointAny(ValueRep rep); |
| 737 | void testPatchpointGPScratch(); |
| 738 | void testPatchpointFPScratch(); |
| 739 | void testPatchpointLotsOfLateAnys(); |
| 740 | void testPatchpointAnyImm(ValueRep rep); |
| 741 | void testPatchpointManyWarmAnyImms(); |
| 742 | void testPatchpointManyColdAnyImms(); |
| 743 | void testPatchpointWithRegisterResult(); |
| 744 | void testPatchpointWithStackArgumentResult(); |
| 745 | void testPatchpointWithAnyResult(); |
| 746 | void testSimpleCheck(); |
| 747 | void testCheckFalse(); |
| 748 | void testCheckTrue(); |
| 749 | void testCheckLessThan(); |
| 750 | void testCheckMegaCombo(); |
| 751 | void testCheckTrickyMegaCombo(); |
| 752 | void testCheckTwoMegaCombos(); |
| 753 | void testCheckTwoNonRedundantMegaCombos(); |
| 754 | void testCheckAddImm(); |
| 755 | void testCheckAddImmCommute(); |
| 756 | void testCheckAddImmSomeRegister(); |
| 757 | void testCheckAdd(); |
| 758 | void testCheckAdd64(); |
| 759 | void testCheckAddFold(int, int); |
| 760 | void testCheckAddFoldFail(int, int); |
| 761 | void test42(); |
| 762 | void testLoad42(); |
| 763 | void testLoadAcq42(); |
| 764 | void testLoadWithOffsetImpl(int32_t offset64, int32_t offset32); |
| 765 | void testLoadOffsetImm9Max(); |
| 766 | void testLoadOffsetImm9MaxPlusOne(); |
| 767 | void testLoadOffsetImm9MaxPlusTwo(); |
| 768 | void testLoadOffsetImm9Min(); |
| 769 | void testLoadOffsetImm9MinMinusOne(); |
| 770 | void testLoadOffsetScaledUnsignedImm12Max(); |
| 771 | void testLoadOffsetScaledUnsignedOverImm12Max(); |
| 772 | void testAddTreeArg32(int32_t); |
| 773 | void testMulTreeArg32(int32_t); |
| 774 | void testArg(int argument); |
| 775 | void testReturnConst64(int64_t value); |
| 776 | void testReturnVoid(); |
| 777 | void testAddArg(int); |
| 778 | void testAddArgs(int, int); |
| 779 | void testAddArgImm(int, int); |
| 780 | void testAddImmArg(int, int); |
| 781 | void testAddArgMem(int64_t, int64_t); |
| 782 | void testAddMemArg(int64_t, int64_t); |
| 783 | void testAddImmMem(int64_t, int64_t); |
| 784 | void testAddArg32(int); |
| 785 | void testAddArgs32(int, int); |
| 786 | void testAddArgMem32(int32_t, int32_t); |
| 787 | void testAddMemArg32(int32_t, int32_t); |
| 788 | void testAddImmMem32(int32_t, int32_t); |
| 789 | void testAddNeg1(int, int); |
| 790 | void testAddNeg2(int, int); |
| 791 | void testAddArgZeroImmZDef(); |
| 792 | void testAddLoadTwice(); |
| 793 | void testAddArgDouble(double); |
| 794 | void testCheckAddArgumentAliasing64(); |
| 795 | void testCheckAddArgumentAliasing32(); |
| 796 | void testCheckAddSelfOverflow64(); |
| 797 | void testCheckAddSelfOverflow32(); |
| 798 | void testCheckAddRemoveCheckWithSExt8(int8_t); |
| 799 | void testCheckAddRemoveCheckWithSExt16(int16_t); |
| 800 | void testCheckAddRemoveCheckWithSExt32(int32_t); |
| 801 | void testCheckAddRemoveCheckWithZExt32(int32_t); |
| 802 | void testCheckSubImm(); |
| 803 | void testCheckSubBadImm(); |
| 804 | void testCheckSub(); |
| 805 | double doubleSub(double, double); |
| 806 | void testCheckSub64(); |
| 807 | void testCheckSubFold(int, int); |
| 808 | void testCheckSubFoldFail(int, int); |
| 809 | void testCheckNeg(); |
| 810 | void testCheckNeg64(); |
| 811 | void testCheckMul(); |
| 812 | void testCheckMulMemory(); |
| 813 | void testCheckMul2(); |
| 814 | void testCheckMul64(); |
| 815 | void testCheckMulFold(int, int); |
| 816 | void testCheckMulFoldFail(int, int); |
| 817 | void testAddArgsDouble(double, double); |
| 818 | void testAddArgImmDouble(double, double); |
| 819 | void testAddImmArgDouble(double, double); |
| 820 | void testAddImmsDouble(double, double); |
| 821 | void testAddArgFloat(float); |
| 822 | void testAddArgsFloat(float, float); |
| 823 | void testAddFPRArgsFloat(float, float); |
| 824 | void testAddArgImmFloat(float, float); |
| 825 | void testAddImmArgFloat(float, float); |
| 826 | void testAddImmsFloat(float, float); |
| 827 | void testAddArgFloatWithUselessDoubleConversion(float); |
| 828 | void testAddArgsFloatWithUselessDoubleConversion(float, float); |
| 829 | void testAddArgsFloatWithEffectfulDoubleConversion(float, float); |
| 830 | void testAddMulMulArgs(int64_t, int64_t, int64_t c); |
| 831 | void testMulArg(int); |
| 832 | void testMulArgStore(int); |
| 833 | void testMulAddArg(int); |
| 834 | void testMulArgs(int, int); |
| 835 | void testMulArgNegArg(int, int); |
| 836 | void testCheckMulArgumentAliasing64(); |
| 837 | void testCheckMulArgumentAliasing32(); |
| 838 | void testCheckMul64SShr(); |
| 839 | void testCompareImpl(B3::Opcode opcode, int64_t left, int64_t right); |
| 840 | void testCompare(B3::Opcode opcode, int64_t left, int64_t right); |
| 841 | void testEqualDouble(double left, double right, bool result); |
| 842 | void testCallSimple(int, int); |
| 843 | void testCallRare(int, int); |
| 844 | void testCallRareLive(int, int, int c); |
| 845 | void testCallSimplePure(int, int); |
| 846 | void testCallFunctionWithHellaArguments(); |
| 847 | void testCallFunctionWithHellaArguments2(); |
| 848 | void testCallFunctionWithHellaArguments3(); |
| 849 | void testReturnDouble(double value); |
| 850 | void testReturnFloat(float value); |
| 851 | void testMulNegArgArg(int, int); |
| 852 | void testMulArgImm(int64_t, int64_t); |
| 853 | void testMulImmArg(int, int); |
| 854 | void testMulArgs32(int, int); |
| 855 | void testMulArgs32SignExtend(int, int); |
| 856 | void testMulImm32SignExtend(const int, int); |
| 857 | void testMulLoadTwice(); |
| 858 | void testMulAddArgsLeft(); |
| 859 | void testMulAddArgsRight(); |
| 860 | void testMulAddArgsLeft32(); |
| 861 | void testMulAddArgsRight32(); |
| 862 | void testMulSubArgsLeft(); |
| 863 | void testMulSubArgsRight(); |
| 864 | void testMulSubArgsLeft32(); |
| 865 | void testMulSubArgsRight32(); |
| 866 | void testMulNegArgs(); |
| 867 | void testMulNegArgs32(); |
| 868 | void testMulArgDouble(double); |
| 869 | void testMulArgsDouble(double, double); |
| 870 | void testCallSimpleDouble(double, double); |
| 871 | void testCallSimpleFloat(float, float); |
| 872 | void testCallFunctionWithHellaDoubleArguments(); |
| 873 | void testCallFunctionWithHellaFloatArguments(); |
| 874 | void testLinearScanWithCalleeOnStack(); |
| 875 | void testChillDiv(int num, int den, int res); |
| 876 | void testChillDivTwice(int num1, int den1, int num2, int den2, int res); |
| 877 | void testChillDiv64(int64_t num, int64_t den, int64_t res); |
| 878 | void testModArg(int64_t value); |
| 879 | void testModArgs(int64_t numerator, int64_t denominator); |
| 880 | void testModImms(int64_t numerator, int64_t denominator); |
| 881 | void testMulArgImmDouble(double, double); |
| 882 | void testMulImmArgDouble(double, double); |
| 883 | void testMulImmsDouble(double, double); |
| 884 | void testMulArgFloat(float); |
| 885 | void testMulArgsFloat(float, float); |
| 886 | void testMulArgImmFloat(float, float); |
| 887 | void testMulImmArgFloat(float, float); |
| 888 | void testMulImmsFloat(float, float); |
| 889 | void testMulArgFloatWithUselessDoubleConversion(float); |
| 890 | void testMulArgsFloatWithUselessDoubleConversion(float, float); |
| 891 | void testMulArgsFloatWithEffectfulDoubleConversion(float, float); |
| 892 | void testDivArgDouble(double); |
| 893 | void testDivArgsDouble(double, double); |
| 894 | void testDivArgImmDouble(double, double); |
| 895 | void testDivImmArgDouble(double, double); |
| 896 | void testDivImmsDouble(double, double); |
| 897 | void testDivArgFloat(float); |
| 898 | void testDivArgsFloat(float, float); |
| 899 | void testDivArgImmFloat(float, float); |
| 900 | void testModArg32(int32_t value); |
| 901 | void testModArgs32(int32_t numerator, int32_t denominator); |
| 902 | void testModImms32(int32_t numerator, int32_t denominator); |
| 903 | void testChillModArg(int64_t value); |
| 904 | void testChillModArgs(int64_t numerator, int64_t denominator); |
| 905 | void testChillModImms(int64_t numerator, int64_t denominator); |
| 906 | void testChillModArg32(int32_t value); |
| 907 | void testChillModArgs32(int32_t numerator, int32_t denominator); |
| 908 | void testChillModImms32(int32_t numerator, int32_t denominator); |
| 909 | void (); |
| 910 | void testSwitch(unsigned degree); |
| 911 | void testSwitch(unsigned degree, unsigned gap); |
| 912 | void testSwitchSameCaseAsDefault(); |
| 913 | void testSwitchChillDiv(unsigned degree, unsigned gap); |
| 914 | void testSwitchTargettingSameBlock(); |
| 915 | void testSwitchTargettingSameBlockFoldPathConstant(); |
| 916 | void testTruncFold(int64_t value); |
| 917 | void testZExt32(int32_t value); |
| 918 | void testZExt32Fold(int32_t value); |
| 919 | void testSExt32(int32_t value); |
| 920 | void testSExt32Fold(int32_t value); |
| 921 | void testTruncZExt32(int32_t value); |
| 922 | void testPinRegisters(); |
| 923 | void testX86LeaAddAddShlLeft(); |
| 924 | void testX86LeaAddAddShlRight(); |
| 925 | void testX86LeaAddAdd(); |
| 926 | void testX86LeaAddShlRight(); |
| 927 | void testX86LeaAddShlLeftScale1(); |
| 928 | void testX86LeaAddShlLeftScale2(); |
| 929 | void testX86LeaAddShlLeftScale4(); |
| 930 | void testX86LeaAddShlLeftScale8(); |
| 931 | void testAddShl32(); |
| 932 | void testAddShl64(); |
| 933 | void testAddShl65(); |
| 934 | void testReduceStrengthReassociation(bool flip); |
| 935 | void testLoadBaseIndexShift2(); |
| 936 | void testLoadBaseIndexShift32(); |
| 937 | void testOptimizeMaterialization(); |
| 938 | void testLICMPure(); |
| 939 | void testLICMPureSideExits(); |
| 940 | void testTruncSExt32(int32_t value); |
| 941 | void testSExt8(int32_t value); |
| 942 | void testSExt8Fold(int32_t value); |
| 943 | void testSExt8SExt8(int32_t value); |
| 944 | void testSExt8SExt16(int32_t value); |
| 945 | void testSExt8BitAnd(int32_t value, int32_t mask); |
| 946 | void testBitAndSExt8(int32_t value, int32_t mask); |
| 947 | void testSExt16(int32_t value); |
| 948 | void testSExt16Fold(int32_t value); |
| 949 | void testSExt16SExt16(int32_t value); |
| 950 | void testSExt16SExt8(int32_t value); |
| 951 | void testLICMPureWritesPinned(); |
| 952 | void testLICMPureWrites(); |
| 953 | void testLICMReadsLocalState(); |
| 954 | void testLICMReadsPinned(); |
| 955 | void testLICMReads(); |
| 956 | void testLICMPureNotBackwardsDominant(); |
| 957 | void testLICMPureFoiledByChild(); |
| 958 | void testLICMPureNotBackwardsDominantFoiledByChild(); |
| 959 | void testLICMExitsSideways(); |
| 960 | void testLICMWritesLocalState(); |
| 961 | void testLICMWrites(); |
| 962 | void testLICMFence(); |
| 963 | void testLICMWritesPinned(); |
| 964 | void testLICMControlDependent(); |
| 965 | void testLICMControlDependentNotBackwardsDominant(); |
| 966 | void testLICMControlDependentSideExits(); |
| 967 | void testLICMReadsPinnedWritesPinned(); |
| 968 | void testLICMReadsWritesDifferentHeaps(); |
| 969 | void testLICMReadsWritesOverlappingHeaps(); |
| 970 | void testLICMDefaultCall(); |
| 971 | void testDepend32(); |
| 972 | void testDepend64(); |
| 973 | void testWasmBoundsCheck(unsigned offset); |
| 974 | void testWasmAddress(); |
| 975 | void testFastTLSLoad(); |
| 976 | void testFastTLSStore(); |
| 977 | void testDoubleLiteralComparison(double, double); |
| 978 | void testFloatEqualOrUnorderedFolding(); |
| 979 | void testFloatEqualOrUnorderedFoldingNaN(); |
| 980 | void testFloatEqualOrUnorderedDontFold(); |
| 981 | void testSExt16BitAnd(int32_t value, int32_t mask); |
| 982 | void testBitAndSExt16(int32_t value, int32_t mask); |
| 983 | void testSExt32BitAnd(int32_t value, int32_t mask); |
| 984 | void testShuffleDoesntTrashCalleeSaves(); |
| 985 | void testDemotePatchpointTerminal(); |
| 986 | void testReportUsedRegistersLateUseFollowedByEarlyDefDoesNotMarkUseAsDead(); |
| 987 | void testInfiniteLoopDoesntCauseBadHoisting(); |
| 988 | void testDivImmArgFloat(float, float); |
| 989 | void testDivImmsFloat(float, float); |
| 990 | void testModArgDouble(double); |
| 991 | void testModArgsDouble(double, double); |
| 992 | void testModArgImmDouble(double, double); |
| 993 | void testModImmArgDouble(double, double); |
| 994 | void testModImmsDouble(double, double); |
| 995 | void testModArgFloat(float); |
| 996 | void testModArgsFloat(float, float); |
| 997 | void testModArgImmFloat(float, float); |
| 998 | void testModImmArgFloat(float, float); |
| 999 | void testModImmsFloat(float, float); |
| 1000 | void testDivArgFloatWithUselessDoubleConversion(float); |
| 1001 | void testDivArgsFloatWithUselessDoubleConversion(float, float); |
| 1002 | void testDivArgsFloatWithEffectfulDoubleConversion(float, float); |
| 1003 | void testUDivArgsInt32(uint32_t, uint32_t); |
| 1004 | void testUDivArgsInt64(uint64_t, uint64_t); |
| 1005 | void testUModArgsInt32(uint32_t, uint32_t); |
| 1006 | void testUModArgsInt64(uint64_t, uint64_t); |
| 1007 | void testSubArg(int); |
| 1008 | void testSubArgs(int, int); |
| 1009 | void testSubArgImm(int64_t, int64_t); |
| 1010 | void testSubNeg(int, int); |
| 1011 | void testNegSub(int, int); |
| 1012 | void testNegValueSubOne(int); |
| 1013 | void testSubSub(int, int, int c); |
| 1014 | void testSubSub2(int, int, int c); |
| 1015 | void testSubAdd(int, int, int c); |
| 1016 | void testSubFirstNeg(int, int); |
| 1017 | void testSubImmArg(int, int); |
| 1018 | void testSubArgMem(int64_t, int64_t); |
| 1019 | void testSubMemArg(int64_t, int64_t); |
| 1020 | void testSubImmMem(int64_t, int64_t); |
| 1021 | void testSubMemImm(int64_t, int64_t); |
| 1022 | void testSubArgs32(int, int); |
| 1023 | void testSubArgImm32(int, int); |
| 1024 | void testSubImmArg32(int, int); |
| 1025 | void testSubMemArg32(int32_t, int32_t); |
| 1026 | void testSubArgMem32(int32_t, int32_t); |
| 1027 | void testSubImmMem32(int32_t, int32_t); |
| 1028 | void testSubMemImm32(int32_t, int32_t); |
| 1029 | void testNegValueSubOne32(int); |
| 1030 | void testNegMulArgImm(int64_t, int64_t); |
| 1031 | void testSubMulMulArgs(int64_t, int64_t, int64_t c); |
| 1032 | void testSubArgDouble(double); |
| 1033 | void testSubArgsDouble(double, double); |
| 1034 | void testSubArgImmDouble(double, double); |
| 1035 | void testSubImmArgDouble(double, double); |
| 1036 | void testSubImmsDouble(double, double); |
| 1037 | void testSubArgFloat(float); |
| 1038 | void testSubArgsFloat(float, float); |
| 1039 | void testSubArgImmFloat(float, float); |
| 1040 | void testSubImmArgFloat(float, float); |
| 1041 | void testSubImmsFloat(float, float); |
| 1042 | void testSubArgFloatWithUselessDoubleConversion(float); |
| 1043 | void testSubArgsFloatWithUselessDoubleConversion(float, float); |
| 1044 | void testSubArgsFloatWithEffectfulDoubleConversion(float, float); |
| 1045 | void testTernarySubInstructionSelection(B3::Opcode valueModifier, Type valueType, Air::Opcode expectedOpcode); |
| 1046 | void testNegDouble(double); |
| 1047 | void testNegFloat(float); |
| 1048 | void testNegFloatWithUselessDoubleConversion(float); |
| 1049 | |
| 1050 | void addArgTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&); |
| 1051 | void addBitTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&); |
| 1052 | void addCallTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&); |
| 1053 | void addSExtTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&); |
| 1054 | void addSShrShTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&); |
| 1055 | void addShrTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&); |
| 1056 | void addAtomicTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&); |
| 1057 | void addLoadTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&); |
| 1058 | void addTupleTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&); |
| 1059 | |
| 1060 | void testFastForwardCopy32(); |
| 1061 | void testByteCopyLoop(); |
| 1062 | void testByteCopyLoopStartIsLoopDependent(); |
| 1063 | void testByteCopyLoopBoundIsLoopDependent(); |
| 1064 | |
| 1065 | void addCopyTests(const char* filter, Deque<RefPtr<SharedTask<void()>>>&); |
| 1066 | |
| 1067 | bool shouldRun(const char* filter, const char* testName); |
| 1068 | |
| 1069 | #endif // ENABLE(B3_JIT) |
| 1070 | |