• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llvm-mc %s -triple=mipsel -show-encoding -mattr=micromips | FileCheck %s
2# Check that the assembler can handle the documented syntax
3# for arithmetic and logical instructions.
4#------------------------------------------------------------------------------
5# Arithmetic and Logical Instructions
6#------------------------------------------------------------------------------
7# CHECK: add   $9, $6, $7      # encoding: [0x10,0x49,0xe6,0x00]
8# CHECK: addi  $9, $6, 17767   # encoding: [0x67,0x45,0x26,0x11]
9# CHECK: addiu $9, $6, -15001  # encoding: [0x67,0xc5,0x26,0x31]
10# CHECK: addi  $9, $6, 17767   # encoding: [0x67,0x45,0x26,0x11]
11# CHECK: addiu $9, $6, -15001  # encoding: [0x67,0xc5,0x26,0x31]
12# CHECK: addu  $9, $6, $7      # encoding: [0x50,0x49,0xe6,0x00]
13# CHECK: sub   $9, $6, $7      # encoding: [0x90,0x49,0xe6,0x00]
14# CHECK: subu  $4, $3, $5      # encoding: [0xd0,0x21,0xa3,0x00]
15# CHECK: neg   $6, $7          # encoding: [0x90,0x31,0xe0,0x00]
16# CHECK: negu  $6, $7          # encoding: [0xd0,0x31,0xe0,0x00]
17# CHECK: move  $7, $8          # encoding: [0x50,0x39,0x08,0x00]
18# CHECK: slt    $3, $3, $5     # encoding: [0x50,0x1b,0xa3,0x00]
19# CHECK: slti   $3, $3, 103    # encoding: [0x67,0x00,0x63,0x90]
20# CHECK: slti   $3, $3, 103    # encoding: [0x67,0x00,0x63,0x90]
21# CHECK: sltiu  $3, $3, 103    # encoding: [0x67,0x00,0x63,0xb0]
22# CHECK: sltu   $3, $3, $5     # encoding: [0x90,0x1b,0xa3,0x00]
23# CHECK: and    $9, $6, $7     # encoding: [0x50,0x4a,0xe6,0x00]
24# CHECK: andi   $9, $6, 17767  # encoding: [0x67,0x45,0x26,0xd1]
25# CHECK: andi   $9, $6, 17767  # encoding: [0x67,0x45,0x26,0xd1]
26# CHECK: or     $3, $4, $5     # encoding: [0x90,0x1a,0xa4,0x00]
27# CHECK: ori    $9, $6, 17767  # encoding: [0x67,0x45,0x26,0x51]
28# CHECK: xor    $3, $3, $5     # encoding: [0x10,0x1b,0xa3,0x00]
29# CHECK: xori   $9, $6, 17767  # encoding: [0x67,0x45,0x26,0x71]
30# CHECK: xori   $9, $6, 17767  # encoding: [0x67,0x45,0x26,0x71]
31# CHECK: nor    $9, $6, $7     # encoding: [0xd0,0x4a,0xe6,0x00]
32# CHECK: not    $7, $8         # encoding: [0xd0,0x3a,0x08,0x00]
33# CHECK: mul    $9, $6, $7     # encoding: [0x10,0x4a,0xe6,0x00]
34# CHECK: mult   $9, $7         # encoding: [0x3c,0x8b,0xe9,0x00]
35# CHECK: multu  $9, $7         # encoding: [0x3c,0x9b,0xe9,0x00]
36    add    $9, $6, $7
37    add    $9, $6, 17767
38    addu   $9, $6, -15001
39    addi   $9, $6, 17767
40    addiu  $9, $6,-15001
41    addu   $9, $6, $7
42    sub    $9, $6, $7
43    subu   $4, $3, $5
44    neg    $6, $7
45    negu   $6, $7
46    move   $7, $8
47    slt    $3, $3, $5
48    slt    $3, $3, 103
49    slti   $3, $3, 103
50    sltiu  $3, $3, 103
51    sltu   $3, $3, $5
52    and    $9, $6, $7
53    and    $9, $6, 17767
54    andi   $9, $6, 17767
55    or     $3, $4, $5
56    ori    $9, $6, 17767
57    xor    $3, $3, $5
58    xor    $9, $6, 17767
59    xori   $9, $6, 17767
60    nor    $9, $6, $7
61    nor    $7, $8, $zero
62    mul    $9, $6, $7
63    mult   $9, $7
64    multu  $9, $7
65