Aart Bik | f8f5a16 | 2017-02-06 15:35:29 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include "code_generator_mips64.h" |
| 18 | |
| 19 | namespace art { |
| 20 | namespace mips64 { |
| 21 | |
| 22 | // NOLINT on __ macro to suppress wrong warning/fix (misc-macro-parentheses) from clang-tidy. |
| 23 | #define __ down_cast<Mips64Assembler*>(GetAssembler())-> // NOLINT |
| 24 | |
| 25 | void LocationsBuilderMIPS64::VisitVecReplicateScalar(HVecReplicateScalar* instruction) { |
| 26 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 27 | } |
| 28 | |
| 29 | void InstructionCodeGeneratorMIPS64::VisitVecReplicateScalar(HVecReplicateScalar* instruction) { |
| 30 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 31 | } |
| 32 | |
| 33 | void LocationsBuilderMIPS64::VisitVecSetScalars(HVecSetScalars* instruction) { |
| 34 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 35 | } |
| 36 | |
| 37 | void InstructionCodeGeneratorMIPS64::VisitVecSetScalars(HVecSetScalars* instruction) { |
| 38 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 39 | } |
| 40 | |
| 41 | void LocationsBuilderMIPS64::VisitVecSumReduce(HVecSumReduce* instruction) { |
| 42 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 43 | } |
| 44 | |
| 45 | void InstructionCodeGeneratorMIPS64::VisitVecSumReduce(HVecSumReduce* instruction) { |
| 46 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 47 | } |
| 48 | |
| 49 | // Helper to set up locations for vector unary operations. |
| 50 | static void CreateVecUnOpLocations(ArenaAllocator* arena, HVecUnaryOperation* instruction) { |
| 51 | LocationSummary* locations = new (arena) LocationSummary(instruction); |
| 52 | switch (instruction->GetPackedType()) { |
| 53 | case Primitive::kPrimBoolean: |
| 54 | case Primitive::kPrimByte: |
| 55 | case Primitive::kPrimChar: |
| 56 | case Primitive::kPrimShort: |
| 57 | case Primitive::kPrimInt: |
| 58 | case Primitive::kPrimFloat: |
| 59 | case Primitive::kPrimDouble: |
| 60 | DCHECK(locations); |
| 61 | break; |
| 62 | default: |
| 63 | LOG(FATAL) << "Unsupported SIMD type"; |
| 64 | UNREACHABLE(); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | void LocationsBuilderMIPS64::VisitVecCnv(HVecCnv* instruction) { |
| 69 | CreateVecUnOpLocations(GetGraph()->GetArena(), instruction); |
| 70 | } |
| 71 | |
| 72 | void InstructionCodeGeneratorMIPS64::VisitVecCnv(HVecCnv* instruction) { |
| 73 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 74 | } |
| 75 | |
| 76 | void LocationsBuilderMIPS64::VisitVecNeg(HVecNeg* instruction) { |
| 77 | CreateVecUnOpLocations(GetGraph()->GetArena(), instruction); |
| 78 | } |
| 79 | |
| 80 | void InstructionCodeGeneratorMIPS64::VisitVecNeg(HVecNeg* instruction) { |
| 81 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 82 | } |
| 83 | |
| 84 | void LocationsBuilderMIPS64::VisitVecNot(HVecNot* instruction) { |
| 85 | CreateVecUnOpLocations(GetGraph()->GetArena(), instruction); |
| 86 | } |
| 87 | |
| 88 | void InstructionCodeGeneratorMIPS64::VisitVecNot(HVecNot* instruction) { |
| 89 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 90 | } |
| 91 | |
| 92 | // Helper to set up locations for vector binary operations. |
| 93 | static void CreateVecBinOpLocations(ArenaAllocator* arena, HVecBinaryOperation* instruction) { |
| 94 | LocationSummary* locations = new (arena) LocationSummary(instruction); |
| 95 | switch (instruction->GetPackedType()) { |
| 96 | case Primitive::kPrimBoolean: |
| 97 | case Primitive::kPrimByte: |
| 98 | case Primitive::kPrimChar: |
| 99 | case Primitive::kPrimShort: |
| 100 | case Primitive::kPrimInt: |
| 101 | case Primitive::kPrimFloat: |
| 102 | case Primitive::kPrimDouble: |
| 103 | DCHECK(locations); |
| 104 | break; |
| 105 | default: |
| 106 | LOG(FATAL) << "Unsupported SIMD type"; |
| 107 | UNREACHABLE(); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | void LocationsBuilderMIPS64::VisitVecAdd(HVecAdd* instruction) { |
| 112 | CreateVecBinOpLocations(GetGraph()->GetArena(), instruction); |
| 113 | } |
| 114 | |
| 115 | void InstructionCodeGeneratorMIPS64::VisitVecAdd(HVecAdd* instruction) { |
| 116 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 117 | } |
| 118 | |
| 119 | void LocationsBuilderMIPS64::VisitVecSub(HVecSub* instruction) { |
| 120 | CreateVecBinOpLocations(GetGraph()->GetArena(), instruction); |
| 121 | } |
| 122 | |
| 123 | void InstructionCodeGeneratorMIPS64::VisitVecSub(HVecSub* instruction) { |
| 124 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 125 | } |
| 126 | |
| 127 | void LocationsBuilderMIPS64::VisitVecMul(HVecMul* instruction) { |
| 128 | CreateVecBinOpLocations(GetGraph()->GetArena(), instruction); |
| 129 | } |
| 130 | |
| 131 | void InstructionCodeGeneratorMIPS64::VisitVecMul(HVecMul* instruction) { |
| 132 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 133 | } |
| 134 | |
| 135 | void LocationsBuilderMIPS64::VisitVecDiv(HVecDiv* instruction) { |
| 136 | CreateVecBinOpLocations(GetGraph()->GetArena(), instruction); |
| 137 | } |
| 138 | |
| 139 | void InstructionCodeGeneratorMIPS64::VisitVecDiv(HVecDiv* instruction) { |
| 140 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 141 | } |
| 142 | |
| 143 | void LocationsBuilderMIPS64::VisitVecAnd(HVecAnd* instruction) { |
| 144 | CreateVecBinOpLocations(GetGraph()->GetArena(), instruction); |
| 145 | } |
| 146 | |
| 147 | void InstructionCodeGeneratorMIPS64::VisitVecAnd(HVecAnd* instruction) { |
| 148 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 149 | } |
| 150 | |
| 151 | void LocationsBuilderMIPS64::VisitVecAndNot(HVecAndNot* instruction) { |
| 152 | CreateVecBinOpLocations(GetGraph()->GetArena(), instruction); |
| 153 | } |
| 154 | |
| 155 | void InstructionCodeGeneratorMIPS64::VisitVecAndNot(HVecAndNot* instruction) { |
| 156 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 157 | } |
| 158 | |
| 159 | void LocationsBuilderMIPS64::VisitVecOr(HVecOr* instruction) { |
| 160 | CreateVecBinOpLocations(GetGraph()->GetArena(), instruction); |
| 161 | } |
| 162 | |
| 163 | void InstructionCodeGeneratorMIPS64::VisitVecOr(HVecOr* instruction) { |
| 164 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 165 | } |
| 166 | |
| 167 | void LocationsBuilderMIPS64::VisitVecXor(HVecXor* instruction) { |
| 168 | CreateVecBinOpLocations(GetGraph()->GetArena(), instruction); |
| 169 | } |
| 170 | |
| 171 | void InstructionCodeGeneratorMIPS64::VisitVecXor(HVecXor* instruction) { |
| 172 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 173 | } |
| 174 | |
| 175 | // Helper to set up locations for vector shift operations. |
| 176 | static void CreateVecShiftLocations(ArenaAllocator* arena, HVecBinaryOperation* instruction) { |
| 177 | LocationSummary* locations = new (arena) LocationSummary(instruction); |
| 178 | switch (instruction->GetPackedType()) { |
| 179 | case Primitive::kPrimByte: |
| 180 | case Primitive::kPrimChar: |
| 181 | case Primitive::kPrimShort: |
| 182 | case Primitive::kPrimInt: |
| 183 | case Primitive::kPrimLong: |
| 184 | DCHECK(locations); |
| 185 | break; |
| 186 | default: |
| 187 | LOG(FATAL) << "Unsupported SIMD type"; |
| 188 | UNREACHABLE(); |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | void LocationsBuilderMIPS64::VisitVecShl(HVecShl* instruction) { |
| 193 | CreateVecShiftLocations(GetGraph()->GetArena(), instruction); |
| 194 | } |
| 195 | |
| 196 | void InstructionCodeGeneratorMIPS64::VisitVecShl(HVecShl* instruction) { |
| 197 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 198 | } |
| 199 | |
| 200 | void LocationsBuilderMIPS64::VisitVecShr(HVecShr* instruction) { |
| 201 | CreateVecShiftLocations(GetGraph()->GetArena(), instruction); |
| 202 | } |
| 203 | |
| 204 | void InstructionCodeGeneratorMIPS64::VisitVecShr(HVecShr* instruction) { |
| 205 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 206 | } |
| 207 | |
| 208 | void LocationsBuilderMIPS64::VisitVecUShr(HVecUShr* instruction) { |
| 209 | CreateVecShiftLocations(GetGraph()->GetArena(), instruction); |
| 210 | } |
| 211 | |
| 212 | void InstructionCodeGeneratorMIPS64::VisitVecUShr(HVecUShr* instruction) { |
| 213 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 214 | } |
| 215 | |
| 216 | void LocationsBuilderMIPS64::VisitVecLoad(HVecLoad* instruction) { |
| 217 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 218 | } |
| 219 | |
| 220 | void InstructionCodeGeneratorMIPS64::VisitVecLoad(HVecLoad* instruction) { |
| 221 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 222 | } |
| 223 | |
| 224 | void LocationsBuilderMIPS64::VisitVecStore(HVecStore* instruction) { |
| 225 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 226 | } |
| 227 | |
| 228 | void InstructionCodeGeneratorMIPS64::VisitVecStore(HVecStore* instruction) { |
| 229 | LOG(FATAL) << "No SIMD for " << instruction->GetId(); |
| 230 | } |
| 231 | |
| 232 | #undef __ |
| 233 | |
| 234 | } // namespace mips64 |
| 235 | } // namespace art |