Skip to content

Fix incorrect inline assembly constraints in dcbt prefetch instructions#5828

Merged
martin-frbg merged 2 commits into
OpenMathLib:developfrom
amritahs-ibm:fix_dcbt_constraints
Jun 15, 2026
Merged

Fix incorrect inline assembly constraints in dcbt prefetch instructions#5828
martin-frbg merged 2 commits into
OpenMathLib:developfrom
amritahs-ibm:fix_dcbt_constraints

Conversation

@amritahs-ibm

Copy link
Copy Markdown
Contributor

Corrected the register constraints for the PowerPC dcbt (Data Cache Block Touch) instruction in Power10 kernel implementations. The dcbt instruction has special behavior where if the first operand (RA) is r0, it uses the value 0 instead of the register contents. Therefore, RA must use the "b" constraint (any GPR except r0), while RB can use "r" (any GPR including r0).

Changes:

  • Changed first operand constraint from "r" to "b" to exclude r0
  • Changed second operand constraint from "b" to "r" for flexibility

This ensures correct prefetch behavior and compliance with PowerPC ISA specifications, preventing potential issues where r0 might be incorrectly used as the base address register.

Corrected the register constraints for the PowerPC dcbt (Data Cache Block
Touch) instruction in Power10 kernel implementations. The dcbt instruction
has special behavior where if the first operand (RA) is r0, it uses the
value 0 instead of the register contents. Therefore, RA must use the "b"
constraint (any GPR except r0), while RB can use "r" (any GPR including r0).

Changes:
- Changed first operand constraint from "r" to "b" to exclude r0
- Changed second operand constraint from "b" to "r" for flexibility

This ensures correct prefetch behavior and compliance with PowerPC ISA
specifications, preventing potential issues where r0 might be incorrectly
used as the base address register.

Signed-off-by: Amrita H S <amritahs@linux.vnet.ibm.com>
@martin-frbg

Copy link
Copy Markdown
Collaborator

Is this still a draft as suggested by its title ?

@amritahs-ibm amritahs-ibm changed the title Draft PR: Fix incorrect inline assembly constraints in dcbt prefetch instructions Fix incorrect inline assembly constraints in dcbt prefetch instructions Jun 15, 2026
@amritahs-ibm

Copy link
Copy Markdown
Contributor Author

@martin-frbg Could you please merge this PR?

@martin-frbg martin-frbg added this to the 0.3.34 milestone Jun 15, 2026
@martin-frbg martin-frbg merged commit ef20ea1 into OpenMathLib:develop Jun 15, 2026
99 of 100 checks passed
@martin-frbg

Copy link
Copy Markdown
Collaborator

Done, thanks for the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants