Skip to content

Commit

Permalink
target/cris: Fix a typo in gen_swapr()
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230823145542.79633-9-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
philmd authored and rth7680 committed Aug 24, 2023
1 parent ad262fb commit 2775616
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions target/cris/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,15 +411,17 @@ static inline void t_gen_swapw(TCGv d, TCGv s)
tcg_gen_or_tl(d, d, t);
}

/* Reverse the within each byte.
T0 = (((T0 << 7) & 0x80808080) |
((T0 << 5) & 0x40404040) |
((T0 << 3) & 0x20202020) |
((T0 << 1) & 0x10101010) |
((T0 >> 1) & 0x08080808) |
((T0 >> 3) & 0x04040404) |
((T0 >> 5) & 0x02020202) |
((T0 >> 7) & 0x01010101));
/*
* Reverse the bits within each byte.
*
* T0 = ((T0 << 7) & 0x80808080)
* | ((T0 << 5) & 0x40404040)
* | ((T0 << 3) & 0x20202020)
* | ((T0 << 1) & 0x10101010)
* | ((T0 >> 1) & 0x08080808)
* | ((T0 >> 3) & 0x04040404)
* | ((T0 >> 5) & 0x02020202)
* | ((T0 >> 7) & 0x01010101);
*/
static void t_gen_swapr(TCGv d, TCGv s)
{
Expand Down

0 comments on commit 2775616

Please sign in to comment.