diff options
author | Chris Lattner <sabre@nondot.org> | 2006-03-13 21:52:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-03-13 21:52:10 +0000 |
commit | 1877ec9b02511e111998596b9ba9c3a2275d6a92 (patch) | |
tree | 94b395367ee789c28469926ec5f7d16b0302712d /docs/CommandGuide | |
parent | 7abddda6cc7101623d589b7bf7cedf873fac0b94 (diff) |
For functions that use vector registers, save VRSAVE, mark used
registers, and update it on entry to each function, then restore it on exit.
This compiles:
void func(vfloat *a, vfloat *b, vfloat *c) {
*a = *b * *c + *c;
}
to this:
_func:
mfspr r2, 256
oris r6, r2, 49152
mtspr 256, r6
lvx v0, 0, r5
lvx v1, 0, r4
vmaddfp v0, v1, v0, v0
stvx v0, 0, r3
mtspr 256, r2
blr
GCC produces this (which has additional stack accesses):
_func:
mfspr r0,256
stw r0,-4(r1)
oris r0,r0,0xc000
mtspr 256,r0
lvx v0,0,r5
lvx v1,0,r4
lwz r12,-4(r1)
vmaddfp v0,v0,v1,v0
stvx v0,0,r3
mtspr 256,r12
blr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26733 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/CommandGuide')
0 files changed, 0 insertions, 0 deletions