Ignore:
Timestamp:
Jun 28, 2021, 10:55:12 AM (4 years ago)
Author:
[email protected]
Message:

Add LLInt fast path for less, lesseq, greater and greatereq
https://bugs.webkit.org/show_bug.cgi?id=226266

Patch by Mikhail R. Gadelha <Mikhail R. Gadelha> on 2021-06-28
Reviewed by Tadeu Zagallo.

The motivation is to add fast path for integers and doubles
in LLInt, so we don't need to go to slow path for those cases.

This patch implements the less, lesseq, greater, greatereq
instruction for ARMv7, MIPS and CLoop.

Microbenchmarking results:

  • x86_64: number-comparison-inline definitely 1.3520x faster
  • ARMv7: number-comparison-inline definitely 1.3520x faster

JetStream2 results:

  • x86_64 jit: 1.015 times better
  • x86_64 no-jit: 1.018 times better
  • ARMv7 no-jit: 1.004 times worse
  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • offlineasm/arm.rb:
  • offlineasm/cloop.rb:
  • offlineasm/mips.rb:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/offlineasm/arm.rb

    r267371 r279343  
    373373        $asm.puts "tst #{value.armOperand}, #{mask.armOperand}"
    374374    end
     375end
     376
     377def emitArmDoubleCompare(operands, code)
     378    $asm.puts "mov #{operands[2].armOperand}, \#0"
     379    $asm.puts "vcmpe.f64 #{armOperands(operands[0..1])}"
     380    $asm.puts "vmrs APSR_nzcv, FPSCR"
     381    $asm.puts "it #{code}"
     382    $asm.puts "mov#{code} #{operands[2].armOperand}, \#1"
    375383end
    376384
     
    642650        when "cilteq", "cplteq", "cblteq"
    643651            emitArmCompare(operands, "le")
     652        when "cdgt"
     653            emitArmDoubleCompare(operands, "gt")
     654        when "cdgteq"
     655            emitArmDoubleCompare(operands, "ge")
     656        when "cdlt"
     657            emitArmDoubleCompare(operands, "mi")
     658        when "cdlteq"
     659            emitArmDoubleCompare(operands, "ls")
    644660        when "tis", "tbs", "tps"
    645661            emitArmTestSet(operands, "mi")
Note: See TracChangeset for help on using the changeset viewer.