[PATCH] D24607: [mips] seq macro support

Vasileios Kalintiris via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 19 06:13:48 PDT 2016


vkalintiris requested changes to this revision.
vkalintiris added a comment.

We generate different code from the GNU assembler which in some cases is wrong, see inline comment.



================
Comment at: lib/Target/Mips/AsmParser/MipsAsmParser.cpp:3862-3878
+  if (!isUInt<16>(Imm)) {
+    unsigned ATReg = getATReg(IDLoc);
+    if (!ATReg)
+      return true;
+
+    if (Imm < 0) {
+      Imm = -Imm;
----------------
The constants manipulation here looks problematic, eg:

  seq     $4, $5, -66666

With gas:

  lui     at,0xfffe
  ori     at,at,0xfb96
  xor     a0,a1,at
  sltiu   a0,a0,1

With llvm-mc:

  addiu   $4, $5, 1130
  sltiu   $4, $4, 1

Similarly for:

  seq     $4, $5, -2147483648

gas:

  lui     at,0x8000
  xor     a0,a1,at 
  sltiu   a0,a0,1

llvm-mc:

  addiu   $4, $5, 0
  sltiu   $4, $4, 1

Also, on 64-bit we should generate a daddiu instead of an addiu according to the gas testsuite in binutils.


https://reviews.llvm.org/D24607





More information about the llvm-commits mailing list