[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Devel] suggested improvement to FT_Add64
From: |
Nathan Hurst |
Subject: |
Re: [Devel] suggested improvement to FT_Add64 |
Date: |
Fri, 12 Oct 2001 10:44:10 +1000 |
User-agent: |
Mutt/1.3.22i |
Follow up:
I just tried (for kicks :):
void njh(long long* x,
long long* y,
long long* z) {
*z = *x + *y;
}
And it won handsomely with
lwz 9,0(3)
lwz 10,4(3)
lwz 11,0(4)
lwz 12,4(4)
addc 8,10,12
adde 7,9,11
stw 7,0(5)
stw 8,4(5)
blr
And I thought "this is mighty nice, I wonder if not using pass by pointer
would be any faster", so I tried:
void njh2(const long long x,
const long long y,
long long& z) {
z = x + y;
}
and it produced 5 instructions.
addc 10,4,6
adde 9,3,5
stw 9,0(7)
stw 10,4(7)
blr
Finally, using long long add in a stream of code produces only 2 instructions
(the two adds) and nicely moves them in between two stores of unrelated data
to remove the bubbles...
stw 17,28(30)
addc 10,13,15
adde 9,12,14
stw 18,32(30)
njh