diff options
author | Silviu Baranga <silviu.baranga@arm.com> | 2013-10-18 10:18:40 +0000 |
---|---|---|
committer | Silviu Baranga <silviu.baranga@arm.com> | 2013-10-18 10:18:40 +0000 |
commit | b1c480900bdc6486624a476b6ae25cb02a3b6276 (patch) | |
tree | 79b82e744a8fb71f9f2a7cb5ac39beb0581b1696 /test | |
parent | e019c08bf63cbcf3cdd9d5d83e6ecb22ad36536f (diff) | |
download | external_llvm-b1c480900bdc6486624a476b6ae25cb02a3b6276.zip external_llvm-b1c480900bdc6486624a476b6ae25cb02a3b6276.tar.gz external_llvm-b1c480900bdc6486624a476b6ae25cb02a3b6276.tar.bz2 |
Add hardware division as a default feature on Cortex-A15. Also add test cases to check this, and change diagnostics for the hwdiv-arm feature to something useful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192963 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/MC/ARM/idiv.s | 33 | ||||
-rw-r--r-- | test/MC/ARM/invalid-idiv.s | 28 |
2 files changed, 61 insertions, 0 deletions
diff --git a/test/MC/ARM/idiv.s b/test/MC/ARM/idiv.s new file mode 100644 index 0000000..6238a0f --- /dev/null +++ b/test/MC/ARM/idiv.s @@ -0,0 +1,33 @@ +@ RUN: llvm-mc -triple=armv7 -mcpu=cortex-a15 -show-encoding < %s 2>&1 | FileCheck -check-prefix A15-ARM %s +@ RUN: llvm-mc -triple=thumbv7 -mcpu=cortex-a15 -show-encoding < %s 2>&1 | FileCheck -check-prefix A15-THUMB %s + +@ RUN: llvm-mc -triple=armv7 -mcpu=cortex-a15 -mattr=-hwdiv -show-encoding < %s 2>&1 | FileCheck -check-prefix A15-ARM-NOTHUMBHWDIV %s +@ RUN: llvm-mc -triple=thumbv7 -mcpu=cortex-a15 -mattr=-hwdiv-arm -show-encoding < %s 2>&1 | FileCheck -check-prefix A15-THUMB-NOARMHWDIV %s + +@ RUN: llvm-mc -triple=armv8 -show-encoding < %s 2>&1 | FileCheck -check-prefix ARMV8 %s +@ RUN: llvm-mc -triple=thumbv8 -show-encoding < %s 2>&1 | FileCheck -check-prefix THUMBV8 %s + +@ RUN: llvm-mc -triple=armv8 -mattr=-hwdiv -show-encoding < %s 2>&1 | FileCheck -check-prefix ARMV8-NOTHUMBHWDIV %s +@ RUN: llvm-mc -triple=thumbv8 -mattr=-hwdiv-arm -show-encoding < %s 2>&1 | FileCheck -check-prefix THUMBV8-NOTHUMBHWDIV %s + + sdiv r1, r2, r3 + udiv r3, r4, r5 +@ A15-ARM: sdiv r1, r2, r3 @ encoding: [0x12,0xf3,0x11,0xe7] +@ A15-ARM: udiv r3, r4, r5 @ encoding: [0x14,0xf5,0x33,0xe7] +@ A15-THUMB: sdiv r1, r2, r3 @ encoding: [0x92,0xfb,0xf3,0xf1] +@ A15-THUMB: udiv r3, r4, r5 @ encoding: [0xb4,0xfb,0xf5,0xf3] + +@ A15-ARM-NOTHUMBHWDIV: sdiv r1, r2, r3 @ encoding: [0x12,0xf3,0x11,0xe7] +@ A15-ARM-NOTHUMBHWDIV: udiv r3, r4, r5 @ encoding: [0x14,0xf5,0x33,0xe7] +@ A15-THUMB-NOARMHWDIV: sdiv r1, r2, r3 @ encoding: [0x92,0xfb,0xf3,0xf1] +@ A15-THUMB-NOARMHWDIV: udiv r3, r4, r5 @ encoding: [0xb4,0xfb,0xf5,0xf3] + +@ ARMV8: sdiv r1, r2, r3 @ encoding: [0x12,0xf3,0x11,0xe7] +@ ARMV8: udiv r3, r4, r5 @ encoding: [0x14,0xf5,0x33,0xe7] +@ THUMBV8: sdiv r1, r2, r3 @ encoding: [0x92,0xfb,0xf3,0xf1] +@ THUMBV8: udiv r3, r4, r5 @ encoding: [0xb4,0xfb,0xf5,0xf3] + +@ ARMV8-NOTHUMBHWDIV: sdiv r1, r2, r3 @ encoding: [0x12,0xf3,0x11,0xe7] +@ ARMV8-NOTHUMBHWDIV: udiv r3, r4, r5 @ encoding: [0x14,0xf5,0x33,0xe7] +@ THUMBV8-NOTHUMBHWDIV: sdiv r1, r2, r3 @ encoding: [0x92,0xfb,0xf3,0xf1] +@ THUMBV8-NOTHUMBHWDIV: udiv r3, r4, r5 @ encoding: [0xb4,0xfb,0xf5,0xf3] diff --git a/test/MC/ARM/invalid-idiv.s b/test/MC/ARM/invalid-idiv.s new file mode 100644 index 0000000..a84e66a --- /dev/null +++ b/test/MC/ARM/invalid-idiv.s @@ -0,0 +1,28 @@ +@ RUN: not llvm-mc -triple=armv7 -mcpu=cortex-a15 -mattr=-hwdiv-arm < %s 2> %t +@ RUN: FileCheck --check-prefix=ARM-A15 < %t %s +@ RUN: not llvm-mc -triple=thumbv7 -mcpu=cortex-a15 -mattr=-hwdiv < %s 2> %t +@ RUN: FileCheck --check-prefix=THUMB-A15 < %t %s +@ RUN: not llvm-mc -triple=armv7 < %s 2> %t +@ RUN: FileCheck --check-prefix=ARM < %t %s +@ RUN: not llvm-mc -triple=thumbv7 < %s 2> %t +@ RUN: FileCheck --check-prefix=THUMB < %t %s + + sdiv r1, r2, r3 + udiv r3, r4, r5 +@ ARM-A15: error: instruction requires: divide in ARM +@ ARM-A15: sdiv r1, r2, r3 +@ ARM-A15: error: instruction requires: divide in ARM +@ ARM-A15: udiv r3, r4, r5 +@ THUMB-A15: error: instruction requires: arm-mode +@ THUMB-A15: sdiv r1, r2, r3 +@ THUMB-A15: error: instruction requires: arm-mode +@ THUMB-A15: udiv r3, r4, r5 + +@ ARM: error: instruction requires: divide in ARM +@ ARM: sdiv r1, r2, r3 +@ ARM: error: instruction requires: divide in ARM +@ ARM: udiv r3, r4, r5 +@ THUMB: error: instruction requires: divide in THUMB +@ THUMB: sdiv r1, r2, r3 +@ THUMB: error: instruction requires: divide in THUMB +@ THUMB: udiv r3, r4, r5 |