aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Compiler.cpp
diff options
context:
space:
mode:
authorAditi Medhane <aditimedhane73@gmail.com>2025-08-19 14:47:27 +0530
committerGitHub <noreply@github.com>2025-08-19 14:47:27 +0530
commit948abf1bf5e481d05af8dee4e5a8201152394bae (patch)
tree944a58b9f3eabcdb43d441e35fe3fa8b69b699e1 /clang/lib/AST/ByteCode/Compiler.cpp
parent9cadc4e15362581e1b2a5b0216d180d181a08cfc (diff)
downloadllvm-948abf1bf5e481d05af8dee4e5a8201152394bae.zip
llvm-948abf1bf5e481d05af8dee4e5a8201152394bae.tar.gz
llvm-948abf1bf5e481d05af8dee4e5a8201152394bae.tar.bz2
[PowerPC] Add BCDCOPYSIGN and BCDSETSIGN Instruction Support (#144874)
Support the following BCD format conversion builtins for PowerPC. - `__builtin_bcdcopysign` – Conversion that returns the decimal value of the first parameter combined with the sign code of the second parameter. ` - `__builtin_bcdsetsign` – Conversion that sets the sign code of the input parameter in packed decimal format. > Note: This built-in function is valid only when all following conditions are met: > -qarch is set to utilize POWER9 technology. > The bcd.h file is included. ## Prototypes ```c vector unsigned char __builtin_bcdcopysign(vector unsigned char, vector unsigned char); vector unsigned char __builtin_bcdsetsign(vector unsigned char, unsigned char); ``` ## Usage Details `__builtin_bcdsetsign`: Returns the packed decimal value of the first parameter combined with the sign code. The sign code is set according to the following rules: - If the packed decimal value of the first parameter is positive, the following rules apply: - If the second parameter is 0, the sign code is set to 0xC. - If the second parameter is 1, the sign code is set to 0xF. - If the packed decimal value of the first parameter is negative, the sign code is set to 0xD. > notes: > The second parameter can only be 0 or 1. > You can determine whether a packed decimal value is positive or negative as follows: > - Packed decimal values with sign codes **0xA, 0xC, 0xE, or 0xF** are interpreted as positive. > - Packed decimal values with sign codes **0xB or 0xD** are interpreted as negative. --------- Co-authored-by: Aditi-Medhane <aditi.medhane@ibm.com>
Diffstat (limited to 'clang/lib/AST/ByteCode/Compiler.cpp')
0 files changed, 0 insertions, 0 deletions