llvm-project/llvm/test/MC/Mips/mips64r6
Simon Atanasyan d4d892ff9f [mips] Accept 32-bit offsets for lb and lbu commands
`lb` and `lbu` commands accepts 16-bit signed offsets. But GAS accepts
larger offsets for these commands. If an offset does not fit in 16-bit
range, `lb` command is translated into lui/lb or lui/addu/lb series.
It's interesting that initially LLVM assembler supported this feature,
but later it was broken.

This patch restores support for 32-bit offsets. It replaces `mem_simm16`
operand for `LB` and `LBu` definitions by the new `mem_simmptr` operand.
This operand is intended to check that offset fits to the same size as
using for pointers. Later we will be able to extend this rule and
accepts 64-bit offsets when it is possible.

Some issues remain:
- The regression also affects LD, SD, LH, LHU commands. I'm going
  to fix them by a separate patch.

- GAS accepts any 32-bit values as an offset. Now LLVM accepts signed
  16-bit values and this patch extends the range to signed 32-bit offsets.
  In other words, the following code accepted by GAS and still triggers
  an error by LLVM:
```
  lb      $4, 0x80000004

  # gas
  lui     a0, 0x8000
    lb      a0, 4(a0)
```

- In case of 64-bit pointers GAS accepts a 64-bit offset and translates
  it to the li/dsll/lb series of commands. LLVM still rejects it.
  Probably this feature has never been implemented in LLVM. This issue
  is for a separate patch.
```
  lb      $4, 0x800000001

  # gas
  li      a0, 0x8000
  dsll    a0, a0, 0x14
  lb      a0, 4(a0)
```

Differential Revision: https://reviews.llvm.org/D45020

llvm-svn: 330983
2018-04-26 19:55:28 +00:00
..
invalid-mips1-wrong-error.s [mips] Correct the predicates of the load/store (double)word for coprocessor 3. 2018-04-12 14:41:38 +00:00
invalid-mips1.s
invalid-mips2.s
invalid-mips3-wrong-error.s [AArch64][SVE] Re-submit patch series for ZIP1/ZIP2 2017-12-20 11:02:42 +00:00
invalid-mips3.s
invalid-mips4-wrong-error.s
invalid-mips4.s
invalid-mips5-wrong-error.s
invalid-mips5.s
invalid-mips32-wrong-error.s
invalid-mips64.s
invalid.s [mips] Accept 32-bit offsets for lb and lbu commands 2018-04-26 19:55:28 +00:00
relocations.s [mips][microMIPS] add lapc instruction 2017-09-11 18:34:04 +00:00
valid.s [mips] Fix the definition of sync, synci 2018-04-25 10:19:22 +00:00