|
Message
From: =?unknown-8bit?Q?Gy=F6rgy?= 'nog' Jeney<nog@s...>
Date: Thu Mar 24 21:08:43 CET 2005
Subject: [openrisc] [or1ksim #36] Remove use of floats
Hi,Since the recompiler uses mmx registers which reside in the fpu registers, it is not possible to use the fpu and mmx at the same time. Inevitably this will need to get fixed but for the time being this `fixes' it. Also I consider useing floats for this simple task ugly but that is only my opinion.
ChangeLog: * Remove useless use of floats.
nog. -------------- next part -------------- diff -urp --unidirectional-new-file /home/nog/or1ksim-split/peripheral/16450.c ./peripheral/16450.c --- /home/nog/or1ksim-split/peripheral/16450.c 2005-03-22 17:04:20.000000000 +0100 +++ ./peripheral/16450.c 2005-03-02 16:14:03.000000000 +0100 @@ -56,24 +56,24 @@ DEFAULT_DEBUG_CHANNEL(uart); before a single character is transmitted or received. */ static unsigned long char_clks(int dll, int dlh, int lcr) { - float bauds_per_char = 1.; + unsigned int bauds_per_char = 2; unsigned long char_clks = ((dlh << 8) + dll); if (lcr & UART_LCR_PARITY) - bauds_per_char = bauds_per_char + 1.; + bauds_per_char += 2; /* stop bits 1 or two */ if (lcr & UART_LCR_STOP) - bauds_per_char = bauds_per_char + 2.; + bauds_per_char += 4; else if ((lcr & 0x3) != 0) - bauds_per_char = bauds_per_char + 1.; + bauds_per_char += 2; else - bauds_per_char = bauds_per_char + 1.5; + bauds_per_char += 3; - bauds_per_char = bauds_per_char + (5. + (lcr & 0x3)); + bauds_per_char += 10 + ((lcr & 0x3) << 1); - return char_clks * bauds_per_char; + return (char_clks * bauds_per_char) >> 1; } /* Set a specific UART register with value. */
|
 |