llvm-6502/lib/Target/PowerPC
Nate Begeman 1cbf3abbb8 Next round of PPC CR optimizations. For the following code:
int %bar(float %a, float %b, float %c, float %d) {
entry:
    %tmp.1 = setlt float %a, %d
    %tmp.2 = setlt float %b, %d
    %or = or bool %tmp.1, %tmp.2
    %tmp.3 = setgt float %c, %d
    %tmp.4 = or bool %or, %tmp.3
    %tmp.5 = and bool %tmp.4, true
    %retval = cast bool %tmp.5 to int
    ret int %retval
}

We now emit:

_bar:
.LBB_bar_0:     ; entry
        fcmpu cr0, f1, f4
        fcmpu cr1, f2, f4
        cror 0, 0, 4
        fcmpu cr1, f3, f4
        cror 28, 0, 5
        mfcr r2
        rlwinm r3, r2, 29, 31, 31
        blr

Instead of:

_bar:
.LBB_bar_0:     ; entry
        fcmpu cr7, f1, f4
        mfcr r2
        rlwinm r2, r2, 29, 31, 31
        fcmpu cr7, f2, f4
        mfcr r3
        rlwinm r3, r3, 29, 31, 31
        or r2, r2, r3
        fcmpu cr7, f3, f4
        mfcr r3
        rlwinm r3, r3, 30, 31, 31
        or r3, r2, r3
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21321 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-18 07:48:09 +00:00
..
.cvsignore ignore generated files. 2004-11-21 00:00:54 +00:00
LICENSE.TXT
Makefile Specify all of the targets built. 2004-12-16 17:26:44 +00:00
PowerPC.td Factor out common .td file chunks. 2004-12-16 16:31:57 +00:00
PowerPCInstrInfo.h Get rid of flags that are dead 2004-11-23 20:37:41 +00:00
PowerPCTargetMachine.h Remove the ISel->AsmPrinter link via the TargetMachine that was put in 2004-11-27 04:45:11 +00:00
PPC32.td Factor out common .td file chunks. 2004-12-16 16:31:57 +00:00
PPC32ISelSimple.cpp Add the necessary support to codegen condition register logical ops with 2005-04-14 03:20:38 +00:00
PPC32JITInfo.h Implement all of the methods 2004-11-23 05:57:57 +00:00
PPC32RegisterInfo.td Initial support for allocation condition registers 2005-04-12 07:04:16 +00:00
PPC64.td Factor out common .td file chunks. 2004-12-16 16:31:57 +00:00
PPC64CodeEmitter.cpp
PPC64InstrInfo.cpp
PPC64InstrInfo.h
PPC64ISelPattern.cpp Elimate handling of ZERO_EXTEND_INREG. This causes the PPC backend to emit 2005-04-13 02:40:26 +00:00
PPC64JITInfo.h
PPC64RegisterInfo.cpp
PPC64RegisterInfo.h
PPC64RegisterInfo.td
PPC64TargetMachine.h
PPC.h Make pattern isel default for ppc 2005-04-15 22:12:16 +00:00
PPCAsmPrinter.cpp Add the necessary support to codegen condition register logical ops with 2005-04-14 03:20:38 +00:00
PPCBranchSelector.cpp
PPCCodeEmitter.cpp Handle ExternalSymbol operands in the PPC JIT 2005-04-18 00:46:10 +00:00
PPCFrameInfo.h
PPCInstrBuilder.h
PPCInstrFormats.td Change codegen for setcc to read the bit directly out of the condition 2005-04-18 02:43:24 +00:00
PPCInstrInfo.cpp Initial support for allocation condition registers 2005-04-12 07:04:16 +00:00
PPCInstrInfo.h
PPCInstrInfo.td Change codegen for setcc to read the bit directly out of the condition 2005-04-18 02:43:24 +00:00
PPCISelPattern.cpp Next round of PPC CR optimizations. For the following code: 2005-04-18 07:48:09 +00:00
PPCJITInfo.cpp There is no reason to store <x,x>, just store <x>. 2004-11-26 20:25:17 +00:00
PPCJITInfo.h This method is dead 2004-11-23 18:47:55 +00:00
PPCRegisterInfo.cpp Initial support for allocation condition registers 2005-04-12 07:04:16 +00:00
PPCRegisterInfo.h
PPCRegisterInfo.td
PPCRelocations.h * Rename existing relocations to be more specific 2004-11-24 22:30:08 +00:00
PPCTargetMachine.cpp Make pattern isel default for ppc 2005-04-15 22:12:16 +00:00
PPCTargetMachine.h Move JITInfo from PPCTM to PPC32TM 2004-11-23 05:56:40 +00:00
README.txt Update PPC readme. Remove things that are done or aren't ppc specific 2005-04-11 20:48:57 +00:00

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