From 9844efc044126d3bf5a1bfae3f3cfb9c40a987e6 Mon Sep 17 00:00:00 2001 From: Simon Dardis Date: Thu, 16 Nov 2017 10:50:44 +0000 Subject: [PATCH] [mips][mt] Add missing test cases from r318207 llvm-svn: 318389 --- llvm/test/MC/Mips/mt/invalid-wrong-error.s | 4 ++ .../mt/mftr-mttr-aliases-invalid-wrong-error.s | 18 +++++++++ llvm/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s | 23 +++++++++++ llvm/test/MC/Mips/mt/mftr-mttr-aliases.s | 47 ++++++++++++++++++++++ llvm/test/MC/Mips/mt/mftr-mttr-reserved-valid.s | 8 ++++ 5 files changed, 100 insertions(+) create mode 100644 llvm/test/MC/Mips/mt/invalid-wrong-error.s create mode 100644 llvm/test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s create mode 100644 llvm/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s create mode 100644 llvm/test/MC/Mips/mt/mftr-mttr-aliases.s create mode 100644 llvm/test/MC/Mips/mt/mftr-mttr-reserved-valid.s diff --git a/llvm/test/MC/Mips/mt/invalid-wrong-error.s b/llvm/test/MC/Mips/mt/invalid-wrong-error.s new file mode 100644 index 0000000..6de852c --- /dev/null +++ b/llvm/test/MC/Mips/mt/invalid-wrong-error.s @@ -0,0 +1,4 @@ +# RUN: not llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt < %s 2>%t1 +# RUN: FileCheck %s < %t1 + mftr 0($4), $5, 0, 0, 0 # CHECK: error: unexpected token in argument list + mttr 0($4), $5, 0, 0, 0 # CHECK: error: unexpected token in argument list diff --git a/llvm/test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s b/llvm/test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s new file mode 100644 index 0000000..d931b49 --- /dev/null +++ b/llvm/test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s @@ -0,0 +1,18 @@ +# RUN: not llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt -show-encoding < %s 2>%t1 +# RUN: FileCheck %s < %t1 + +# The integrated assembler produces a wrong or misleading error message. + + mftc0 0($4), $5 # CHECK: error: unexpected token in argument list + mftc0 0($4), $5, 1 # CHECK: error: unexpected token in argument list + mftgpr 0($4), $5 # CHECK: error: unexpected token in argument list + mftlo 0($3) # CHECK: error: unexpected token in argument list + mftlo 0($3), $ac1 # CHECK: error: unexpected token in argument list + mfthi 0($3) # CHECK: error: unexpected token in argument list + mfthi 0($3), $ac1 # CHECK: error: unexpected token in argument list + mftacx 0($3) # CHECK: error: unexpected token in argument list + mftacx 0($3), $ac1 # CHECK: error: unexpected token in argument list + mftdsp 0($4) # CHECK: error: unexpected token in argument list + mftc1 0($4), $f4 # CHECK: error: unexpected token in argument list + mfthc1 0($4), $f4 # CHECK: error: unexpected token in argument list + cftc1 0($4), $f8 # CHECK: error: unexpected token in argument list diff --git a/llvm/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s b/llvm/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s new file mode 100644 index 0000000..17d9540 --- /dev/null +++ b/llvm/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s @@ -0,0 +1,23 @@ +# RUN: not llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt -show-encoding < %s 2>%t1 +# RUN: FileCheck %s < %t1 + + mftc0 $4, 0($5) # CHECK: error: invalid operand for instruction + mftc0 $4, 0($5), 1 # CHECK: error: invalid operand for instruction + mftc0 $4, $5, -1 # CHECK: error: expected 3-bit unsigned immediate + mftc0 $4, $5, 9 # CHECK: error: expected 3-bit unsigned immediate + mftc0 $4, $5, $6 # CHECK: error: expected 3-bit unsigned immediate + mftgpr $4, 0($5) # CHECK: error: invalid operand for instruction + mftgpr $4, $5, $6 # CHECK: error: invalid operand for instruction + mftlo $3, 0($ac1) # CHECK: error: invalid operand for instruction + mftlo $4, $ac1, $4 # CHECK: error: invalid operand for instruction + mfthi $3, 0($ac1) # CHECK: error: invalid operand for instruction + mfthi $4, $ac1, $4 # CHECK: error: invalid operand for instruction + mftacx $3, 0($ac1) # CHECK: error: invalid operand for instruction + mftacx $4, $ac1, $4 # CHECK: error: invalid operand for instruction + mftdsp $4, $5 # CHECK: error: invalid operand for instruction + mftdsp $4, $f5 # CHECK: error: invalid operand for instruction + mftdsp $4, $ac0 # CHECK: error: invalid operand for instruction + mftc1 $4, 0($f4) # CHECK: error: invalid operand for instruction + mfthc1 $4, 0($f4) # CHECK: error: invalid operand for instruction + cftc1 $4, 0($f4) # CHECK: error: invalid operand for instruction + cftc1 $4, $f4, $5 # CHECK: error: invalid operand for instruction diff --git a/llvm/test/MC/Mips/mt/mftr-mttr-aliases.s b/llvm/test/MC/Mips/mt/mftr-mttr-aliases.s new file mode 100644 index 0000000..92ed9f9 --- /dev/null +++ b/llvm/test/MC/Mips/mt/mftr-mttr-aliases.s @@ -0,0 +1,47 @@ +# RUN: llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt -show-encoding < %s | FileCheck %s + +# Check the various aliases of the m[ft]tr instruction. + + mftc0 $4, $5 # CHECK: mftr $4, $5, 0, 0, 0 # encoding: [0x41,0x05,0x20,0x00] + mftc0 $6, $7, 1 # CHECK: mftr $6, $7, 0, 1, 0 # encoding: [0x41,0x07,0x30,0x01] + mftgpr $5, $9 # CHECK: mftr $5, $9, 1, 0, 0 # encoding: [0x41,0x09,0x28,0x20] + mftlo $3 # CHECK: mftr $3, $zero, 1, 1, 0 # encoding: [0x41,0x00,0x18,0x21] + mftlo $3, $ac0 # CHECK: mftr $3, $zero, 1, 1, 0 # encoding: [0x41,0x00,0x18,0x21] + mftlo $3, $ac1 # CHECK: mftr $3, $4, 1, 1, 0 # encoding: [0x41,0x04,0x18,0x21] + mftlo $3, $ac2 # CHECK: mftr $3, $8, 1, 1, 0 # encoding: [0x41,0x08,0x18,0x21] + mftlo $3, $ac3 # CHECK: mftr $3, $12, 1, 1, 0 # encoding: [0x41,0x0c,0x18,0x21] + mfthi $3, $ac0 # CHECK: mftr $3, $1, 1, 1, 0 # encoding: [0x41,0x01,0x18,0x21] + mfthi $3, $ac1 # CHECK: mftr $3, $5, 1, 1, 0 # encoding: [0x41,0x05,0x18,0x21] + mfthi $3, $ac2 # CHECK: mftr $3, $9, 1, 1, 0 # encoding: [0x41,0x09,0x18,0x21] + mfthi $3, $ac3 # CHECK: mftr $3, $13, 1, 1, 0 # encoding: [0x41,0x0d,0x18,0x21] + mftacx $3, $ac0 # CHECK: mftr $3, $2, 1, 1, 0 # encoding: [0x41,0x02,0x18,0x21] + mftacx $3, $ac1 # CHECK: mftr $3, $6, 1, 1, 0 # encoding: [0x41,0x06,0x18,0x21] + mftacx $3, $ac2 # CHECK: mftr $3, $10, 1, 1, 0 # encoding: [0x41,0x0a,0x18,0x21] + mftacx $3, $ac3 # CHECK: mftr $3, $14, 1, 1, 0 # encoding: [0x41,0x0e,0x18,0x21] + mftdsp $4 # CHECK: mftr $4, $16, 1, 1, 0 # encoding: [0x41,0x10,0x20,0x21] + mftc1 $4, $f5 # CHECK: mftr $4, $5, 1, 2, 0 # encoding: [0x41,0x05,0x20,0x22] + mfthc1 $4, $f5 # CHECK: mftr $4, $5, 1, 2, 1 # encoding: [0x41,0x05,0x20,0x32] + cftc1 $4, $f9 # CHECK: mftr $4, $9, 1, 3, 0 # encoding: [0x41,0x09,0x20,0x23] + + mttc0 $4, $5 # CHECK: mttr $4, $5, 0, 0, 0 # encoding: [0x41,0x84,0x28,0x00] + mttc0 $6, $7, 1 # CHECK: mttr $6, $7, 0, 1, 0 # encoding: [0x41,0x86,0x38,0x01] + mttgpr $5, $9 # CHECK: mttr $5, $9, 1, 0, 0 # encoding: [0x41,0x85,0x48,0x20] + mttlo $3 # CHECK: mttr $3, $zero, 1, 1, 0 # encoding: [0x41,0x83,0x00,0x21] + mttlo $3, $ac0 # CHECK: mttr $3, $zero, 1, 1, 0 # encoding: [0x41,0x83,0x00,0x21] + mttlo $3, $ac1 # CHECK: mttr $3, $4, 1, 1, 0 # encoding: [0x41,0x83,0x20,0x21] + mttlo $3, $ac2 # CHECK: mttr $3, $8, 1, 1, 0 # encoding: [0x41,0x83,0x40,0x21] + mttlo $3, $ac3 # CHECK: mttr $3, $12, 1, 1, 0 # encoding: [0x41,0x83,0x60,0x21] + mtthi $3 # CHECK: mttr $3, $1, 1, 1, 0 # encoding: [0x41,0x83,0x08,0x21] + mtthi $3, $ac0 # CHECK: mttr $3, $1, 1, 1, 0 # encoding: [0x41,0x83,0x08,0x21] + mtthi $3, $ac1 # CHECK: mttr $3, $5, 1, 1, 0 # encoding: [0x41,0x83,0x28,0x21] + mtthi $3, $ac2 # CHECK: mttr $3, $9, 1, 1, 0 # encoding: [0x41,0x83,0x48,0x21] + mtthi $3, $ac3 # CHECK: mttr $3, $13, 1, 1, 0 # encoding: [0x41,0x83,0x68,0x21] + mttacx $3 # CHECK: mttr $3, $2, 1, 1, 0 # encoding: [0x41,0x83,0x10,0x21] + mttacx $3, $ac0 # CHECK: mttr $3, $2, 1, 1, 0 # encoding: [0x41,0x83,0x10,0x21] + mttacx $3, $ac1 # CHECK: mttr $3, $6, 1, 1, 0 # encoding: [0x41,0x83,0x30,0x21] + mttacx $3, $ac2 # CHECK: mttr $3, $10, 1, 1, 0 # encoding: [0x41,0x83,0x50,0x21] + mttacx $3, $ac3 # CHECK: mttr $3, $14, 1, 1, 0 # encoding: [0x41,0x83,0x70,0x21] + mttdsp $4 # CHECK: mttr $4, $16, 1, 1, 0 # encoding: [0x41,0x84,0x80,0x21] + mttc1 $4, $f5 # CHECK: mttr $4, $5, 1, 2, 0 # encoding: [0x41,0x84,0x28,0x22] + mtthc1 $4, $f5 # CHECK: mttr $4, $5, 1, 2, 1 # encoding: [0x41,0x84,0x28,0x32] + cttc1 $4, $f9 # CHECK: mttr $4, $9, 1, 3, 0 # encoding: [0x41,0x84,0x48,0x23] diff --git a/llvm/test/MC/Mips/mt/mftr-mttr-reserved-valid.s b/llvm/test/MC/Mips/mt/mftr-mttr-reserved-valid.s new file mode 100644 index 0000000..c40e81b --- /dev/null +++ b/llvm/test/MC/Mips/mt/mftr-mttr-reserved-valid.s @@ -0,0 +1,8 @@ +# RUN: llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt -show-encoding < %s | FileCheck %s + +# The selector value and register values here are marked as reserved in the +# documentation, but GAS accepts them without warning. + mftr $31, $31, 1, 1, 0 # CHECK: mftr $ra, $ra, 1, 1, 0 # encoding: [0x41,0x1f,0xf8,0x21] + mttr $31, $31, 1, 1, 0 # CHECK: mttr $ra, $ra, 1, 1, 0 # encoding: [0x41,0x9f,0xf8,0x21] + mftr $31, $13, 1, 6, 0 # CHECK: mftr $ra, $13, 1, 6, 0 # encoding: [0x41,0x0d,0xf8,0x26] + mttr $31, $13, 1, 6, 0 # CHECK: mttr $ra, $13, 1, 6, 0 # encoding: [0x41,0x9f,0x68,0x26] -- 2.7.4