Commit c16c63bb by Ian Bolton Committed by Ian Bolton

Implement bswaphi2 with rev16 (AArch64)

From-SVN: r193729
parent 10dbfb3e
2012-11-22 Ian Bolton <ian.bolton@arm.com>
* config/aarch64/aarch64.md (bswaphi2): New pattern.
2012-11-22 H.J. Lu <hongjiu.lu@intel.com> 2012-11-22 H.J. Lu <hongjiu.lu@intel.com>
PR sanitizer/55379 PR sanitizer/55379
...@@ -2312,6 +2312,15 @@ ...@@ -2312,6 +2312,15 @@
(set_attr "mode" "<MODE>")] (set_attr "mode" "<MODE>")]
) )
(define_insn "bswaphi2"
[(set (match_operand:HI 0 "register_operand" "=r")
(bswap:HI (match_operand:HI 1 "register_operand" "r")))]
""
"rev16\\t%w0, %w1"
[(set_attr "v8type" "rev")
(set_attr "mode" "HI")]
)
;; ------------------------------------------------------------------- ;; -------------------------------------------------------------------
;; Floating-point intrinsics ;; Floating-point intrinsics
;; ------------------------------------------------------------------- ;; -------------------------------------------------------------------
......
2012-11-22 Ian Bolton <ian.bolton@arm.com>
* gcc.target/aarch64/builtin-bswap-1.c: New test.
* gcc.target/aarch64/builtin-bswap-2.c: New test.
2012-11-22 Paolo Carlini <paolo.carlini@oracle.com> 2012-11-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/55432 PR c++/55432
......
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler-times "rev16\\t" 2 } } */
/* rev16 */
short
swaps16 (short x)
{
return __builtin_bswap16 (x);
}
/* rev16 */
unsigned short
swapu16 (unsigned short x)
{
return __builtin_bswap16 (x);
}
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler-times "rev16\\t" 2 } } */
/* rev16 */
unsigned short
swapu16_1 (unsigned short x)
{
return (x << 8) | (x >> 8);
}
/* rev16 */
unsigned short
swapu16_2 (unsigned short x)
{
return (x >> 8) | (x << 8);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment