...and here's the missing test case.

-- Michael

On Wed, Oct 19, 2011 at 11:38 AM, Michael Hope <michael.h...@linaro.org> wrote:
> Following on from last night's performance call, I had a look at how
> 64 bit integer operations are mapped to NEON instructions.  The
> summary is:
>
>  * add - fine
>  * subtract - fine
>  * bitwise and - fine
>  * bitwise or - fine
>  * bitwise xor - fine
>  * multiply - can't as the instruction tops out at 32 bits.  Might be
> able to compose using VMLAL
>  * div, mod - no instruction
>  * negate - instruction tops out at 32 bits, but could be turned into
> vmov #0, vsub
>  * left shift constant - missing
>  * right shift constant - missing
>  * right arithmetic shift constant - missing
>  * left shift register - missing
>  * right shift register - tricky, as you do this as a left shift -register
>  * not - no instruction, but could be done through a vceq, #0?
>  * bitwise not - missing
>
> I also noticed that the replicated constants aren't being used.  A
> pre-increment is load constant pool; vadd but could be done as a vmov,
> #-1; vsub.  The same with pre-decrement - it could be done as a vmov,
> #-1; vadd.
>
> This seems worth blueprinting.
>
> -- Michael
>
typedef long long type;
typedef unsigned long long utype;

#define TEST(name, op) \
  void op_##name(type *left, type *right, type *result) { op; }

TEST(add, *result = *left + *right)
TEST(sub, *result = *left - *right)
TEST(mul, *result = *left * *right)
TEST(div, *result = *left / *right)
TEST(mod, *result = *left % *right)
TEST(inc, *result = ++(*left))
TEST(dec, *result = --(*left))
TEST(neg, *result = -*left)
TEST(lshiftc, *result = *left << 5)
TEST(rshiftc, *result = *left >> 5)
TEST(lshift, *result = *left << *right)
TEST(rshift, *result = *left >> *right)
TEST(urshiftc, *result = (utype)*left >> 5)
TEST(urshift, *result = (utype)*left >> *right)
TEST(not, *result = !*left)
TEST(bitnot, *result = ~*left)
TEST(and, *result = *left & *right)
TEST(or, *result = *left | *right)
TEST(xor, *result = *left ^ *right)
TEST(assign, *result = *left)
TEST(const1, *result = 0 - *left)
TEST(const2, *result = *left + 0x100000001LL)
TEST(const3, *result = *left + 0xFFFFFFFFFFFFFFFFLL)

/* Bad:
   mul - can't directly, tops out at 32 bit
   div - none
   mod - none
   inc is a add 1 from constant pool
   dec is a add -1 from constant pool
   neg - tops out at 32 bit
   lshiftc
   {u}rshiftc
   lshift
   {u}rshift
   not
   bitnot
   add doesn't recognise replicated constants
   vshr, reg doesn't exist but can be done through vshl, -shift
*/
_______________________________________________
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-toolchain

Reply via email to