Skip to content

Commit 3463654

Browse files
trbauerigcbot
authored andcommitted
(NFC) G4 render 0x0 instead of 0
Render the value of 0 in hex 0x0 in G4 assembly. Current code uses std::ios_base::showbase which prefixes hex only if non-zero. NFC - no functional changes to output
1 parent 6bf9bd7 commit 3463654

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

visa/G4_IR.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5407,17 +5407,16 @@ void G4_Imm::emit(std::ostream &output) {
54075407
// we only emit hex in this function
54085408
//
54095409
std::ios::fmtflags outFlags(output.flags());
5410-
output.flags(std::ios_base::hex | std::ios_base::showbase);
5410+
output.flags(std::ios_base::hex);
5411+
output << "0x";
54115412

5412-
short word;
54135413
if (type == Type_DF) {
54145414
output << (uint64_t)imm.num;
54155415
} else if (type == Type_F) {
54165416
output << imm.num32;
54175417
} else if (type == Type_W || type == Type_UW || type == Type_B ||
54185418
type == Type_UB) {
5419-
word = (short)imm.num;
5420-
output << word;
5419+
output << (short)imm.num;
54215420
} else if (type == Type_D || type == Type_UD) {
54225421
// 32-bit int
54235422
output << (int)imm.num;

0 commit comments

Comments
 (0)