[PATCH v3 4/4] microblaze: use md_number_to_chars in md_assemble too

Project / Subsystem

binutils / microblaze

Date

2026-09-24

Proposer

Sam Price <thesamprice@gmail.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

Technical tradeoffs

  • • Improves code readability and maintainability by using a standard function (`md_number_to_chars`) instead of manual byte manipulation.
  • • Removes unused macros, simplifying the codebase.

All attributes

project
binutils
subsystem
microblaze
patch_id
—
discussion_id
20260924015023.36799-3-thesamprice@gmail.com
source_type
public_inbox
title
[PATCH v3 4/4] microblaze: use md_number_to_chars in md_assemble too
headline
microblaze: use md_number_to_chars in md_assemble too
tldr
Replaces raw byte assignments with `md_number_to_chars` in MicroBlaze's `md_assemble` for cleaner instruction encoding.
proposer
Sam Price <thesamprice@gmail.com>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
  • • Improves code readability and maintainability by using a standard function (`md_number_to_chars`) instead of manual byte manipulation.
  • • Removes unused macros, simplifying the codebase.
series_id
binutils:microblaze: use md_number_to_chars in md_assemble too
series_role
reply
series_parts
[]
tags
  • • microblaze
  • • gas
  • • refactoring
  • • instruction encoding
bugzilla_url
—
date
2026-09-24T00:00:00.000Z

[PATCH v3 4/4] microblaze: use md_number_to_chars in md_assemble too

This patch continues the cleanup of MicroBlaze instruction encoding by replacing six instances of direct byte assignments within the md_assemble function with calls to md_number_to_chars. These direct assignments were effectively equivalent to a four-byte store in the target’s byte order. By using md_number_to_chars, the code becomes more concise and consistent with other backends. The associated macros for individual bytes (INST_BYTE0 through INST_BYTE3) are removed as they are no longer used. This change is intended to have no functional impact and has been verified across test suites for both big-endian and little-endian MicroBlaze configurations.