Skip to contentSkip to conversation

Doubleword alignment for floating point instructions

PATCH New Aurelien Jarno 1 participant 1 message Apr 5, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Doubleword alignment for floating point instructions

Hi all,

According to the SPARC v8 manual, floating point instructions that operate on doublewords should be aligned. The processor should ignore the least significant bit of the register number, and may generate a trap.

Very few real CPU are actually generating a trap, so the attached patch simply make the emulated CPU to ignore the smaller bit.

Note that on SPARC v9, this bit is actually used as the most significant bit.

Bye,
Aurelien

Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
target-sparc/translate.c +1 -1
diff -u -d -p -r1.44 translate.c
@@ -90,7 +89,7 @@ enum {
 #ifdef TARGET_SPARC64
 #define DFPREG(r) (((r & 1) << 6) | (r & 0x1e))
 #else
-#define DFPREG(r) (r)
+#define DFPREG(r) (r & 0x1e)
 #endif
 
 #ifdef USE_DIRECT_JUMP