* Send instructions that ensure the given register is saved. */
| 564 | * Send instructions that ensure the given register is saved. |
| 565 | */ |
| 566 | static bool sendSaveRegToStack(FILE *out, CallInfo &info, Register reg) |
| 567 | { |
| 568 | if (info.isSaved(reg)) |
| 569 | return true; |
| 570 | Register rscratch = (info.isClobbered(REGISTER_RAX)? REGISTER_RAX: |
| 571 | info.getScratch()); |
| 572 | auto result = sendPush(out, info.rsp_offset, info.before, reg, rscratch); |
| 573 | if (result.first) |
| 574 | { |
| 575 | // Push was successful: |
| 576 | info.push(reg); |
| 577 | if (result.second) |
| 578 | info.clobber(rscratch); |
| 579 | } |
| 580 | return result.first; |
| 581 | } |
| 582 | |
| 583 | /* |
| 584 | * Send a load (mov/lea) from a memory operand to a register. |
no test coverage detected