]> granicus.if.org Git - clang/commitdiff
Add additional Hi/Lo registers to Clang MipsTargetInfoBase
authorHrvoje Varga <Hrvoje.Varga@imgtec.com>
Tue, 29 Mar 2016 12:46:16 +0000 (12:46 +0000)
committerHrvoje Varga <Hrvoje.Varga@imgtec.com>
Tue, 29 Mar 2016 12:46:16 +0000 (12:46 +0000)
Differential Revision: http://reviews.llvm.org/D17378

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264727 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp
test/CodeGen/mips-inline-asm.c

index 95c9a6e56ee284eaab22838a8250ee848c7e8d76..f6bb8a5b0e16fca66d5d94fcd30ef1399f401fca 100644 (file)
@@ -6899,7 +6899,8 @@ public:
       "$f24", "$f25", "$f26", "$f27", "$f28", "$f29", "$f30", "$f31",
       // Hi/lo and condition register names
       "hi",   "lo",   "",     "$fcc0","$fcc1","$fcc2","$fcc3","$fcc4",
-      "$fcc5","$fcc6","$fcc7",
+      "$fcc5","$fcc6","$fcc7","$ac1hi","$ac1lo","$ac2hi","$ac2lo",
+      "$ac3hi","$ac3lo",
       // MSA register names
       "$w0",  "$w1",  "$w2",  "$w3",  "$w4",  "$w5",  "$w6",  "$w7",
       "$w8",  "$w9",  "$w10", "$w11", "$w12", "$w13", "$w14", "$w15",
index 2cfa41c98de735b16ecee2fd2cf4a18d8f770532..fa38663f387df3a8d7f981b0514324a6a5ad89a4 100644 (file)
@@ -17,3 +17,15 @@ void R () {
   asm("lw $1, %0" :: "R"(data));
   // CHECK: call void asm sideeffect "lw $$1, $0", "*R,~{$1}"(i32* @data)
 }
+
+int additionalClobberedRegisters () {
+  int temp0;
+  asm volatile(
+                "mfhi %[temp0], $ac1 \n\t"
+                  : [temp0]"=&r"(temp0)
+                  :
+                  : "memory", "t0", "t1", "$ac1hi", "$ac1lo", "$ac2hi", "$ac2lo", "$ac3hi", "$ac3lo"
+  );
+  return 0;
+  // CHECK: call i32 asm sideeffect "mfhi $0, $$ac1 \0A\09", "=&r,~{memory},~{$8},~{$9},~{$ac1hi},~{$ac1lo},~{$ac2hi},~{$ac2lo},~{$ac3hi},~{$ac3lo},~{$1}"
+}