@@ -294,6 +294,34 @@ Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned
BuiltinID,
return Builder.CreateCall(F, Ops, "");
}
+ // BCD convert builtins for P9
+ case PPC::BI__builtin_ppc_national2packed:
+ case PPC::BI__builtin_ppc_packed2zoned:
+ case PPC::BI__built
@@ -0,0 +1,96 @@
+; Testfile that verifies positive case (0 or 1 only) for BCD builtins
national2packed, packed2zoned and zoned2packed.
redstar wrote:
Since this is a new test I think we should strive for using
`update_llc_test_checks.py` to generate the `CHECK
@@ -0,0 +1,96 @@
+; Testfile that verifies positive case (0 or 1 only) for BCD builtins
national2packed, packed2zoned and zoned2packed.
+; RUN: llc -verify-machineinstrs -mcpu=pwr9
-mtriple=powerpc64le-unknown-unknown \
+; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s
+
+;
@@ -0,0 +1,96 @@
+; Testfile that verifies positive case (0 or 1 only) for BCD builtins
national2packed, packed2zoned and zoned2packed.
+; RUN: llc -verify-machineinstrs -mcpu=pwr9
-mtriple=powerpc64le-unknown-unknown \
+; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s
+
+;
@@ -0,0 +1,96 @@
+; Testfile that verifies positive case (0 or 1 only) for BCD builtins
national2packed, packed2zoned and zoned2packed.
+; RUN: llc -verify-machineinstrs -mcpu=pwr9
-mtriple=powerpc64le-unknown-unknown \
+; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s
+
+;
@@ -0,0 +1,57 @@
+// Testfile that verifies positive cases (0 or 1 only) for BCD builtins
national2packed, packed2zoned and zoned2packed.
redstar wrote:
I wonder if the `CHECK:` lines could be generated by `update_cc_test_checks.py`.
https://github.com/llvm/llv
@@ -294,6 +294,34 @@ Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned
BuiltinID,
return Builder.CreateCall(F, Ops, "");
}
+ // BCD convert builtins for P9
+ case PPC::BI__builtin_ppc_national2packed:
+ case PPC::BI__builtin_ppc_packed2zoned:
+ case PPC::BI__built
@@ -655,6 +655,14 @@ let TargetPrefix = "ppc" in { // All intrinsics start
with "llvm.ppc.".
DefaultAttrsIntrinsic<[llvm_v1i128_ty],[llvm_v1i128_ty],[IntrNoMem]>;
// BCD intrinsics.
+ def int_ppc_national2packed: ClangBuiltin<"__builtin_ppc_national2packed">,
+D
@@ -1617,10 +1617,14 @@ class VX_VT5_EO5_VB5_XO9_o eo, bits<9> xo,
string opc,
}
// Decimal Convert From/to National/Zoned/Signed-QWord
-def BCDCFN_rec : VX_VT5_EO5_VB5_PS1_XO9_o<7, 385, "bcdcfn." , []>;
-def BCDCFZ_rec : VX_VT5_EO5_VB5_PS1_XO9_o<6, 385, "bcdcfz." , []>;
-d
@@ -0,0 +1,23 @@
+// Testfile for negative condition for BCD builtins national2packed,
packed2zoned and zoned2packed.
Himadhith wrote:
Okay it does seem redundant, I will remove the negative test case file and keep
`clang/test/Sema/builtins-bcd-transform.c` to
@@ -294,6 +294,34 @@ Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned
BuiltinID,
return Builder.CreateCall(F, Ops, "");
}
+ // BCD convert builtins for P9
+ case PPC::BI__builtin_ppc_national2packed:
+ case PPC::BI__builtin_ppc_packed2zoned:
+ case PPC::BI__built
https://github.com/Himadhith updated
https://github.com/llvm/llvm-project/pull/142723
>From 71e655265ac911433462d10325e188c40f908dad Mon Sep 17 00:00:00 2001
From: himadhith
Date: Wed, 4 Jun 2025 06:13:13 +
Subject: [PATCH 1/2] [PowerPC] Support for Packed BCD conversion builtins
---
clan
@@ -294,6 +294,34 @@ Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned
BuiltinID,
return Builder.CreateCall(F, Ops, "");
}
+ // BCD convert builtins for P9
+ case PPC::BI__builtin_ppc_national2packed:
+ case PPC::BI__builtin_ppc_packed2zoned:
+ case PPC::BI__built
@@ -567,6 +567,13 @@ TARGET_BUILTIN(__builtin_altivec_vextsh2w, "V4SiV8Ss", "",
"power9-vector")
TARGET_BUILTIN(__builtin_altivec_vextsh2d, "V2SLLiV8Ss", "", "power9-vector")
TARGET_BUILTIN(__builtin_altivec_vextsw2d, "V2SLLiV4Si", "", "power9-vector")
+// P9 BCD builtins (th
@@ -1617,10 +1617,14 @@ class VX_VT5_EO5_VB5_XO9_o eo, bits<9> xo,
string opc,
}
// Decimal Convert From/to National/Zoned/Signed-QWord
-def BCDCFN_rec : VX_VT5_EO5_VB5_PS1_XO9_o<7, 385, "bcdcfn." , []>;
-def BCDCFZ_rec : VX_VT5_EO5_VB5_PS1_XO9_o<6, 385, "bcdcfz." , []>;
-d
@@ -0,0 +1,23 @@
+// Testfile for negative condition for BCD builtins national2packed,
packed2zoned and zoned2packed.
lei137 wrote:
What is the difference between this and
`clang/test/Sema/builtins-bcd-transform.c` below?
I am not sure we need both.
https://gi
https://github.com/lei137 edited
https://github.com/llvm/llvm-project/pull/142723
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -655,6 +655,14 @@ let TargetPrefix = "ppc" in { // All intrinsics start
with "llvm.ppc.".
DefaultAttrsIntrinsic<[llvm_v1i128_ty],[llvm_v1i128_ty],[IntrNoMem]>;
// BCD intrinsics.
+ def int_ppc_national2packed: ClangBuiltin<"__builtin_ppc_national2packed">,
+D
@@ -294,6 +294,34 @@ Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned
BuiltinID,
return Builder.CreateCall(F, Ops, "");
}
+ // BCD convert builtins for P9
+ case PPC::BI__builtin_ppc_national2packed:
+ case PPC::BI__builtin_ppc_packed2zoned:
+ case PPC::BI__built
https://github.com/lei137 requested changes to this pull request.
Since the description will be the git commit message, maybe it should just be a
summary of what this patch implements.
https://github.com/llvm/llvm-project/pull/142723
___
cfe-commits m
Himadhith wrote:
@lei137 @amy-kwan @tonykuttai
https://github.com/llvm/llvm-project/pull/142723
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: None (Himadhith)
Changes
Support the following packed BCD builtins for PowerPC.
```
__builtin_national2packed - Conversion of National format to Packed decimal
format.
__builtin_packed2national - Conversion of Packed decimal format to n
llvmbot wrote:
@llvm/pr-subscribers-backend-powerpc
@llvm/pr-subscribers-clang-codegen
Author: None (Himadhith)
Changes
Support the following packed BCD builtins for PowerPC.
```
__builtin_national2packed - Conversion of National format to Packed decimal
format.
__builtin_packed2nation
23 matches
Mail list logo