diff options
author | Fangrui Song <maskray@google.com> | 2019-07-04 04:44:42 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-07-04 04:44:42 +0000 |
commit | 1f333562de96bb9343721a703dee1277929d61e4 (patch) | |
tree | e793533d10f87f6b8783b0ec2acbcc2c76d4f131 /clang/test/CodeGen/ppc64-inline-asm.c | |
parent | fa9d232e4389bbd9ca82f8b6b34a1784107835fc (diff) | |
download | bcm5719-llvm-1f333562de96bb9343721a703dee1277929d61e4.tar.gz bcm5719-llvm-1f333562de96bb9343721a703dee1277929d61e4.zip |
[PowerPC] Support constraint code "ww"
Summary:
"ww" and "ws" are both constraint codes for VSX vector registers that
hold scalar double data. "ww" is preferred for float while "ws" is
preferred for double.
Reviewed By: jsji
Differential Revision: https://reviews.llvm.org/D64119
llvm-svn: 365106
Diffstat (limited to 'clang/test/CodeGen/ppc64-inline-asm.c')
-rw-r--r-- | clang/test/CodeGen/ppc64-inline-asm.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeGen/ppc64-inline-asm.c b/clang/test/CodeGen/ppc64-inline-asm.c index 552fe280e00..3e958c328f9 100644 --- a/clang/test/CodeGen/ppc64-inline-asm.c +++ b/clang/test/CodeGen/ppc64-inline-asm.c @@ -24,3 +24,16 @@ unsigned char test_wc_i8(unsigned char b1, unsigned char b2) { // CHECK: call i8 asm "crand $0, $1, $2", "=^wc,^wc,^wc"(i8 %b1, i8 %b2) } +float test_fmaxf(float x, float y) { + asm("xsmaxdp %x0, %x1, %x2" : "=ww"(x) : "ww"(x), "ww"(y)); + return x; +// CHECK-LABEL: float @test_fmaxf(float %x, float %y) +// CHECK: call float asm "xsmaxdp ${0:x}, ${1:x}, ${2:x}", "=^ww,^ww,^ww"(float %x, float %y) +} + +double test_fmax(double x, double y) { + asm("xsmaxdp %x0, %x1, %x2" : "=ws"(x) : "ws"(x), "ws"(y)); + return x; +// CHECK-LABEL: double @test_fmax(double %x, double %y) +// CHECK: call double asm "xsmaxdp ${0:x}, ${1:x}, ${2:x}", "=^ws,^ws,^ws"(double %x, double %y) +} |