|
1 | | -// Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. |
2 | | -// Copyright (c) 2020, Arm Limited. All rights reserved. |
| 1 | +// Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. |
| 2 | +// Copyright (c) 2020, 2021, Arm Limited. All rights reserved. |
3 | 3 | // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | // |
5 | 5 | // This code is free software; you can redistribute it and/or modify it |
@@ -97,28 +97,43 @@ dnl $1 $2 |
97 | 97 | REINTERPRET(D, 8) |
98 | 98 | REINTERPRET(X, 16) |
99 | 99 | dnl |
100 | | -define(`REINTERPRET_X', ` |
101 | | -instruct reinterpret$1`'2$2`'(vec$2 dst, vec$1 src) |
| 100 | + |
| 101 | +instruct reinterpretD2X(vecX dst, vecD src) |
102 | 102 | %{ |
103 | | - predicate(n->bottom_type()->is_vect()->length_in_bytes() == $3 && |
104 | | - n->in(1)->bottom_type()->is_vect()->length_in_bytes() == $4); |
| 103 | + predicate(n->bottom_type()->is_vect()->length_in_bytes() == 16 && |
| 104 | + n->in(1)->bottom_type()->is_vect()->length_in_bytes() == 8); |
105 | 105 | match(Set dst (VectorReinterpret src)); |
106 | 106 | ins_cost(INSN_COST); |
107 | | - format %{ " # reinterpret $dst,$src" %} |
| 107 | + format %{ " # reinterpret $dst,$src\t# D2X" %} |
108 | 108 | ins_encode %{ |
109 | | - // If register is the same, then move is not needed. |
| 109 | + // If registers are the same, no register move is required - the |
| 110 | + // upper 64 bits of 'src' are expected to have been initialized |
| 111 | + // to zero. |
110 | 112 | if (as_FloatRegister($dst$$reg) != as_FloatRegister($src$$reg)) { |
111 | 113 | __ orr(as_FloatRegister($dst$$reg), __ T8B, |
112 | 114 | as_FloatRegister($src$$reg), |
113 | 115 | as_FloatRegister($src$$reg)); |
114 | 116 | } |
115 | 117 | %} |
116 | 118 | ins_pipe(vlogical64); |
117 | | -%}')dnl |
118 | | -dnl $1 $2 $3 $4 |
119 | | -REINTERPRET_X(D, X, 16, 8) |
120 | | -REINTERPRET_X(X, D, 8, 16) |
121 | | -dnl |
| 119 | +%} |
| 120 | + |
| 121 | +instruct reinterpretX2D(vecD dst, vecX src) |
| 122 | +%{ |
| 123 | + predicate(n->bottom_type()->is_vect()->length_in_bytes() == 8 && |
| 124 | + n->in(1)->bottom_type()->is_vect()->length_in_bytes() == 16); |
| 125 | + match(Set dst (VectorReinterpret src)); |
| 126 | + ins_cost(INSN_COST); |
| 127 | + format %{ " # reinterpret $dst,$src\t# X2D" %} |
| 128 | + ins_encode %{ |
| 129 | + // Resize the vector from 128-bits to 64-bits. The higher 64-bits of |
| 130 | + // the "dst" register must be cleared to zero. |
| 131 | + __ orr(as_FloatRegister($dst$$reg), __ T8B, |
| 132 | + as_FloatRegister($src$$reg), |
| 133 | + as_FloatRegister($src$$reg)); |
| 134 | + %} |
| 135 | + ins_pipe(vlogical64); |
| 136 | +%} |
122 | 137 |
|
123 | 138 | // ------------------------------ Vector cast ------------------------------- |
124 | 139 | dnl |
|
0 commit comments