Skip to content

[CIR] Implement missing X86 builtins #167765

@andykaylor

Description

@andykaylor

Overview

Implement CIR handling for X86-specific builtin functions that are not yet handled in the incubator. For these builtins, the initial implementation should be done in the upstream LLVM repository and then back-ported to the incubator. The implementation should be based on the handling of the same builtins in clang\CodeGen\TargetBuiltins\X86.c.

Many people can work on this in parallel, if we can successfully coordinate the work to avoid overlap as much as possible. To that end, I am adding a partial list here of the builtins that need to be implemented. If you would like to contribute to this task, please comment saying which builtin(s) you are working on.

I will remove builtins from this list as they are upstreamed.

Please check the table below before beginning work to make sure no one else is working on the builtins you are targeting. If you have any questions, please comment here tagging @andykaylor.

Needed builtins

Builtin group Assignee
masked rounding
vfmadd, vfmaddsub
masked expand
masked compress
extractf128
pmovqd512_mask
permdi
alignd
shuff32x4, shufi32x4
kshiftl, kshiftr @vishruth-thimmaiah
rotate @moar55
prord
select, selectsh
cmpb, ucmpb
vpcomb, vpcomub
ktest, kortest
kadd, kor, kand, kxnor, knot, kmov
kunpck @ahmednoursphinx
sqrtps @Priyanshu3820
pmul, pmulu
pternlog
vpshl, vpshr, shiftleft, shiftright
reduce fmul, fadd, fmax, fmin
rdrand_step
fpclass
intersect
multishift
convert half
cpuid
emul, mulh
readwritebarrier
address of return address
stosb
t2rpntlvw
ud2, int2c
readfs, readgs
encodekey
aesenc, aesencwide

Existing incubator tests

clang/test/CIR/CodeGen/X86/*

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClangIRAnything related to the ClangIR projectgood first issuehttps://github.com/llvm/llvm-project/contribute

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions