HomePhabricator

[X86] Add a X86ISD::BEXTRI to distinquish the case where the control must be a…

Authored by craig.topper on Oct 10 2020, 7:18 PM.

Description

[X86] Add a X86ISD::BEXTRI to distinquish the case where the control must be a constant.

The bextri intrinsic has a ImmArg attribute which will be converted
in SelectionDAG using TargetConstant. We previously converted this
to a plain Constant to allow X86ISD::BEXTR to call SimplifyDemandedBits
on it.

But while trying to decide if D89178 was safe, I realized that
this conversion of TargetConstant to Constant would be one case
where that would break.

So this patch adds a new opcode specifically for the immediate case.
And then teaches computeKnownBits and SimplifyDemandedBits to also
handle it, but not try to SimplifyDemandedBits on it. To make up
for that, I immediately masked the constant to 16 bits when
converting from the intrinsic node to the X86ISD node.

Details

Committed
craig.topperOct 10 2020, 7:18 PM
Parents
rG9237e73ae8a3: [Hexagon] Replace HexagonISD::VSPLAT with ISD::SPLAT_VECTOR
Branches
Unknown
Tags
Unknown