For the record, gcc does use $at for code generation, take a look at mips_print_operand for the @ symbol and then look at all of the cases it's being used.<br><div><br></div><div>This is a pretty weird hack, I think you could instead just look for uses of $at or macro instructions (unless that other patch recently just set nomacro for inline assembly).</div><div><br></div><div>-eric</div><br><div class="gmail_quote">On Thu Dec 18 2014 at 8:06:36 AM Toma Tabacu <<a href="mailto:toma.tabacu@imgtec.com">toma.tabacu@imgtec.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Removed FIXME, as suggested in the review.<br>
<br>
<br>
<a href="http://reviews.llvm.org/D6638" target="_blank">http://reviews.llvm.org/D6638</a><br>
<br>
Files:<br>
lib/Basic/Targets.cpp<br>
test/CodeGen/mips-constraint-<u></u>regs.c<br>
test/CodeGen/mips-constraints-<u></u>mem.c<br>
test/CodeGen/mips-inline-asm-<u></u>modifiers.c<br>
test/CodeGen/mult-alt-generic.<u></u>c<br>
<br>
Index: lib/Basic/Targets.cpp<br>
==============================<u></u>==============================<u></u>=======<br>
--- lib/Basic/Targets.cpp<br>
+++ lib/Basic/Targets.cpp<br>
@@ -5749,8 +5749,7 @@<br>
}<br>
<br>
const char *getClobbers() const override {<br>
- // FIXME: Implement!<br>
- return "";<br>
+ return "~{$1}";<br>
}<br>
<br>
bool handleTargetFeatures(std::<u></u>vector<std::string> &Features,<br>
Index: test/CodeGen/mips-constraint-<u></u>regs.c<br>
==============================<u></u>==============================<u></u>=======<br>
--- test/CodeGen/mips-constraint-<u></u>regs.c<br>
+++ test/CodeGen/mips-constraint-<u></u>regs.c<br>
@@ -9,7 +9,7 @@<br>
// 'c': 16 bit address register for Mips16, GPR for all others<br>
// I am using 'c' to constrain both the target and one of the source<br>
// registers. We are looking for syntactical correctness.<br>
- // CHECK: %{{[0-9]+}} = call i32 asm sideeffect "addi $0,$1,$2 \0A\09\09", "=c,c,I"(i32 %{{[0-9]+}}, i32 %{{[0-9]+}}) [[NUW:#[0-9]+]], !srcloc !{{[0-9]+}}<br>
+ // CHECK: %{{[0-9]+}} = call i32 asm sideeffect "addi $0,$1,$2 \0A\09\09", "=c,c,I,~{$1}"(i32 %{{[0-9]+}}, i32 %{{[0-9]+}}) [[NUW:#[0-9]+]], !srcloc !{{[0-9]+}}<br>
int __s, __v = 17;<br>
int __t;<br>
__asm__ __volatile__(<br>
@@ -20,7 +20,7 @@<br>
// 'l': lo register<br>
// We are making it clear that destination register is lo with the<br>
// use of the 'l' constraint ("=l").<br>
- // CHECK: %{{[0-9]+}} = call i32 asm sideeffect "mtlo $1 \0A\09\09", "=l,r,~{lo}"(i32 %{{[0-9]+}}) [[NUW]], !srcloc !{{[0-9]+}}<br>
+ // CHECK: %{{[0-9]+}} = call i32 asm sideeffect "mtlo $1 \0A\09\09", "=l,r,~{lo},~{$1}"(i32 %{{[0-9]+}}) [[NUW]], !srcloc !{{[0-9]+}}<br>
int i_temp = 44;<br>
int i_result;<br>
__asm__ __volatile__(<br>
@@ -32,7 +32,7 @@<br>
// 'x': Combined lo/hi registers<br>
// We are specifying that destination registers are the hi/lo pair with the<br>
// use of the 'x' constraint ("=x").<br>
- // CHECK: %{{[0-9]+}} = call i64 asm sideeffect "mthi $1 \0A\09\09mtlo $2 \0A\09\09", "=x,r,r"(i32 %{{[0-9]+}}, i32 %{{[0-9]+}}) [[NUW]], !srcloc !{{[0-9]+}}<br>
+ // CHECK: %{{[0-9]+}} = call i64 asm sideeffect "mthi $1 \0A\09\09mtlo $2 \0A\09\09", "=x,r,r,~{$1}"(i32 %{{[0-9]+}}, i32 %{{[0-9]+}}) [[NUW]], !srcloc !{{[0-9]+}}<br>
int i_hi = 3;<br>
int i_lo = 2;<br>
long long ll_result = 0;<br>
Index: test/CodeGen/mips-constraints-<u></u>mem.c<br>
==============================<u></u>==============================<u></u>=======<br>
--- test/CodeGen/mips-constraints-<u></u>mem.c<br>
+++ test/CodeGen/mips-constraints-<u></u>mem.c<br>
@@ -9,7 +9,7 @@<br>
// 'R': An address that can be used in a non-macro load or stor'<br>
// This test will result in the higher and lower nibbles being<br>
// switched due to the lwl/lwr instruction pairs.<br>
- // CHECK: %{{[0-9]+}} = call i32 asm sideeffect "lwl $0, 1 + $1\0A\09lwr $0, 2 + $1\0A\09", "=r,*R"(i32* %{{[0-9,a-f]+}}) #1,<br>
+ // CHECK: %{{[0-9]+}} = call i32 asm sideeffect "lwl $0, 1 + $1\0A\09lwr $0, 2 + $1\0A\09", "=r,*R,~{$1}"(i32* %{{[0-9,a-f]+}}) #1,<br>
<br>
int c = 0xffbbccdd;<br>
<br>
Index: test/CodeGen/mips-inline-asm-<u></u>modifiers.c<br>
==============================<u></u>==============================<u></u>=======<br>
--- test/CodeGen/mips-inline-asm-<u></u>modifiers.c<br>
+++ test/CodeGen/mips-inline-asm-<u></u>modifiers.c<br>
@@ -7,9 +7,9 @@<br>
<br>
typedef int v4i32 __attribute__((vector_size(16)<u></u>));<br>
<br>
- // CHECK: %{{[0-9]+}} = call i32 asm ".set noreorder;\0Alw $0,$1;\0A.set reorder;\0A", "=r,*m"(i32* getelementptr inbounds ([8 x i32]* @b, i32 {{[0-9]+}}, i32 {{[0-9]+}})) #2,<br>
- // CHECK: %{{[0-9]+}} = call i32 asm "lw $0,${1:D};\0A", "=r,*m"(i32* getelementptr inbounds ([8 x i32]* @b, i32 {{[0-9]+}}, i32 {{[0-9]+}})) #2,<br>
- // CHECK: %{{[0-9]+}} = call <4 x i32> asm "ldi.w ${0:w},1", "=f"<br>
+ // CHECK: %{{[0-9]+}} = call i32 asm ".set noreorder;\0Alw $0,$1;\0A.set reorder;\0A", "=r,*m,~{$1}"(i32* getelementptr inbounds ([8 x i32]* @b, i32 {{[0-9]+}}, i32 {{[0-9]+}})) #2,<br>
+ // CHECK: %{{[0-9]+}} = call i32 asm "lw $0,${1:D};\0A", "=r,*m,~{$1}"(i32* getelementptr inbounds ([8 x i32]* @b, i32 {{[0-9]+}}, i32 {{[0-9]+}})) #2,<br>
+ // CHECK: %{{[0-9]+}} = call <4 x i32> asm "ldi.w ${0:w},1", "=f,~{$1}"<br>
int b[8] = {0,1,2,3,4,5,6,7};<br>
int main()<br>
{<br>
Index: test/CodeGen/mult-alt-generic.<u></u>c<br>
==============================<u></u>==============================<u></u>=======<br>
--- test/CodeGen/mult-alt-generic.<u></u>c<br>
+++ test/CodeGen/mult-alt-generic.<u></u>c<br>
@@ -17,7 +17,7 @@<br>
// CHECK: @single_m<br>
void single_m()<br>
{<br>
- // CHECK: call void asm "foo $1,$0", "=*m,*m[[CLOBBERS:[a-zA-Z0-9@%<u></u>{},~_ ]*\"]](i32* {{[a-zA-Z0-9@%]+}}, i32* {{[a-zA-Z0-9@%]+}})<br>
+ // CHECK: call void asm "foo $1,$0", "=*m,*m[[CLOBBERS:[a-zA-Z0-9@%<u></u>{},~_$ ]*\"]](i32* {{[a-zA-Z0-9@%]+}}, i32* {{[a-zA-Z0-9@%]+}})<br>
asm("foo %1,%0" : "=m" (mout0) : "m" (min1));<br>
}<br>
<br>
EMAIL PREFERENCES<br>
<a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/<u></u>settings/panel/<u></u>emailpreferences/</a><br>
______________________________<u></u>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-commits</a><br>
</blockquote></div>