[llvm] r204714 - [mips] '.set at=$0' should be equivalent to '.set noat'

Daniel Sanders daniel.sanders at imgtec.com
Tue Mar 25 06:01:07 PDT 2014


Author: dsanders
Date: Tue Mar 25 08:01:06 2014
New Revision: 204714

URL: http://llvm.org/viewvc/llvm-project?rev=204714&view=rev
Log:
[mips] '.set at=$0' should be equivalent to '.set noat'

Differential Revision: http://llvm-reviews.chandlerc.com/D3171

Modified:
    llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
    llvm/trunk/test/MC/Mips/mips-noat.s
    llvm/trunk/test/MC/Mips/set-at-directive-explicit-at.s

Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=204714&r1=204713&r2=204714&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Tue Mar 25 08:01:06 2014
@@ -2352,7 +2352,7 @@ bool MipsAsmParser::parseSetAtDirective(
       return false;
     }
 
-    if (AtRegNo < 1 || AtRegNo > 31) {
+    if (AtRegNo < 0 || AtRegNo > 31) {
       reportParseError("unexpected token in statement");
       return false;
     }

Modified: llvm/trunk/test/MC/Mips/mips-noat.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips-noat.s?rev=204714&r1=204713&r2=204714&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips-noat.s (original)
+++ llvm/trunk/test/MC/Mips/mips-noat.s Tue Mar 25 08:01:06 2014
@@ -1,7 +1,8 @@
 # RUN: not llvm-mc %s -triple=mips-unknown-linux 2>%t0 | FileCheck %s
 # RUN: FileCheck -check-prefix=ERROR %s < %t0
+# Check that using the assembler temporary when .set noat is in effect is an error.
 
-# We start with $at enabled
+# We start with the assembler temporary enabled
 # CHECK-LABEL: test1:
 # CHECK:  lui   $1, 1
 # CHECK:  addu  $1, $1, $2
@@ -9,10 +10,8 @@
 test1:
         lw      $2, 65536($2)
 
-# Check that using $at when .set noat is in effect is an error.
 # FIXME: It would be better if the error pointed at the mnemonic instead of the newline
-# ERROR: mips-noat.s:[[@LINE+5]]:1: error: Pseudo instruction requires $at, which is not available
-# ERROR-NOT: error
+# ERROR: mips-noat.s:[[@LINE+4]]:1: error: Pseudo instruction requires $at, which is not available
 test2:
         .set noat
         lw      $2, 65536($2)
@@ -25,3 +24,11 @@ test2:
 test3:
         .set at
         lw      $2, 65536($2)
+
+# FIXME: It would be better if the error pointed at the mnemonic instead of the newline
+# ERROR: mips-noat.s:[[@LINE+4]]:1: error: Pseudo instruction requires $at, which is not available
+test4:
+        .set at=$0
+        lw      $2, 65536($2)
+
+# ERROR-NOT: error

Modified: llvm/trunk/test/MC/Mips/set-at-directive-explicit-at.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/set-at-directive-explicit-at.s?rev=204714&r1=204713&r2=204714&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/set-at-directive-explicit-at.s (original)
+++ llvm/trunk/test/MC/Mips/set-at-directive-explicit-at.s Tue Mar 25 08:01:06 2014
@@ -26,6 +26,9 @@ foo:
 # CHECK:   jr    $1                      # encoding: [0x08,0x00,0x20,0x00]
     .set noat
     jr    $at
+# CHECK:   jr    $1                      # encoding: [0x08,0x00,0x20,0x00]
+    .set at=$0
+    jr    $at
 
 # CHECK:   jr    $16                     # encoding: [0x08,0x00,0x00,0x02]
 # WARNINGS: :[[@LINE+2]]:12: warning: Used $16 with ".set at=$16"





More information about the llvm-commits mailing list