Mercurial > hg > truffle
comparison src/cpu/x86/vm/x86_64.ad @ 14271:7e8bd81ce93e
8031743: C2: loadI2L_immI broken for negative memory values
Summary: Restrict loadI2L_imm optimizations to positive values of mask
Reviewed-by: kvn, dlong
author | iveresov |
---|---|
date | Tue, 21 Jan 2014 20:05:28 -0800 |
parents | 59e8ad757e19 |
children | 45467c53f178 4d4ea046d32a |
comparison
equal
deleted
inserted
replaced
14270:9918c6fb4770 | 14271:7e8bd81ce93e |
---|---|
3084 op_cost(10); | 3084 op_cost(10); |
3085 format %{ %} | 3085 format %{ %} |
3086 interface(CONST_INTER); | 3086 interface(CONST_INTER); |
3087 %} | 3087 %} |
3088 | 3088 |
3089 // Int Immediate non-negative | |
3090 operand immU31() | |
3091 %{ | |
3092 predicate(n->get_int() >= 0); | |
3093 match(ConI); | |
3094 | |
3095 op_cost(0); | |
3096 format %{ %} | |
3097 interface(CONST_INTER); | |
3098 %} | |
3099 | |
3089 // Constant for long shifts | 3100 // Constant for long shifts |
3090 operand immI_32() | 3101 operand immI_32() |
3091 %{ | 3102 %{ |
3092 predicate( n->get_int() == 32 ); | 3103 predicate( n->get_int() == 32 ); |
3093 match(ConI); | 3104 match(ConI); |
5040 __ movzwq($dst$$Register, $mem$$Address); | 5051 __ movzwq($dst$$Register, $mem$$Address); |
5041 %} | 5052 %} |
5042 ins_pipe(ialu_reg_mem); | 5053 ins_pipe(ialu_reg_mem); |
5043 %} | 5054 %} |
5044 | 5055 |
5045 // Load Integer with a 32-bit mask into Long Register | 5056 // Load Integer with a 31-bit mask into Long Register |
5046 instruct loadI2L_immI(rRegL dst, memory mem, immI mask, rFlagsReg cr) %{ | 5057 instruct loadI2L_immU31(rRegL dst, memory mem, immU31 mask, rFlagsReg cr) %{ |
5047 match(Set dst (ConvI2L (AndI (LoadI mem) mask))); | 5058 match(Set dst (ConvI2L (AndI (LoadI mem) mask))); |
5048 effect(KILL cr); | 5059 effect(KILL cr); |
5049 | 5060 |
5050 format %{ "movl $dst, $mem\t# int & 32-bit mask -> long\n\t" | 5061 format %{ "movl $dst, $mem\t# int & 31-bit mask -> long\n\t" |
5051 "andl $dst, $mask" %} | 5062 "andl $dst, $mask" %} |
5052 ins_encode %{ | 5063 ins_encode %{ |
5053 Register Rdst = $dst$$Register; | 5064 Register Rdst = $dst$$Register; |
5054 __ movl(Rdst, $mem$$Address); | 5065 __ movl(Rdst, $mem$$Address); |
5055 __ andl(Rdst, $mask$$constant); | 5066 __ andl(Rdst, $mask$$constant); |