[llvm] r270995 - [mips] Weaken asm predicate for memory offsets
Simon Dardis via llvm-commits
llvm-commits at lists.llvm.org
Fri May 27 06:56:50 PDT 2016
Author: sdardis
Date: Fri May 27 08:56:36 2016
New Revision: 270995
URL: http://llvm.org/viewvc/llvm-project?rev=270995&view=rev
Log:
[mips] Weaken asm predicate for memory offsets
The isMemWithSimmOffset predicate rejects relocations which is incorrect
behaviour. Linkers and other tools should handle|warn|error when the
field overflows.
Reviewers: dsanders, vkalintiris
Differential Revision: http://reviews.llvm.org/D20727
Modified:
llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
llvm/trunk/test/MC/Mips/mips1/valid.s
llvm/trunk/test/MC/Mips/mips2/valid.s
llvm/trunk/test/MC/Mips/mips3/valid.s
llvm/trunk/test/MC/Mips/mips32/valid.s
llvm/trunk/test/MC/Mips/mips32r2/valid.s
llvm/trunk/test/MC/Mips/mips32r3/valid.s
llvm/trunk/test/MC/Mips/mips32r5/valid.s
llvm/trunk/test/MC/Mips/mips32r6/valid.s
llvm/trunk/test/MC/Mips/mips4/valid.s
llvm/trunk/test/MC/Mips/mips5/valid.s
llvm/trunk/test/MC/Mips/mips64/valid.s
llvm/trunk/test/MC/Mips/mips64r2/valid.s
llvm/trunk/test/MC/Mips/mips64r3/valid.s
llvm/trunk/test/MC/Mips/mips64r5/valid.s
llvm/trunk/test/MC/Mips/mips64r6/valid.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=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Fri May 27 08:56:36 2016
@@ -1073,11 +1073,15 @@ public:
bool isConstantMemOff() const {
return isMem() && isa<MCConstantExpr>(getMemOff());
}
+ // Allow relocation operators.
+ // FIXME: This predicate and others need to look through binary expressions
+ // and determine whether a Value is a constant or not.
template <unsigned Bits, unsigned ShiftAmount = 0>
bool isMemWithSimmOffset() const {
- return isMem() && isConstantMemOff() &&
- isShiftedInt<Bits, ShiftAmount>(getConstantMemOff()) &&
- getMemBase()->isGPRAsmReg();
+ return isMem() && getMemBase()->isGPRAsmReg() &&
+ (isa<MCTargetExpr>(getMemOff()) ||
+ (isConstantMemOff() &&
+ isShiftedInt<Bits, ShiftAmount>(getConstantMemOff())));
}
bool isMemWithGRPMM16Base() const {
return isMem() && getMemBase()->isMM16AsmReg();
Modified: llvm/trunk/test/MC/Mips/mips1/valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips1/valid.s?rev=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips1/valid.s (original)
+++ llvm/trunk/test/MC/Mips/mips1/valid.s Fri May 27 08:56:36 2016
@@ -152,3 +152,24 @@ a:
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
1:
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwl $3, %lo(g_8)($2) # CHECK: encoding: [0x88,0x43,A,A]
+ lwr $3, %lo(g_8)($2) # CHECK: encoding: [0x98,0x43,A,A]
+ swl $3, %lo(g_8)($2) # CHECK: encoding: [0xa8,0x43,A,A]
+ swr $3, %lo(g_8)($2) # CHECK: encoding: [0xb8,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ .type g_8, at object
+ .comm g_8,16,16
Modified: llvm/trunk/test/MC/Mips/mips2/valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips2/valid.s?rev=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips2/valid.s (original)
+++ llvm/trunk/test/MC/Mips/mips2/valid.s Fri May 27 08:56:36 2016
@@ -178,3 +178,27 @@ a:
xor $2, 4 # CHECK: xori $2, $2, 4 # encoding: [0x38,0x42,0x00,0x04]
1:
+
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwl $3, %lo(g_8)($2) # CHECK: encoding: [0x88,0x43,A,A]
+ lwr $3, %lo(g_8)($2) # CHECK: encoding: [0x98,0x43,A,A]
+ swl $3, %lo(g_8)($2) # CHECK: encoding: [0xa8,0x43,A,A]
+ swr $3, %lo(g_8)($2) # CHECK: encoding: [0xb8,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ ldc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xd4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ sdc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xf4,0x40,A,A]
+ .type g_8, at object
+ .comm g_8,16,16
Modified: llvm/trunk/test/MC/Mips/mips3/valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips3/valid.s?rev=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips3/valid.s (original)
+++ llvm/trunk/test/MC/Mips/mips3/valid.s Fri May 27 08:56:36 2016
@@ -244,3 +244,34 @@ a:
xor $2, 4 # CHECK: xori $2, $2, 4 # encoding: [0x38,0x42,0x00,0x04]
1:
+
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwl $3, %lo(g_8)($2) # CHECK: encoding: [0x88,0x43,A,A]
+ lwr $3, %lo(g_8)($2) # CHECK: encoding: [0x98,0x43,A,A]
+ swl $3, %lo(g_8)($2) # CHECK: encoding: [0xa8,0x43,A,A]
+ swr $3, %lo(g_8)($2) # CHECK: encoding: [0xb8,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ ldc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xd4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ sdc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xf4,0x40,A,A]
+ lwu $3, %lo(g_8)($2) # CHECK: encoding: [0x9c,0x43,A,A]
+ ld $3, %lo(g_8)($2) # CHECK: encoding: [0xdc,0x43,A,A]
+ sd $3, %lo(g_8)($2) # CHECK: encoding: [0xfc,0x43,A,A]
+ ldl $3, %lo(g_8)($2) # CHECK: encoding: [0x68,0x43,A,A]
+ ldr $3, %lo(g_8)($2) # CHECK: encoding: [0x6c,0x43,A,A]
+ sdl $3, %lo(g_8)($2) # CHECK: encoding: [0xb0,0x43,A,A]
+ sdr $3, %lo(g_8)($2) # CHECK: encoding: [0xb4,0x43,A,A]
+ .type g_8, at object
+ .comm g_8,16,16
Modified: llvm/trunk/test/MC/Mips/mips32/valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips32/valid.s?rev=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips32/valid.s (original)
+++ llvm/trunk/test/MC/Mips/mips32/valid.s Fri May 27 08:56:36 2016
@@ -208,3 +208,27 @@ a:
xor $2, 4 # CHECK: xori $2, $2, 4 # encoding: [0x38,0x42,0x00,0x04]
1:
+
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwl $3, %lo(g_8)($2) # CHECK: encoding: [0x88,0x43,A,A]
+ lwr $3, %lo(g_8)($2) # CHECK: encoding: [0x98,0x43,A,A]
+ swl $3, %lo(g_8)($2) # CHECK: encoding: [0xa8,0x43,A,A]
+ swr $3, %lo(g_8)($2) # CHECK: encoding: [0xb8,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ ldc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xd4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ sdc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xf4,0x40,A,A]
+ .type g_8, at object
+ .comm g_8,16,16
Modified: llvm/trunk/test/MC/Mips/mips32r2/valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips32r2/valid.s?rev=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips32r2/valid.s (original)
+++ llvm/trunk/test/MC/Mips/mips32r2/valid.s Fri May 27 08:56:36 2016
@@ -247,3 +247,27 @@ a:
synci -15842($a2) # CHECK: synci -15842($6) # encoding: [0x04,0xdf,0xc2,0x1e]
1:
+
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwl $3, %lo(g_8)($2) # CHECK: encoding: [0x88,0x43,A,A]
+ lwr $3, %lo(g_8)($2) # CHECK: encoding: [0x98,0x43,A,A]
+ swl $3, %lo(g_8)($2) # CHECK: encoding: [0xa8,0x43,A,A]
+ swr $3, %lo(g_8)($2) # CHECK: encoding: [0xb8,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ ldc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xd4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ sdc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xf4,0x40,A,A]
+ .type g_8, at object
+ .comm g_8,16,16
Modified: llvm/trunk/test/MC/Mips/mips32r3/valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips32r3/valid.s?rev=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips32r3/valid.s (original)
+++ llvm/trunk/test/MC/Mips/mips32r3/valid.s Fri May 27 08:56:36 2016
@@ -247,3 +247,27 @@ a:
synci -15842($a2) # CHECK: synci -15842($6) # encoding: [0x04,0xdf,0xc2,0x1e]
1:
+
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwl $3, %lo(g_8)($2) # CHECK: encoding: [0x88,0x43,A,A]
+ lwr $3, %lo(g_8)($2) # CHECK: encoding: [0x98,0x43,A,A]
+ swl $3, %lo(g_8)($2) # CHECK: encoding: [0xa8,0x43,A,A]
+ swr $3, %lo(g_8)($2) # CHECK: encoding: [0xb8,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ ldc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xd4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ sdc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xf4,0x40,A,A]
+ .type g_8, at object
+ .comm g_8,16,16
Modified: llvm/trunk/test/MC/Mips/mips32r5/valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips32r5/valid.s?rev=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips32r5/valid.s (original)
+++ llvm/trunk/test/MC/Mips/mips32r5/valid.s Fri May 27 08:56:36 2016
@@ -248,3 +248,27 @@ a:
synci -15842($a2) # CHECK: synci -15842($6) # encoding: [0x04,0xdf,0xc2,0x1e]
1:
+
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwl $3, %lo(g_8)($2) # CHECK: encoding: [0x88,0x43,A,A]
+ lwr $3, %lo(g_8)($2) # CHECK: encoding: [0x98,0x43,A,A]
+ swl $3, %lo(g_8)($2) # CHECK: encoding: [0xa8,0x43,A,A]
+ swr $3, %lo(g_8)($2) # CHECK: encoding: [0xb8,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ ldc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xd4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ sdc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xf4,0x40,A,A]
+ .type g_8, at object
+ .comm g_8,16,16
Modified: llvm/trunk/test/MC/Mips/mips32r6/valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips32r6/valid.s?rev=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips32r6/valid.s (original)
+++ llvm/trunk/test/MC/Mips/mips32r6/valid.s Fri May 27 08:56:36 2016
@@ -200,3 +200,22 @@ a:
xor $2, 4 # CHECK: xori $2, $2, 4 # encoding: [0x38,0x42,0x00,0x04]
1:
+
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ ldc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xd4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ sdc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xf4,0x40,A,A]
+ .type g_8, at object
+ .comm g_8,16,16
Modified: llvm/trunk/test/MC/Mips/mips4/valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips4/valid.s?rev=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips4/valid.s (original)
+++ llvm/trunk/test/MC/Mips/mips4/valid.s Fri May 27 08:56:36 2016
@@ -273,3 +273,34 @@ a:
xor $2, 4 # CHECK: xori $2, $2, 4 # encoding: [0x38,0x42,0x00,0x04]
1:
+
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwl $3, %lo(g_8)($2) # CHECK: encoding: [0x88,0x43,A,A]
+ lwr $3, %lo(g_8)($2) # CHECK: encoding: [0x98,0x43,A,A]
+ swl $3, %lo(g_8)($2) # CHECK: encoding: [0xa8,0x43,A,A]
+ swr $3, %lo(g_8)($2) # CHECK: encoding: [0xb8,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ ldc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xd4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ sdc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xf4,0x40,A,A]
+ lwu $3, %lo(g_8)($2) # CHECK: encoding: [0x9c,0x43,A,A]
+ ld $3, %lo(g_8)($2) # CHECK: encoding: [0xdc,0x43,A,A]
+ sd $3, %lo(g_8)($2) # CHECK: encoding: [0xfc,0x43,A,A]
+ ldl $3, %lo(g_8)($2) # CHECK: encoding: [0x68,0x43,A,A]
+ ldr $3, %lo(g_8)($2) # CHECK: encoding: [0x6c,0x43,A,A]
+ sdl $3, %lo(g_8)($2) # CHECK: encoding: [0xb0,0x43,A,A]
+ sdr $3, %lo(g_8)($2) # CHECK: encoding: [0xb4,0x43,A,A]
+ .type g_8, at object
+ .comm g_8,16,16
Modified: llvm/trunk/test/MC/Mips/mips5/valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips5/valid.s?rev=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips5/valid.s (original)
+++ llvm/trunk/test/MC/Mips/mips5/valid.s Fri May 27 08:56:36 2016
@@ -275,3 +275,34 @@ a:
xor $2, 4 # CHECK: xori $2, $2, 4 # encoding: [0x38,0x42,0x00,0x04]
1:
+
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwl $3, %lo(g_8)($2) # CHECK: encoding: [0x88,0x43,A,A]
+ lwr $3, %lo(g_8)($2) # CHECK: encoding: [0x98,0x43,A,A]
+ swl $3, %lo(g_8)($2) # CHECK: encoding: [0xa8,0x43,A,A]
+ swr $3, %lo(g_8)($2) # CHECK: encoding: [0xb8,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ ldc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xd4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ sdc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xf4,0x40,A,A]
+ lwu $3, %lo(g_8)($2) # CHECK: encoding: [0x9c,0x43,A,A]
+ ld $3, %lo(g_8)($2) # CHECK: encoding: [0xdc,0x43,A,A]
+ sd $3, %lo(g_8)($2) # CHECK: encoding: [0xfc,0x43,A,A]
+ ldl $3, %lo(g_8)($2) # CHECK: encoding: [0x68,0x43,A,A]
+ ldr $3, %lo(g_8)($2) # CHECK: encoding: [0x6c,0x43,A,A]
+ sdl $3, %lo(g_8)($2) # CHECK: encoding: [0xb0,0x43,A,A]
+ sdr $3, %lo(g_8)($2) # CHECK: encoding: [0xb4,0x43,A,A]
+ .type g_8, at object
+ .comm g_8,16,16
Modified: llvm/trunk/test/MC/Mips/mips64/valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips64/valid.s?rev=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips64/valid.s (original)
+++ llvm/trunk/test/MC/Mips/mips64/valid.s Fri May 27 08:56:36 2016
@@ -294,3 +294,34 @@ a:
xor $2, 4 # CHECK: xori $2, $2, 4 # encoding: [0x38,0x42,0x00,0x04]
1:
+
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwl $3, %lo(g_8)($2) # CHECK: encoding: [0x88,0x43,A,A]
+ lwr $3, %lo(g_8)($2) # CHECK: encoding: [0x98,0x43,A,A]
+ swl $3, %lo(g_8)($2) # CHECK: encoding: [0xa8,0x43,A,A]
+ swr $3, %lo(g_8)($2) # CHECK: encoding: [0xb8,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ ldc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xd4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ sdc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xf4,0x40,A,A]
+ lwu $3, %lo(g_8)($2) # CHECK: encoding: [0x9c,0x43,A,A]
+ ld $3, %lo(g_8)($2) # CHECK: encoding: [0xdc,0x43,A,A]
+ sd $3, %lo(g_8)($2) # CHECK: encoding: [0xfc,0x43,A,A]
+ ldl $3, %lo(g_8)($2) # CHECK: encoding: [0x68,0x43,A,A]
+ ldr $3, %lo(g_8)($2) # CHECK: encoding: [0x6c,0x43,A,A]
+ sdl $3, %lo(g_8)($2) # CHECK: encoding: [0xb0,0x43,A,A]
+ sdr $3, %lo(g_8)($2) # CHECK: encoding: [0xb4,0x43,A,A]
+ .type g_8, at object
+ .comm g_8,16,16
Modified: llvm/trunk/test/MC/Mips/mips64r2/valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips64r2/valid.s?rev=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips64r2/valid.s (original)
+++ llvm/trunk/test/MC/Mips/mips64r2/valid.s Fri May 27 08:56:36 2016
@@ -321,3 +321,35 @@ a:
wsbh $k1,$9
1:
+
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwl $3, %lo(g_8)($2) # CHECK: encoding: [0x88,0x43,A,A]
+ lwr $3, %lo(g_8)($2) # CHECK: encoding: [0x98,0x43,A,A]
+ swl $3, %lo(g_8)($2) # CHECK: encoding: [0xa8,0x43,A,A]
+ swr $3, %lo(g_8)($2) # CHECK: encoding: [0xb8,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ ldc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xd4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ sdc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xf4,0x40,A,A]
+
+ lwu $3, %lo(g_8)($2) # CHECK: encoding: [0x9c,0x43,A,A]
+ ld $3, %lo(g_8)($2) # CHECK: encoding: [0xdc,0x43,A,A]
+ sd $3, %lo(g_8)($2) # CHECK: encoding: [0xfc,0x43,A,A]
+ ldl $3, %lo(g_8)($2) # CHECK: encoding: [0x68,0x43,A,A]
+ ldr $3, %lo(g_8)($2) # CHECK: encoding: [0x6c,0x43,A,A]
+ sdl $3, %lo(g_8)($2) # CHECK: encoding: [0xb0,0x43,A,A]
+ sdr $3, %lo(g_8)($2) # CHECK: encoding: [0xb4,0x43,A,A]
+ .type g_8, at object
+ .comm g_8,16,16
Modified: llvm/trunk/test/MC/Mips/mips64r3/valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips64r3/valid.s?rev=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips64r3/valid.s (original)
+++ llvm/trunk/test/MC/Mips/mips64r3/valid.s Fri May 27 08:56:36 2016
@@ -321,3 +321,34 @@ a:
wsbh $k1,$9
1:
+
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwl $3, %lo(g_8)($2) # CHECK: encoding: [0x88,0x43,A,A]
+ lwr $3, %lo(g_8)($2) # CHECK: encoding: [0x98,0x43,A,A]
+ swl $3, %lo(g_8)($2) # CHECK: encoding: [0xa8,0x43,A,A]
+ swr $3, %lo(g_8)($2) # CHECK: encoding: [0xb8,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ ldc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xd4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ sdc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xf4,0x40,A,A]
+ lwu $3, %lo(g_8)($2) # CHECK: encoding: [0x9c,0x43,A,A]
+ ld $3, %lo(g_8)($2) # CHECK: encoding: [0xdc,0x43,A,A]
+ sd $3, %lo(g_8)($2) # CHECK: encoding: [0xfc,0x43,A,A]
+ ldl $3, %lo(g_8)($2) # CHECK: encoding: [0x68,0x43,A,A]
+ ldr $3, %lo(g_8)($2) # CHECK: encoding: [0x6c,0x43,A,A]
+ sdl $3, %lo(g_8)($2) # CHECK: encoding: [0xb0,0x43,A,A]
+ sdr $3, %lo(g_8)($2) # CHECK: encoding: [0xb4,0x43,A,A]
+ .type g_8, at object
+ .comm g_8,16,16
Modified: llvm/trunk/test/MC/Mips/mips64r5/valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips64r5/valid.s?rev=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips64r5/valid.s (original)
+++ llvm/trunk/test/MC/Mips/mips64r5/valid.s Fri May 27 08:56:36 2016
@@ -322,3 +322,34 @@ a:
wsbh $k1,$9
1:
+
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwl $3, %lo(g_8)($2) # CHECK: encoding: [0x88,0x43,A,A]
+ lwr $3, %lo(g_8)($2) # CHECK: encoding: [0x98,0x43,A,A]
+ swl $3, %lo(g_8)($2) # CHECK: encoding: [0xa8,0x43,A,A]
+ swr $3, %lo(g_8)($2) # CHECK: encoding: [0xb8,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ ldc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xd4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ sdc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xf4,0x40,A,A]
+ lwu $3, %lo(g_8)($2) # CHECK: encoding: [0x9c,0x43,A,A]
+ ld $3, %lo(g_8)($2) # CHECK: encoding: [0xdc,0x43,A,A]
+ sd $3, %lo(g_8)($2) # CHECK: encoding: [0xfc,0x43,A,A]
+ ldl $3, %lo(g_8)($2) # CHECK: encoding: [0x68,0x43,A,A]
+ ldr $3, %lo(g_8)($2) # CHECK: encoding: [0x6c,0x43,A,A]
+ sdl $3, %lo(g_8)($2) # CHECK: encoding: [0xb0,0x43,A,A]
+ sdr $3, %lo(g_8)($2) # CHECK: encoding: [0xb4,0x43,A,A]
+ .type g_8, at object
+ .comm g_8,16,16
Modified: llvm/trunk/test/MC/Mips/mips64r6/valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips64r6/valid.s?rev=270995&r1=270994&r2=270995&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips64r6/valid.s (original)
+++ llvm/trunk/test/MC/Mips/mips64r6/valid.s Fri May 27 08:56:36 2016
@@ -225,3 +225,25 @@ a:
xor $2, 4 # CHECK: xori $2, $2, 4 # encoding: [0x38,0x42,0x00,0x04]
1:
+
+ # Check that we accept traditional %relocation(symbol) offsets for stores
+ # and loads, not just a sign 16 bit offset.
+
+ lui $2, %hi(g_8) # CHECK: encoding: [0x3c,0x02,A,A]
+ lb $3, %lo(g_8)($2) # CHECK: encoding: [0x80,0x43,A,A]
+ lh $3, %lo(g_8)($2) # CHECK: encoding: [0x84,0x43,A,A]
+ lhu $3, %lo(g_8)($2) # CHECK: encoding: [0x94,0x43,A,A]
+ lw $3, %lo(g_8)($2) # CHECK: encoding: [0x8c,0x43,A,A]
+ sb $3, %lo(g_8)($2) # CHECK: encoding: [0xa0,0x43,A,A]
+ sh $3, %lo(g_8)($2) # CHECK: encoding: [0xa4,0x43,A,A]
+ sw $3, %lo(g_8)($2) # CHECK: encoding: [0xac,0x43,A,A]
+
+ lwc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xc4,0x40,A,A]
+ ldc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xd4,0x40,A,A]
+ swc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xe4,0x40,A,A]
+ sdc1 $f0, %lo(g_8)($2) # CHECK: encoding: [0xf4,0x40,A,A]
+ lwu $3, %lo(g_8)($2) # CHECK: encoding: [0x9c,0x43,A,A]
+ ld $3, %lo(g_8)($2) # CHECK: encoding: [0xdc,0x43,A,A]
+ sd $3, %lo(g_8)($2) # CHECK: encoding: [0xfc,0x43,A,A]
+ .type g_8, at object
+ .comm g_8,16,16
More information about the llvm-commits
mailing list