Rune - Fix FP save and restore with mixed ABI calls
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 27 Dec 2017 05:30:46 +0000 (21:30 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 27 Dec 2017 05:30:46 +0000 (21:30 -0800)
commit839c7e65ec6a9bd109f6333604361753bf510bd0
treeb0e13b4721ebf81689d68cd95d1b71cedd294ee0
parentd040ad803a50eef36c347255cc1fa2a0b4ddf577
Rune - Fix FP save and restore with mixed ABI calls

* Rune currently uses MSABI which requires XMM6-15, RDI, and RSI
  to be saved by procedures in addition to the standard Linux/BSD
  ABI which requires procedures to save RBX, RBP, and R12-R15.

  We do this because Rune can't inline as well as a C compiler
  and often has to make internal ABI calls (which also use MSABI)
  in the middle of code the programmer might otherwise believe
  does not have to make procedure calls.  We want to be able to
  maintain FP variables in XMM registers without repeated saving
  and restoring.  The addition of RBX and RBP to the callee-saves
  set also helps Rune's register allocator perform better.

* Fix issues when Rune is calling into a linux/BSD ABI (i.e.
  when interfacing with C, making system calls, etc).  In this
  situation, the Rune procedure was not saving registers that
  could get trashed by the system call or C call).
ras/defs.h
ras/insnx86.c
ras/insnx86.h
ras/proc.c