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
  • !5182

i#2985 scatter-gather: Preserve scratch xmm.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Abhinav Anil Sharma requested to merge i2985-spill-scratch-xmm into master Nov 01, 2021
  • Overview 16
  • Commits 10
  • Pipelines 0
  • Changes 7

Preserves the scratch xmm register by spilling it before the scatter/gather instr expansion, and restoring it after. We use memory obtained from the thread-private heap, using dr_thread_alloc, as the spill slot.

Reserves TLS slot for every thread in drx, to store the allocated pointer to the xmm spill slot.

Extends drx's state restore to also restore the app value of the spilled xmm register.

An alternate approach was to extend drreg to make it capable of spilling xmm regs too, but that was overkill as the scatter/gather expansion requires only a small subset of that functionality that is very easily implemented as a set of manual spill and restore. When that support is available in drreg (#3844) we can use it here too; added a TODO.

Also extends the pure-asm scatter/gather test to verify that the scratch reg (which is xmm0 in the test, given that we always select the lowest-numbered available xmm reg as scratch) value is preserved across the scatter/gather instrs.

Also fixes an issue with comparison of xmm regs in the test. cmpss writes the result of comparison to the first reg, not the aflags. (We had replaced vpcmpud with cmpss in 106bf952 due to some SIGILL issues.)

Issues: #2985 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i2985-spill-scratch-xmm