[AArch64] Add support for NEON scalar absolute value instruction.

llvm-svn: 192844
This commit is contained in:
Chad Rosier 2013-10-16 21:04:49 +00:00
parent 846a72539c
commit e904137c01
3 changed files with 14 additions and 0 deletions

View File

@ -855,6 +855,10 @@ def SCALAR_CMGTZ : SInst<"vcgtz", "ss", "Sl">;
def SCALAR_CMHI : SInst<"vcgt", "sss", "SUl">;
def SCALAR_CMTST : SInst<"vtst", "sss", "SlSUl">;
////////////////////////////////////////////////////////////////////////////////
// Scalar Absolute Value
def SCALAR_ABS : SInst<"vabs", "ss", "Sl">;
////////////////////////////////////////////////////////////////////////////////
// Scalar Signed Saturating Absolute Value
def SCALAR_SQABS : SInst<"vqabs", "ss", "ScSsSiSl">;

View File

@ -2074,6 +2074,10 @@ static Value *EmitAArch64ScalarBuiltinExpr(CodeGenFunction &CGF,
case AArch64::BI__builtin_neon_vtstd_u64:
Int = Intrinsic::aarch64_neon_vtstd; s = "vtst";
OverloadInt = false; break;
// Scalar Absolute Value
case AArch64::BI__builtin_neon_vabsd_s64:
Int = Intrinsic::aarch64_neon_vabs;
s = "vabs"; OverloadInt = false; break;
// Scalar Signed Saturating Absolute Value
case AArch64::BI__builtin_neon_vqabsb_s8:
case AArch64::BI__builtin_neon_vqabsh_s16:

View File

@ -7118,6 +7118,12 @@ uint64_t test_vtstd_u64(uint64_t a, uint64_t b) {
return (uint64_t)vtstd_u64(a, b);
}
int64_t test_vabsd_s64(int64_t a) {
// CHECK: test_vabsd_s64
// CHECK: abs {{d[0-9]+}}, {{d[0-9]+}}
return (int64_t)vabsd_s64(a);
}
int8_t test_vqabsb_s8(int8_t a) {
// CHECK: test_vqabsb_s8
// CHECK: sqabs {{b[0-9]+}}, {{b[0-9]+}}