[EXT_EP-10887] Conditions on certain instructions may be dropped by compiler Created: 29/Aug/22  Updated: 11/Dec/25  Resolved: 15/Feb/23

Status: Fixed
Project: Embedded Software & Tools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: TI User Assignee: TI User
Resolution: Fixed Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Product: Code Generation Tools
Internal ID: CODEGEN-10334
Found In Release: C7000_1.4.0.LTS
C7000_2.1.0.LTS
C7000_3.0.0.STS
Fix In Release: C7000_2.1.2.LTS
C7000_1.4.3.LTS
C7000_3.1.0.LTS
Affected Platform/Device: default

 Description   

In some cases, when a value is conditionally reset, an unconditional write may instead occur. For example, in the following code:

float16 get_float(int cond)

{ float16 ret = (float16)(0.0f); if (cond) ret = (float16)(-FLT_MAX); return ret; }

Generates:

VMVK32 .L2 0xff7fffff,VB0 ; No instruction predicate

Instead of the expected:

[!A0] VMVK32 .L2 0xff7fffff,VB0 ; Has instruction predicate

This behavior may occur with the following instructions in generated assembly. Lists are further subdivided by release, risk, and potential context:

1.1.0 and later; low risk; in the context of sequences of half vector accesses with VHHMV, VLLMV, and/or VHLMV:
VHHMV
VHLMV
VLHMV

1.1.0 and later; low risk; in the context of sequences of vector predicate moves with MV and MVPB:
MV
MVPP

1.1.0 and later; low risk; in the context of a following zero extension with EXTU:
ADDSP
ADDW
ANDNW
ANDW
DIVUW
DIVW
MODUW
MODW
MPYHW
MPYSP
MPYSUHW
MPYUHW
MPYWW
NANDW
NORW
ORNW
ORW
PCNTGATHERB
PCNTGATHERD
PCNTGATHERH
PCNTGATHERW
SHLW
SHRUW
SHRW
SUBRW
SUBSP
SUBW
XNORW
XORW

1.3.0 and later; low risk; in the context of sequences of packs and unpacks of vectors with VBPACKH, VBUNPKH, VHPACKH, VHUNPKW, VWPACKH, and/or VWUNPKD:
VSHRD
VSHRH
VSHRW

2.0.0 and later; low risk; in the context of repeated swaps of vector elements with VSWAPB, VSWAPH, VSWAPW, or VSWAPD:
VMV

3.0.0; moderate risk; in the context of initializing a vector predicate from a constant with MVK32, MVKU32, or MVK64:
MASKB
MASKD

3.0.0; moderate risk; in the context of widening a boolean vector with BITXPND:
MVDP
VMVPD
VMVPH
VMVPW

3.0.0; moderate risk; in the context of initializing a vector to all zeros with MVKU32, VPACKP2, VMVK32, VPACKL4, VMVK32, VDUP2B, VDUP4B, VDUP8B, VDUP16B, VDUP32B, VDUP2H, VDUP4H, VDUP8H, VDUP16H, VDUP2D, and/or VDUP4D:
VMVK32

3.0.0; moderate risk; in the context of initializing a vector to a 32 bit constant with VMVK32, MVK32, MVKU32, VDUP2W, VDUP4W, VDUP8W, and/or VDUPW:
VMVK32


Generated at Sat Dec 13 11:39:06 CST 2025 using Jira 10.3.7#10030007-sha1:a563685562f94d165eb4e158cfb2a142338d8c54.