Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Merge requests
  • !5322

i#4134 drbbdup: Avoid 2nd scratch via max_case_encoding

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Derek Bruening requested to merge i4134-drbbdup-aarch-cmp-opt into master Feb 02, 2022
  • Overview 10
  • Commits 5
  • Pipelines 0
  • Changes 3

Adds a new drbbdup option max_case_encoding. When the value is small, we can avoid a 2nd scratch register for aarchxx, since we can fit all encodings in immediates inside compare instructions.

Adds a sanity check. Confirmed visually in the debug logs that the 2nd scratch is gone: Before:

  --------------------------------------------------
  after instrumentation:
  TAG  0x0000ffff868340c0
   +0    m4 @0x0000fffd428950e8  f900b781   str    %x1 -> +0x0168(%x28)[8byte]
   +4    m4 @0x0000fffd42894da0  d53b4200   mrs    %nzcv -> %x0
   +8    m4 @0x0000fffd42894cd8  f900af80   str    %x0 -> +0x0158(%x28)[8byte]
   +12   m4 @0x0000fffd42894c58  d28c1000   movz   $0x6080 lsl $0x00 -> %x0
   +16   m4 @0x0000fffd42894bd8  f2a85000   movk   %x0 $0x4280 lsl $0x10 -> %x0
   +20   m4 @0x0000fffd42894b10  f2dfffe0   movk   %x0 $0xffff lsl $0x20 -> %x0
   +24   m4 @0x0000fffd42894a48  f9400000   ldr    (%x0)[8byte] -> %x0
   +28   m4 @0x0000fffd42894e20  f9400000   <label>
   +28   m4 @0x0000fffd42894980  f100041f   subs   %x0 $0x0000000000000001 lsl $0x0000000000000000 -> %xzr
   +32   m4 @0x0000fffd42894900  54000001   b.ne   @0x0000fffd42894fa0[8byte]
  --------------------------------------------------

After:

  --------------------------------------------------
  after instrumentation:
  TAG  0x0000ffff9aedf0c0
   +0    m4 @0x0000fffd56f400e8  d53b4200   mrs    %nzcv -> %x0
   +4    m4 @0x0000fffd56f3fda0  f900af80   str    %x0 -> +0x0158(%x28)[8byte]
   +8    m4 @0x0000fffd56f3fcd8  d2821000   movz   $0x1080 lsl $0x00 -> %x0
   +12   m4 @0x0000fffd56f3fc58  f2aadd60   movk   %x0 $0x56eb lsl $0x10 -> %x0
   +16   m4 @0x0000fffd56f3fbd8  f2dfffe0   movk   %x0 $0xffff lsl $0x20 -> %x0
   +20   m4 @0x0000fffd56f3fb10  f9400000   ldr    (%x0)[8byte] -> %x0
   +24   m4 @0x0000fffd56f3fe20  f9400000   <label>
   +24   m4 @0x0000fffd56f3fa48  f100041f   subs   %x0 $0x0000000000000001 lsl $0x0000000000000000 -> %xzr
   +28   m4 @0x0000fffd56f3f980  54000001   b.ne   @0x0000fffd56f3ffa0[8byte]
  --------------------------------------------------

Issue: #4134 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i4134-drbbdup-aarch-cmp-opt