1.1 --- a/src/cpu/x86/vm/x86_64.ad Mon May 11 18:30:13 2009 -0700 1.2 +++ b/src/cpu/x86/vm/x86_64.ad Wed May 13 00:45:22 2009 -0700 1.3 @@ -6459,6 +6459,18 @@ 1.4 ins_pipe(ialu_reg_mem); 1.5 %} 1.6 1.7 +// Load Short (16 bit signed) to Byte (8 bit signed) 1.8 +instruct loadS2B(rRegI dst, memory mem, immI_24 twentyfour) %{ 1.9 + match(Set dst (RShiftI (LShiftI (LoadS mem) twentyfour) twentyfour)); 1.10 + 1.11 + ins_cost(125); 1.12 + format %{ "movsbl $dst, $mem\t# short -> byte" %} 1.13 + ins_encode %{ 1.14 + __ movsbl($dst$$Register, $mem$$Address); 1.15 + %} 1.16 + ins_pipe(ialu_reg_mem); 1.17 +%} 1.18 + 1.19 // Load Short (16 bit signed) into Long Register 1.20 instruct loadS2L(rRegL dst, memory mem) 1.21 %{ 1.22 @@ -6489,6 +6501,18 @@ 1.23 ins_pipe(ialu_reg_mem); 1.24 %} 1.25 1.26 +// Load Unsigned Short/Char (16 bit UNsigned) to Byte (8 bit signed) 1.27 +instruct loadUS2B(rRegI dst, memory mem, immI_24 twentyfour) %{ 1.28 + match(Set dst (RShiftI (LShiftI (LoadUS mem) twentyfour) twentyfour)); 1.29 + 1.30 + ins_cost(125); 1.31 + format %{ "movsbl $dst, $mem\t# ushort -> byte" %} 1.32 + ins_encode %{ 1.33 + __ movsbl($dst$$Register, $mem$$Address); 1.34 + %} 1.35 + ins_pipe(ialu_reg_mem); 1.36 +%} 1.37 + 1.38 // Load Unsigned Short/Char (16 bit UNsigned) into Long Register 1.39 instruct loadUS2L(rRegL dst, memory mem) 1.40 %{ 1.41 @@ -6519,6 +6543,54 @@ 1.42 ins_pipe(ialu_reg_mem); 1.43 %} 1.44 1.45 +// Load Integer (32 bit signed) to Byte (8 bit signed) 1.46 +instruct loadI2B(rRegI dst, memory mem, immI_24 twentyfour) %{ 1.47 + match(Set dst (RShiftI (LShiftI (LoadI mem) twentyfour) twentyfour)); 1.48 + 1.49 + ins_cost(125); 1.50 + format %{ "movsbl $dst, $mem\t# int -> byte" %} 1.51 + ins_encode %{ 1.52 + __ movsbl($dst$$Register, $mem$$Address); 1.53 + %} 1.54 + ins_pipe(ialu_reg_mem); 1.55 +%} 1.56 + 1.57 +// Load Integer (32 bit signed) to Unsigned Byte (8 bit UNsigned) 1.58 +instruct loadI2UB(rRegI dst, memory mem, immI_255 mask) %{ 1.59 + match(Set dst (AndI (LoadI mem) mask)); 1.60 + 1.61 + ins_cost(125); 1.62 + format %{ "movzbl $dst, $mem\t# int -> ubyte" %} 1.63 + ins_encode %{ 1.64 + __ movzbl($dst$$Register, $mem$$Address); 1.65 + %} 1.66 + ins_pipe(ialu_reg_mem); 1.67 +%} 1.68 + 1.69 +// Load Integer (32 bit signed) to Short (16 bit signed) 1.70 +instruct loadI2S(rRegI dst, memory mem, immI_16 sixteen) %{ 1.71 + match(Set dst (RShiftI (LShiftI (LoadI mem) sixteen) sixteen)); 1.72 + 1.73 + ins_cost(125); 1.74 + format %{ "movswl $dst, $mem\t# int -> short" %} 1.75 + ins_encode %{ 1.76 + __ movswl($dst$$Register, $mem$$Address); 1.77 + %} 1.78 + ins_pipe(ialu_reg_mem); 1.79 +%} 1.80 + 1.81 +// Load Integer (32 bit signed) to Unsigned Short/Char (16 bit UNsigned) 1.82 +instruct loadI2US(rRegI dst, memory mem, immI_65535 mask) %{ 1.83 + match(Set dst (AndI (LoadI mem) mask)); 1.84 + 1.85 + ins_cost(125); 1.86 + format %{ "movzwl $dst, $mem\t# int -> ushort/char" %} 1.87 + ins_encode %{ 1.88 + __ movzwl($dst$$Register, $mem$$Address); 1.89 + %} 1.90 + ins_pipe(ialu_reg_mem); 1.91 +%} 1.92 + 1.93 // Load Integer into Long Register 1.94 instruct loadI2L(rRegL dst, memory mem) 1.95 %{