osaca_version: 0.3.7
isa: "AArch64"
# Contains all operand-irregular instruction forms OSACA supports for AArch64.
# Operand-regular for a AArch64 instruction form with N operands in the shape of
#   mnemonic op1 ... opN
# means that op1 is the only destination operand and op2 to op(N) are source operands.
instruction_forms:
    - name: [add, adds]
      operands:
      - class: register
        prefix: x
        source: false
        destination: true
      - class: register
        prefix: x
        source: true
        destination: false
      - class: immediate
        imd: 'int'
        source: true
        destination: false
      operation: "op1['value'] = op2['value'] + op3['value']; op1['name'] = op2['name']"
    - name: [sub, subs]
      operands:
      - class: register
        prefix: x
        source: false
        destination: true
      - class: register
        prefix: x
        source: true
        destination: false
      - class: immediate
        imd: 'int'
        source: true
        destination: false
      operation: "op1['value'] = op2['value'] - op3['value']; op1['name'] = op2['name']"
    - name: [b, bcc, bcs, b.ne, b.any, b.none, b.lt, b.eq, b.hs, b.gt, bne, beq]
      operands:
      - class: identifier
        source: false
        destination: false
    - name: [incb, incd]
      operands:
      - class: register
        prefix: x
        source: true
        destination: true
    - name: [incb, incd]
      operands:
      - class: register
        prefix: x
        source: true
        destination: true
      - class: identifier
        source: false 
        destination: false
      - class: identifier
        source: false 
        destination: false
      - class: immediate
        imd: int
        source: false 
        destination: false
    - name: fmla
      operands:
      - class: register
        prefix: "*"
        shape: "*"
        source: true
        destination: true
      - class: register
        prefix: "*"
        shape: "*"
        source: true
        destination: false
      - class: register
        prefix: "*"
        shape: "*"
        source: true
        destination: false
      - class: register
        prefix: "*"
        shape: "*"
        source: true
        destination: false
    - name: fmla
      operands:
        - class: register
          prefix: "*"
          shape: "*"
          source: true
          destination: true
        - class: register
          prefix: "*"
          shape: "*"
          source: true
          destination: false
        - class: register
          prefix: "*"
          shape: "*"
          source: true
          destination: false
    - name: ldp
      operands:
        - class: register
          prefix: "*"
          source: false
          destination: true
        - class: register
          prefix: "*"
          source: false
          destination: true
        - class: memory
          base: "*"
          offset: "*"
          index: "*"
          scale: "*"
          pre-indexed: "*"
          post-indexed: "*"
          source: true
          destination: false
    - name: [ldr, ldur, ldrb, ldrh, ldrsb, ldrsh, ldrsw]
      operands:
        - class: register
          prefix: "*"
          source: false
          destination: true
        - class: memory
          base: "*"
          offset: "*"
          index: "*"
          scale: "*"
          pre-indexed: "*"
          post-indexed: "*"
          source: true
          destination: false
    - name: mov
      operands:
      - class: register
        prefix: x
        source: false
        destination: true
      - class: register
        prefix: x
        source: true
        destination: false
      operation: "op1['name'] = op2['name']; op1['value'] = op2['value']"
    - name: stp
      operands:
        - class: register
          prefix: "*"
          source: true
          destination: false
        - class: register
          prefix: "*"
          source: true
          destination: false
        - class: memory
          base: "*"
          offset: "*"
          index: "*"
          scale: "*"
          pre-indexed: "*"
          post-indexed: "*"
          source: false
          destination: true
    - name: [str, stur]
      operands:
        - class: register
          prefix: "*"
          source: true
          destination: false
        - class: memory
          base: "*"
          offset: "*"
          index: "*"
          scale: "*"
          pre-indexed: "*"
          post-indexed: "*"
          source: false
          destination: true
    - name: cmp
      operands:
        - class: register
          prefix: "*"
          source: true
          destination: false
        - class: register
          prefix: "*"
          source: true
          destination: false
    - name: cmp
      operands:
        - class: register
          prefix: "*"
          source: true
          destination: false
        - class: immediate
          imd: "int"
          source: true
          destination: false
    - name: cmn
      operands:
        - class: register
          prefix: "*"
          source: true
          destination: false
        - class: register
          prefix: "*"
          source: true
          destination: false
    - name: cmn
      operands:
        - class: register
          prefix: "*"
          source: true
          destination: false
        - class: immediate
          imd: "int"
          source: true
          destination: false
    - name: fcmp
      operands:
        - class: register
          prefix: "*"
          source: true
          destination: false
        - class: register
          prefix: "*"
          source: true
          destination: false
    - name: fcmp
      operands:
        - class: register
          prefix: "*"
          source: true
          destination: false
        - class: immediate
          imd: double
          source: true
          destination: false
    - name: fcmp
      operands:
        - class: register
          prefix: "*"
          source: true
          destination: false
        - class: immediate
          imd: float
          source: true
          destination: false
