diff options
| author | Zaara Syeda <syzaara@ca.ibm.com> | 2018-09-24 14:01:16 +0000 |
|---|---|---|
| committer | Zaara Syeda <syzaara@ca.ibm.com> | 2018-09-24 14:01:16 +0000 |
| commit | edefda48d2f543f6f97b72098ba1c24720c1af6e (patch) | |
| tree | 0ea4f56d45b9bc67c89dfe42d408ed902ebe380b /llvm/test/CodeGen/PowerPC | |
| parent | 8a7cfc6c86407ba9640db734033457b9a972589b (diff) | |
| download | bcm5719-llvm-edefda48d2f543f6f97b72098ba1c24720c1af6e.tar.gz bcm5719-llvm-edefda48d2f543f6f97b72098ba1c24720c1af6e.zip | |
[PowerPC] Support operand modifier 'x' in inline asm
gcc uses operand modifier 'x' in inline asm for VSX registers.
Without this modifier, instructions which use VSX numbering for their
operands are printed as VMX registers. This patch adds support for the
operand modifier 'x'.
Differential Revision: https://reviews.llvm.org/D52244
llvm-svn: 342882
Diffstat (limited to 'llvm/test/CodeGen/PowerPC')
| -rw-r--r-- | llvm/test/CodeGen/PowerPC/inlineasm-vsx-reg.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PowerPC/inlineasm-vsx-reg.ll b/llvm/test/CodeGen/PowerPC/inlineasm-vsx-reg.ll new file mode 100644 index 00000000000..9de6358427d --- /dev/null +++ b/llvm/test/CodeGen/PowerPC/inlineasm-vsx-reg.ll @@ -0,0 +1,22 @@ +; RUN: llc -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names -mcpu=pwr9 -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s +define signext i32 @foo(<4 x float> %__A) { +entry: + %0 = tail call { i32, <4 x float> } asm "xxsldwi ${1:x},${2:x},${2:x},3;\0Axscvspdp ${1:x},${1:x};\0Afctiw $1,$1;\0Amfvsrd $0,${1:x};\0A", "=r,=&^wa,^wa"(<4 x float> %__A) + %asmresult = extractvalue { i32, <4 x float> } %0, 0 + ret i32 %asmresult +; CHECK: #APP +; CHECK: xxsldwi vs0, v2, v2, 3 +; CHECK: xscvspdp f0, f0 +; CHECK: fctiw f0, f0 +; CHECK: mffprd r3, f0 +; CHECK: #NO_APP +} + +define double @test() { + entry: + %0 = tail call double asm "mtvsrd ${0:x}, 1", "=^ws,~{f0},~{f1},~{f2},~{f3},~{f4},~{f5},~{f6},~{f7},~{f8},~{f9},~{f10},~{f11},~{f12},~{f13},~{f14}"() + ret double %0 +; CHECK: #APP +; CHECK: mtvsrd v2, r1 +; CHECK: #NO_APP +} |

