mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-23 15:29:51 +00:00
b2c4bf3ff6
regularly in "normal" code, but for things like software graphics, they make a big difference. For the following code: unsigned short Trans16Bit(unsigned srcA,unsigned srcB,unsigned alpha) { unsigned tmpA,tmpB,mixed; tmpA = ((srcA & 0x03E0) << 15) | (srcA & 0x7C1F); tmpB = ((srcB & 0x03E0) << 15) | (srcB & 0x7C1F); mixed = (tmpA * alpha) + (tmpB * (32 - alpha)); return ((mixed >> 5) & 0x7C1F) | ((mixed >> 20) & 0x03E0); } We now generate: _Trans16Bit: .LBB_Trans16Bit_0: ; entry andi. r2, r4, 31775 rlwimi r2, r4, 15, 7, 11 subfic r4, r5, 32 mullw r2, r2, r4 andi. r4, r3, 31775 rlwimi r4, r3, 15, 7, 11 mullw r3, r4, r5 add r2, r2, r3 srwi r3, r2, 5 andi. r3, r3, 31775 rlwimi r3, r2, 12, 22, 26 blr Instead of: _Trans16Bit: .LBB_Trans16Bit_0: ; entry slwi r2, r4, 15 rlwinm r2, r2, 0, 7, 11 andi. r4, r4, 31775 or r2, r2, r4 subfic r4, r5, 32 mullw r2, r2, r4 slwi r4, r3, 15 rlwinm r4, r4, 0, 7, 11 andi. r3, r3, 31775 or r3, r4, r3 mullw r3, r3, r5 add r2, r2, r3 srwi r3, r2, 5 andi. r3, r3, 31775 srwi r2, r2, 20 rlwimi r3, r2, 0, 22, 26 blr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22201 91177308-0d34-0410-b5e6-96231b3b80d8 |
||
---|---|---|
.. | ||
.cvsignore | ||
LICENSE.TXT | ||
Makefile | ||
PowerPC.td | ||
PowerPCInstrInfo.h | ||
PowerPCTargetMachine.h | ||
PPC32.td | ||
PPC32ISelSimple.cpp | ||
PPC32JITInfo.h | ||
PPC32RegisterInfo.td | ||
PPC64.td | ||
PPC64CodeEmitter.cpp | ||
PPC64InstrInfo.cpp | ||
PPC64InstrInfo.h | ||
PPC64ISelPattern.cpp | ||
PPC64JITInfo.h | ||
PPC64RegisterInfo.cpp | ||
PPC64RegisterInfo.h | ||
PPC64RegisterInfo.td | ||
PPC64TargetMachine.h | ||
PPC.h | ||
PPCAsmPrinter.cpp | ||
PPCBranchSelector.cpp | ||
PPCCodeEmitter.cpp | ||
PPCFrameInfo.h | ||
PPCInstrBuilder.h | ||
PPCInstrFormats.td | ||
PPCInstrInfo.cpp | ||
PPCInstrInfo.h | ||
PPCInstrInfo.td | ||
PPCISelPattern.cpp | ||
PPCJITInfo.cpp | ||
PPCJITInfo.h | ||
PPCRegisterInfo.cpp | ||
PPCRegisterInfo.h | ||
PPCRegisterInfo.td | ||
PPCRelocations.h | ||
PPCTargetMachine.cpp | ||
PPCTargetMachine.h | ||
README.txt |
TODO: * condition register allocation * gpr0 allocation * implement do-loop -> bdnz transform * implement powerpc-64 for darwin * use stfiwx in float->int * should hint to the branch select pass that it doesn't need to print the second unconditional branch, so we don't end up with things like: b .LBBl42__2E_expand_function_8_674 ; loopentry.24 b .LBBl42__2E_expand_function_8_42 ; NewDefault b .LBBl42__2E_expand_function_8_42 ; NewDefault Currently failing tests that should pass: * MultiSource |- Applications | `- hbd: miscompilation