diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2010-06-21 11:50:42 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2010-06-21 11:50:42 -0700 |
commit | 67e6fcd19533f54ca37cbe72425f55a40a7f0333 (patch) | |
tree | 51bd71957a0510d5b24d1f1e118e3b342214c8c2 /libpixelflinger/codeflinger/load_store.cpp | |
parent | f1792b3d125a6adefa6941d20b3f26833570ab65 (diff) | |
parent | 1adbb607d2b6a74b7871a8cecd7c5690c8c5cf6d (diff) | |
download | system_core-67e6fcd19533f54ca37cbe72425f55a40a7f0333.zip system_core-67e6fcd19533f54ca37cbe72425f55a40a7f0333.tar.gz system_core-67e6fcd19533f54ca37cbe72425f55a40a7f0333.tar.bz2 |
merge from froyo-plus-aosp
Change-Id: Ie231effb4d9dfd63aa98ec08b269c31ce32aa1c0
Diffstat (limited to 'libpixelflinger/codeflinger/load_store.cpp')
-rw-r--r-- | libpixelflinger/codeflinger/load_store.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/libpixelflinger/codeflinger/load_store.cpp b/libpixelflinger/codeflinger/load_store.cpp index 93c5825..ed20a00 100644 --- a/libpixelflinger/codeflinger/load_store.cpp +++ b/libpixelflinger/codeflinger/load_store.cpp @@ -18,9 +18,12 @@ #include <assert.h> #include <stdio.h> #include <cutils/log.h> - #include "codeflinger/GGLAssembler.h" +#ifdef __ARM_ARCH__ +#include <machine/cpu-features.h> +#endif + namespace android { // ---------------------------------------------------------------------------- @@ -110,6 +113,20 @@ void GGLAssembler::extract(integer_t& d, int s, int h, int l, int bits) assert(maskLen<=8); assert(h); +#if __ARM_ARCH__ >= 7 + const int mask = (1<<maskLen)-1; + if ((h == bits) && !l && (s != d.reg)) { + MOV(AL, 0, d.reg, s); // component = packed; + } else if ((h == bits) && l) { + MOV(AL, 0, d.reg, reg_imm(s, LSR, l)); // component = packed >> l; + } else if (!l && isValidImmediate(mask)) { + AND(AL, 0, d.reg, s, imm(mask)); // component = packed & mask; + } else if (!l && isValidImmediate(~mask)) { + BIC(AL, 0, d.reg, s, imm(~mask)); // component = packed & mask; + } else { + UBFX(AL, d.reg, s, l, maskLen); // component = (packed & mask) >> l; + } +#else if (h != bits) { const int mask = ((1<<maskLen)-1) << l; if (isValidImmediate(mask)) { @@ -132,6 +149,7 @@ void GGLAssembler::extract(integer_t& d, int s, int h, int l, int bits) if (s != d.reg) { MOV(AL, 0, d.reg, s); } +#endif d.s = maskLen; } |