1 // |
1 // |
2 // Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. |
2 // Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. |
3 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 // |
4 // |
5 // This code is free software; you can redistribute it and/or modify it |
5 // This code is free software; you can redistribute it and/or modify it |
6 // under the terms of the GNU General Public License version 2 only, as |
6 // under the terms of the GNU General Public License version 2 only, as |
7 // published by the Free Software Foundation. |
7 // published by the Free Software Foundation. |
6268 "XCHG $dst.lo $dst.hi" %} |
6268 "XCHG $dst.lo $dst.hi" %} |
6269 |
6269 |
6270 ins_cost(125); |
6270 ins_cost(125); |
6271 ins_encode( bswap_long_bytes(dst) ); |
6271 ins_encode( bswap_long_bytes(dst) ); |
6272 ins_pipe( ialu_reg_reg); |
6272 ins_pipe( ialu_reg_reg); |
|
6273 %} |
|
6274 |
|
6275 instruct bytes_reverse_unsigned_short(eRegI dst) %{ |
|
6276 match(Set dst (ReverseBytesUS dst)); |
|
6277 |
|
6278 format %{ "BSWAP $dst\n\t" |
|
6279 "SHR $dst,16\n\t" %} |
|
6280 ins_encode %{ |
|
6281 __ bswapl($dst$$Register); |
|
6282 __ shrl($dst$$Register, 16); |
|
6283 %} |
|
6284 ins_pipe( ialu_reg ); |
|
6285 %} |
|
6286 |
|
6287 instruct bytes_reverse_short(eRegI dst) %{ |
|
6288 match(Set dst (ReverseBytesS dst)); |
|
6289 |
|
6290 format %{ "BSWAP $dst\n\t" |
|
6291 "SAR $dst,16\n\t" %} |
|
6292 ins_encode %{ |
|
6293 __ bswapl($dst$$Register); |
|
6294 __ sarl($dst$$Register, 16); |
|
6295 %} |
|
6296 ins_pipe( ialu_reg ); |
6273 %} |
6297 %} |
6274 |
6298 |
6275 |
6299 |
6276 //---------- Zeros Count Instructions ------------------------------------------ |
6300 //---------- Zeros Count Instructions ------------------------------------------ |
6277 |
6301 |