diff options
author | Tom Stellard <[email protected]> | 2012-08-29 11:39:38 -0400 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2012-08-29 15:52:10 -0400 |
commit | 2809ae3d445bc10a79f119946439431ba73bb069 (patch) | |
tree | 08159e115a313653f7a4522255608d3e2413bed7 /src/gallium/drivers | |
parent | 05113fd2662eeb0d17fd1074001b7405eeeca43c (diff) |
radeon/llvm: Fix encoding of FP immediates on SI
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/radeon/MCTargetDesc/SIMCCodeEmitter.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/MCTargetDesc/SIMCCodeEmitter.cpp b/src/gallium/drivers/radeon/MCTargetDesc/SIMCCodeEmitter.cpp index bc0b968bee0..5569cf6c3cc 100644 --- a/src/gallium/drivers/radeon/MCTargetDesc/SIMCCodeEmitter.cpp +++ b/src/gallium/drivers/radeon/MCTargetDesc/SIMCCodeEmitter.cpp @@ -239,9 +239,14 @@ uint64_t SIMCCodeEmitter::VOPPostEncode(const MCInst &MI, uint64_t Value) const{ Value |= (VGPR_BIT(opIdx)) << vgprBitOffset; } } else if (MO.isFPImm()) { + union { + float f; + uint32_t i; + } Imm; // XXX: Not all instructions can use inline literals // XXX: We should make sure this is a 32-bit constant - Value |= ((uint64_t)MO.getFPImm()) << 32; + Imm.f = MO.getFPImm(); + Value |= ((uint64_t)Imm.i) << 32; } } return Value; |