Changeset 194915 in webkit


Ignore:
Timestamp:
Jan 12, 2016, 12:05:52 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

[JSC] Remove some invalid immediate instruction forms from ARM64 Air
https://bugs.webkit.org/show_bug.cgi?id=153024

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-01-12
Reviewed by Michael Saboff.

  • b3/B3BasicBlock.h:

Export the symbols for testb3.

  • b3/air/AirOpcode.opcodes:

We had 2 invalid opcodes:
-Compare with immediate just does not exist.
-Test64 with immediate exists but Air does not recognize

the valid form of bit-immediates.

  • b3/testb3.cpp:

(JSC::B3::genericTestCompare):
(JSC::B3::testCompareImpl):
Extend the tests to cover what was invalid.

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r194894 r194915  
     12016-01-12  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        [JSC] Remove some invalid immediate instruction forms from ARM64 Air
     4        https://bugs.webkit.org/show_bug.cgi?id=153024
     5
     6        Reviewed by Michael Saboff.
     7
     8        * b3/B3BasicBlock.h:
     9        Export the symbols for testb3.
     10
     11        * b3/air/AirOpcode.opcodes:
     12        We had 2 invalid opcodes:
     13        -Compare with immediate just does not exist.
     14        -Test64 with immediate exists but Air does not recognize
     15         the valid form of bit-immediates.
     16
     17        * b3/testb3.cpp:
     18        (JSC::B3::genericTestCompare):
     19        (JSC::B3::testCompareImpl):
     20        Extend the tests to cover what was invalid.
     21
    1222016-01-12  Benjamin Poulain  <bpoulain@apple.com>
    223
  • trunk/Source/JavaScriptCore/b3/B3BasicBlock.h

    r194372 r194915  
    7777    ValueType* appendNew(Procedure&, Arguments...);
    7878
    79     Value* appendIntConstant(Procedure&, Origin, Type, int64_t value);
     79    JS_EXPORT_PRIVATE Value* appendIntConstant(Procedure&, Origin, Type, int64_t value);
    8080    Value* appendIntConstant(Procedure&, Value* likeValue, int64_t value);
    8181
  • trunk/Source/JavaScriptCore/b3/air/AirOpcode.opcodes

    r194873 r194915  
    518518
    51951964: Compare64 U:G:32, U:G:64, U:G:64, ZD:G:32
    520     RelCond, Tmp, Imm, Tmp
    521520    RelCond, Tmp, Tmp, Tmp
     521    x86: RelCond, Tmp, Imm, Tmp
    522522
    523523Test32 U:G:32, U:G:32, U:G:32, ZD:G:32
     
    526526
    52752764: Test64 U:G:32, U:G:64, U:G:64, ZD:G:32
    528     ResCond, Tmp, Imm, Tmp
     528    x86: ResCond, Tmp, Imm, Tmp
    529529    ResCond, Tmp, Tmp, Tmp
    530530
  • trunk/Source/JavaScriptCore/b3/testb3.cpp

    r194855 r194915  
    74377437}
    74387438
    7439 template<typename LeftFunctor, typename RightFunctor>
     7439template<typename LeftFunctor, typename RightFunctor, typename InputType>
    74407440void genericTestCompare(
    74417441    B3::Opcode opcode, const LeftFunctor& leftFunctor, const RightFunctor& rightFunctor,
    7442     int left, int right, int result)
     7442    InputType left, InputType right, int result)
    74437443{
    74447444    // Using a compare.
     
    74497449        Value* leftValue = leftFunctor(root, proc);
    74507450        Value* rightValue = rightFunctor(root, proc);
     7451        Value* comparisonResult = root->appendNew<Value>(proc, opcode, Origin(), leftValue, rightValue);
    74517452       
    74527453        root->appendNew<ControlValue>(
     
    74547455            root->appendNew<Value>(
    74557456                proc, NotEqual, Origin(),
    7456                 root->appendNew<Value>(proc, opcode, Origin(), leftValue, rightValue),
    7457                 root->appendNew<Const32Value>(proc, Origin(), 0)));
     7457                comparisonResult,
     7458                root->appendIntConstant(proc, Origin(), comparisonResult->type(), 0)));
    74587459
    74597460        CHECK(compileAndRun<int>(proc, left, right) == result);
     
    76097610}
    76107611
    7611 void testCompareImpl(B3::Opcode opcode, int left, int right)
     7612void testCompareImpl(B3::Opcode opcode, int64_t left, int64_t right)
    76127613{
    76137614    int result = modelCompare(opcode, left, right);
    76147615   
    76157616    // Test tmp-to-tmp.
     7617    genericTestCompare(
     7618        opcode,
     7619        [&] (BasicBlock* block, Procedure& proc) {
     7620            return block->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0);
     7621        },
     7622        [&] (BasicBlock* block, Procedure& proc) {
     7623            return block->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1);
     7624        },
     7625        left, right, result);
    76167626    genericTestCompare(
    76177627        opcode,
     
    76327642        opcode,
    76337643        [&] (BasicBlock* block, Procedure& proc) {
     7644            return block->appendNew<Const64Value>(proc, Origin(), left);
     7645        },
     7646        [&] (BasicBlock* block, Procedure& proc) {
     7647            return block->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1);
     7648        },
     7649        left, right, result);
     7650    genericTestCompare(
     7651        opcode,
     7652        [&] (BasicBlock* block, Procedure& proc) {
    76347653            return block->appendNew<Const32Value>(proc, Origin(), left);
    76357654        },
     
    76427661
    76437662    // Test tmp-to-imm.
     7663    genericTestCompare(
     7664        opcode,
     7665        [&] (BasicBlock* block, Procedure& proc) {
     7666            return block->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0);
     7667        },
     7668        [&] (BasicBlock* block, Procedure& proc) {
     7669            return block->appendNew<Const64Value>(proc, Origin(), right);
     7670        },
     7671        left, right, result);
    76447672    genericTestCompare(
    76457673        opcode,
     
    76557683
    76567684    // Test imm-to-imm.
     7685    genericTestCompare(
     7686        opcode,
     7687        [&] (BasicBlock* block, Procedure& proc) {
     7688            return block->appendNew<Const64Value>(proc, Origin(), left);
     7689        },
     7690        [&] (BasicBlock* block, Procedure& proc) {
     7691            return block->appendNew<Const64Value>(proc, Origin(), right);
     7692        },
     7693        left, right, result);
    76577694    genericTestCompare(
    76587695        opcode,
Note: See TracChangeset for help on using the changeset viewer.