Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96dbb4fc authored by Martyn Capewell's avatar Martyn Capewell Committed by Dave Butcher
Browse files

Adds UXTB16 support to Pixelflinger

 * Add support for UXTB16 to the disassembler
 * Add encoding of the UXTB16 instruction to the Pixelflinger JIT.

Introducing the UXTB16 instruction allows removal of some masking code, and is
beneficial from a pipeline point of view - lots of UXTB16 followed by MUL
sequences.

Also, further rescheduling and use of SMULWB brings extra performance
improvements.

 * Use UXTB16 in bilinear filtered texturing

Uses UXTB16 to extract channels for SIMD operations, rather than creating and
ANDing with masks. Saves a register and is faster on A8, as UXTB16 result can
feed into first stage of multiply, unlike AND.

Also, used SMULWB rather than SMULBB, which allows removal of MOVs used to
rescale results.

Code has been scheduled for A8 pipeline, specifically aiming to allow
multiplies to issue in pipeline 0, for efficient dual issue operation.

Testing on SpriteMethodTest (http://code.google.com/p/apps-for-android/) gives
8% improvement (12.7 vs. 13.7 fps.)

SMULBB to SMULWB trick could be used in <v6 code path, but this hasn't been
implemented.
parent 303254eb
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -424,5 +424,15 @@ void ARMAssembler::SMLAW(int cc, int y,
    *mPC++ = (cc<<28) | 0x1200080 | (Rd<<16) | (Rn<<12) | (Rs<<8) | (y<<4) | Rm;
    *mPC++ = (cc<<28) | 0x1200080 | (Rd<<16) | (Rn<<12) | (Rs<<8) | (y<<4) | Rm;
}
}


#if 0
#pragma mark -
#pragma mark Byte/half word extract and extend (ARMv6+ only)...
#endif

void ARMAssembler::UXTB16(int cc, int Rd, int Rm, int rotate)
{
    *mPC++ = (cc<<28) | 0x6CF0070 | (Rd<<12) | ((rotate >> 3) << 10) | Rm;
}

}; // namespace android
}; // namespace android
+1 −0
Original line number Original line Diff line number Diff line
@@ -123,6 +123,7 @@ public:
                int RdHi, int RdLo, int Rs, int Rm);
                int RdHi, int RdLo, int Rs, int Rm);
    virtual void SMLAW(int cc, int y,
    virtual void SMLAW(int cc, int y,
                int Rd, int Rm, int Rs, int Rn);
                int Rd, int Rm, int Rs, int Rn);
    virtual void UXTB16(int cc, int Rd, int Rm, int rotate);


private:
private:
                ARMAssembler(const ARMAssembler& rhs);
                ARMAssembler(const ARMAssembler& rhs);
+3 −0
Original line number Original line Diff line number Diff line
@@ -203,6 +203,9 @@ public:
    virtual void SMLAW(int cc, int y,
    virtual void SMLAW(int cc, int y,
                int Rd, int Rm, int Rs, int Rn) = 0;
                int Rd, int Rm, int Rs, int Rn) = 0;


    // byte/half word extract...
    virtual void UXTB16(int cc, int Rd, int Rm, int rotate) = 0;

    // -----------------------------------------------------------------------
    // -----------------------------------------------------------------------
    // convenience...
    // convenience...
    // -----------------------------------------------------------------------
    // -----------------------------------------------------------------------
+3 −0
Original line number Original line Diff line number Diff line
@@ -195,6 +195,9 @@ void ARMAssemblerProxy::SMLAW(int cc, int y, int Rd, int Rm, int Rs, int Rn) {
    mTarget->SMLAW(cc, y, Rd, Rm, Rs, Rn);
    mTarget->SMLAW(cc, y, Rd, Rm, Rs, Rn);
}
}


void ARMAssemblerProxy::UXTB16(int cc, int Rd, int Rm, int rotate) {
    mTarget->UXTB16(cc, Rd, Rm, rotate);
}


}; // namespace android
}; // namespace android
+2 −0
Original line number Original line Diff line number Diff line
@@ -114,6 +114,8 @@ public:
    virtual void SMLAW(int cc, int y,
    virtual void SMLAW(int cc, int y,
                int Rd, int Rm, int Rs, int Rn);
                int Rd, int Rm, int Rs, int Rn);


    virtual void UXTB16(int cc, int Rd, int Rm, int rotate);

private:
private:
    ARMAssemblerInterface*  mTarget;
    ARMAssemblerInterface*  mTarget;
};
};
Loading