Page MenuHomePhabricator

[compiler-rt][XRay] Stash xmm registers in the trampolines
ClosedPublic

Authored by dberris on Aug 1 2016, 10:43 PM.

Details

Summary

We now stash and restore the xmm registers in the trampolines so that
log handlers don't need to worry about clobbering these registers.

In response to comments in D21612.

Diff Detail

Repository
rL LLVM

Event Timeline

dberris updated this revision to Diff 66428.Aug 1 2016, 10:43 PM
dberris retitled this revision from to [compiler-rt][XRay] Stash xmm registers in the trampolines.
dberris updated this object.
dberris added reviewers: rSerge, eugenis, echristo, rnk.
dberris added a subscriber: llvm-commits.
dberris updated this revision to Diff 66432.Aug 1 2016, 11:32 PM
  • Fixed the wrong math on stack adjustment
rSerge added inline comments.Aug 2 2016, 9:07 AM
lib/xray/xray_trampoline_x86.S
92–97 ↗(On Diff #66432)

Wouldn't it suffice to save only xmm0 and xmm1 here? As I understood, no calling convention uses registers beyond xmm1 for return values: http://www.agner.org/optimize/calling_conventions.pdf

dberris updated this revision to Diff 66606.Aug 2 2016, 7:25 PM
dberris marked an inline comment as done.

Only save xmm0 and xmm1 on the exit trampoline

lib/xray/xray_trampoline_x86.S
92–97 ↗(On Diff #66432)

It should be -- thanks for the link!

rSerge accepted this revision.Aug 3 2016, 4:39 AM
rSerge edited edge metadata.
This revision is now accepted and ready to land.Aug 3 2016, 4:39 AM
rnk accepted this revision.Aug 3 2016, 9:18 AM
rnk edited edge metadata.

lgtm

This revision was automatically updated to reflect the committed changes.