diff options
author | Chris Lattner <sabre@nondot.org> | 2006-04-02 06:11:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-04-02 06:11:11 +0000 |
commit | 4993249a04bf59a0c142077f75525b30e4f40b7b (patch) | |
tree | 8432681ed8d73e74c23d05b4522bc2d1737cd425 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | caba72b6ff9aa81b5e1ad07d8c246d30ceb616e0 (diff) | |
download | llvm-4993249a04bf59a0c142077f75525b30e4f40b7b.zip llvm-4993249a04bf59a0c142077f75525b30e4f40b7b.tar.gz llvm-4993249a04bf59a0c142077f75525b30e4f40b7b.tar.bz2 |
Add a little dag combine to compile this:
int %AreSecondAndThirdElementsBothNegative(<4 x float>* %in) {
entry:
%tmp1 = load <4 x float>* %in ; <<4 x float>> [#uses=1]
%tmp = tail call int %llvm.ppc.altivec.vcmpgefp.p( int 1, <4 x float> < float 0x7FF8000000000000, float 0.000000e+00, float 0.000000e+00, float 0x7FF8000000000000 >, <4 x float> %tmp1 ) ; <int> [#uses=1]
%tmp = seteq int %tmp, 0 ; <bool> [#uses=1]
%tmp3 = cast bool %tmp to int ; <int> [#uses=1]
ret int %tmp3
}
into this:
_AreSecondAndThirdElementsBothNegative:
mfspr r2, 256
oris r4, r2, 49152
mtspr 256, r4
li r4, lo16(LCPI1_0)
lis r5, ha16(LCPI1_0)
lvx v0, 0, r3
lvx v1, r5, r4
vcmpgefp. v0, v1, v0
mfcr r3, 2
rlwinm r3, r3, 27, 31, 31
mtspr 256, r2
blr
instead of this:
_AreSecondAndThirdElementsBothNegative:
mfspr r2, 256
oris r4, r2, 49152
mtspr 256, r4
li r4, lo16(LCPI1_0)
lis r5, ha16(LCPI1_0)
lvx v0, 0, r3
lvx v1, r5, r4
vcmpgefp. v0, v1, v0
mfcr r3, 2
rlwinm r3, r3, 27, 31, 31
xori r3, r3, 1
cntlzw r3, r3
srwi r3, r3, 5
mtspr 256, r2
blr
llvm-svn: 27356
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions