Skip to content
  1. Jun 24, 2013
    • Ulrich Weigand's avatar
      · ba19f796
      Ulrich Weigand authored
      [PowerPC] Add some FIXMEs
      
      A bunch of extendend mnemomics ought to support '.' forms.
      Add FIXMEs to the test case for those.
      
      llvm-svn: 184757
      ba19f796
    • Ulrich Weigand's avatar
      · 86247b6e
      Ulrich Weigand authored
      [PowerPC] Add predicted forms of branches
      
      This adds support for the predicted forms of branches (+/-).
      There are three cases to consider:
      - Branches using a PPC::Predicate code
        For these, I've added new PPC::Predicate codes corresponding
        to the BO values for predicted branch forms, and updated insn
        printing to print them correctly.  I've also added new aliases
        for the asm parser matching the new forms.
      - bt/bf
        I've added new aliases matching to gBC etc.
      - bd(n)z variants
        I've added new instruction patterns for the predicted forms.
      
      In all cases, the new patterns are used for the asm parser only.
      (The new infrastructure ought to be sufficient to allow use by
      the compiler too at some point.)
      
      llvm-svn: 184754
      86247b6e
    • Ulrich Weigand's avatar
      · fedd5a75
      Ulrich Weigand authored
      [PowerPC] Add t/f branch mnemonics to asm parser
      
      This adds the bt/bf/bd(n)zt/bd(n)zf mnemonics as aliases for the
      asm parser, resolving to the generic conditional patterns.
      
      llvm-svn: 184725
      fedd5a75
    • Ulrich Weigand's avatar
      · b6a30d15
      Ulrich Weigand authored
      [PowerPC] Support absolute branches
      
      There is currently only limited support for the "absolute" variants
      of branch instructions.  This patch adds support for the absolute
      variants of all branches that are currently otherwise supported.
      
      This requires adding new fixup types so that the correct variant
      of relocation type can be selected by the object writer.
      
      While the compiler will continue to usually choose the relative
      branch variants, this will allow the asm parser to fully support
      the absolute branches, with either immediate (numerical) or
      symbolic target addresses.
      
      No change in code generation intended.
      
      llvm-svn: 184721
      b6a30d15
    • Ulrich Weigand's avatar
      · 5b9d591a
      Ulrich Weigand authored
      [PowerPC] Support bd(n)zl and bd(n)zlrl
      
      This adds support for the bd(n)zl and bd(n)zlrl instructions.
      The patterns are currently used for the asm parser only.
      
      llvm-svn: 184720
      5b9d591a
    • Ulrich Weigand's avatar
      · d20e91ed
      Ulrich Weigand authored
      [PowerPC] Support b(cond)l in the asm parser
      
      This patch adds support for the conditional variants of bl.
      The pattern is currently used by the asm parser only.
      
      llvm-svn: 184719
      d20e91ed
    • Ulrich Weigand's avatar
      · 1847bb81
      Ulrich Weigand authored
      [PowerPC] Support blrl and variants in the asm parser
      
      This patch adds support for blrl and its conditional variants.
      The patterns are (currently) used for the asm parser only.
      
      llvm-svn: 184718
      1847bb81
  2. Jun 20, 2013
    • Ulrich Weigand's avatar
      · 865a1efc
      Ulrich Weigand authored
      [PowerPC] Support compare mnemonics with implied CR0
      
      Just like for branch mnemonics (where support was recently added), the
      assembler is supposed to support extended mnemonics for the compare
      instructions where no condition register is specified explicitly
      (and CR0 is assumed implicitly).
      
      This patch adds support for those extended compare mnemonics.
      
      
      Index: llvm-head/test/MC/PowerPC/ppc64-encoding-ext.s
      ===================================================================
      --- llvm-head.orig/test/MC/PowerPC/ppc64-encoding-ext.s
      +++ llvm-head/test/MC/PowerPC/ppc64-encoding-ext.s
      @@ -449,21 +449,37 @@
       
       # CHECK: cmpdi 2, 3, 128                 # encoding: [0x2d,0x23,0x00,0x80]
                cmpdi 2, 3, 128
      +# CHECK: cmpdi 0, 3, 128                 # encoding: [0x2c,0x23,0x00,0x80]
      +         cmpdi 3, 128
       # CHECK: cmpd 2, 3, 4                    # encoding: [0x7d,0x23,0x20,0x00]
                cmpd 2, 3, 4
      +# CHECK: cmpd 0, 3, 4                    # encoding: [0x7c,0x23,0x20,0x00]
      +         cmpd 3, 4
       # CHECK: cmpldi 2, 3, 128                # encoding: [0x29,0x23,0x00,0x80]
                cmpldi 2, 3, 128
      +# CHECK: cmpldi 0, 3, 128                # encoding: [0x28,0x23,0x00,0x80]
      +         cmpldi 3, 128
       # CHECK: cmpld 2, 3, 4                   # encoding: [0x7d,0x23,0x20,0x40]
                cmpld 2, 3, 4
      +# CHECK: cmpld 0, 3, 4                   # encoding: [0x7c,0x23,0x20,0x40]
      +         cmpld 3, 4
       
       # CHECK: cmpwi 2, 3, 128                 # encoding: [0x2d,0x03,0x00,0x80]
                cmpwi 2, 3, 128
      +# CHECK: cmpwi 0, 3, 128                 # encoding: [0x2c,0x03,0x00,0x80]
      +         cmpwi 3, 128
       # CHECK: cmpw 2, 3, 4                    # encoding: [0x7d,0x03,0x20,0x00]
                cmpw 2, 3, 4
      +# CHECK: cmpw 0, 3, 4                    # encoding: [0x7c,0x03,0x20,0x00]
      +         cmpw 3, 4
       # CHECK: cmplwi 2, 3, 128                # encoding: [0x29,0x03,0x00,0x80]
                cmplwi 2, 3, 128
      +# CHECK: cmplwi 0, 3, 128                # encoding: [0x28,0x03,0x00,0x80]
      +         cmplwi 3, 128
       # CHECK: cmplw 2, 3, 4                   # encoding: [0x7d,0x03,0x20,0x40]
                cmplw 2, 3, 4
      +# CHECK: cmplw 0, 3, 4                   # encoding: [0x7c,0x03,0x20,0x40]
      +         cmplw 3, 4
       
       # FIXME: Trap mnemonics
       
      Index: llvm-head/lib/Target/PowerPC/PPCInstrInfo.td
      ===================================================================
      --- llvm-head.orig/lib/Target/PowerPC/PPCInstrInfo.td
      +++ llvm-head/lib/Target/PowerPC/PPCInstrInfo.td
      @@ -2201,3 +2201,12 @@ defm : BranchExtendedMnemonic<"ne", 68>;
       defm : BranchExtendedMnemonic<"nu", 100>;
       defm : BranchExtendedMnemonic<"ns", 100>;
       
      +def : InstAlias<"cmpwi $rA, $imm", (CMPWI CR0, gprc:$rA, s16imm:$imm)>;
      +def : InstAlias<"cmpw $rA, $rB", (CMPW CR0, gprc:$rA, gprc:$rB)>;
      +def : InstAlias<"cmplwi $rA, $imm", (CMPLWI CR0, gprc:$rA, u16imm:$imm)>;
      +def : InstAlias<"cmplw $rA, $rB", (CMPLW CR0, gprc:$rA, gprc:$rB)>;
      +def : InstAlias<"cmpdi $rA, $imm", (CMPDI CR0, g8rc:$rA, s16imm:$imm)>;
      +def : InstAlias<"cmpd $rA, $rB", (CMPD CR0, g8rc:$rA, g8rc:$rB)>;
      +def : InstAlias<"cmpldi $rA, $imm", (CMPLDI CR0, g8rc:$rA, u16imm:$imm)>;
      +def : InstAlias<"cmpld $rA, $rB", (CMPLD CR0, g8rc:$rA, g8rc:$rB)>;
      +
      
      llvm-svn: 184435
      865a1efc
  3. Jun 10, 2013
    • Ulrich Weigand's avatar
      · aa4a2d71
      Ulrich Weigand authored
      [PowerPC] Support branch mnemonics with implied CR0
      
      The extended branch mnemonics are supposed to use an implied CR0
      if there is no explicit condition register specified.  This patch
      adds extra variants of the mnemonics to this effect.
      
      Problem reported by Joerg Sonnenberger.
      
      llvm-svn: 183686
      aa4a2d71
  4. May 03, 2013
    • Ulrich Weigand's avatar
      · d839490f
      Ulrich Weigand authored
      [PowerPC] Support extended mnemonics in AsmParser
      
      This patch adds infrastructure to support extended mnemonics in the
      PowerPC assembler parser.  It adds support specifically for those
      extended mnemonics that LLVM will itself generate.
      
      The test case lists *all* extended mnemonics according to the
      PowerPC ISA v2.06 Book I, but marks those not yet supported
      as FIXME.
      
      llvm-svn: 181051
      d839490f
Loading