/* * Copyright (c) 2015 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Copyright (c) 2004 Eliot Dresselhaus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef included_asm_mips_h #define included_asm_mips_h /* Encoding of MIPS instructions. */ /* Encoding of opcode field (op). */ #define mips_foreach_opcode \ _(SPECIAL) _(REGIMM) _(j) _(jal) _(beq) _(bne) _(blez) _(bgtz) \ _(addi) _(addiu) _(slti) _(sltiu) _(andi) _(ori) _(xori) _(lui) \ _(COP0) _(COP1) _(COP2) _(COP1X) _(beql) _(bnel) _(blezl) _(bgtzl) \ _(daddi) _(daddiu) _(ldl) _(ldr) _(SPECIAL2) _(jalx) _(MDMX) _(O37) \ _(lb) _(lh) _(lwl) _(lw) _(lbu) _(lhu) _(lwr) _(lwu) \ _(sb) _(sh) _(swl) _(sw) _(sdl) _(sdr) _(swr) _(cache) \ _(ll) _(lwc1) _(lwc2) _(pref) _(lld) _(ldc1) _(ldc2) _(ld) \ _(sc) _(swc1) _(swc2) _(o73) _(scd) _(sdc1) _(sdc2) _(sd) /* Encoding of funct field. */ #define mips_foreach_special_funct \ _(sll) _(MOVCI) _(srl) _(sra) _(sllv) _(o05) _(srlv) _(srav) \ _(jr) _(jalr) _(movz) _(movn) _(syscall) _(break) _(o16) _(sync) \ _(mfhi) _(mthi) _(mflo) _(mtlo) _(dsllv) _(o25) _(dsrlv) _(dsrav) \ _(mult) _(multu) _(div) _(divu) _(dmult) _(dmultu) _(ddiv) _(ddivu) \ _(add) _(addu) _(sub) _(subu) _(and) _(or) _(xor) _(nor) \ _(o50) _(o51) _(slt) _(sltu) _(dadd) _(daddu) _(dsub) _(dsubu) \ _(tge) _(tgeu) _(tlt) _(tltu) _(teq) _(o65) _(tne) _(o67) \ _(dsll) _(o71) _(dsrl) _(dsra) _(dsll32) _(o75) _(dsrl32) _(dsra32) /* SPECIAL2 encoding of funct field. */ #define mips_foreach_special2_funct \ _(madd) _(maddu) _(mul) _(o03) _(msub) _(msubu) _(o06) _(o07) \ _(o10) _(o11) _(o12) _(o13) _(o14) _(o15) _(o16) _(o17) \ _(o20) _(o21) _(o22) _(o23) _(o24) _(o25) _(o26) _(o27) \ _(o30) _(o31) _(o32) _(o33) _(o34) _(o35) _(o36) _(o37) \ _(clz) _(clo) _(o42) _(o43) _(dclz) _(dclo) _(o46) _(o47) \ _(o50) _(o51) _(o52) _(o53) _(o54) _(o55) _(o56) _(o57) \ _(o60) _(o61) _(o62) _(o63) _(o64) _(o65) _(o66) _(o67) \ _(o70) _(o71) _(o72) _(o73) _(o74) _(o75) _(o76) _(sdbbp) /* REGIMM encoding of rt field. */ #define mips_foreach_regimm_rt \ _(bltz) _(bgez) _(bltzl) _(bgezl) _(o04) _(o05) _(o06) _(o07) \ _(tgei) _(tgeiu) _(tltiu) _(teqi) _(o14) _(tnei) _(o16) _(o17) \ _(bltzal) _(bgezal) _(bltzall) _(bgezall) _(o24) _(o25) _(o26) _(o27) \ _(o30) _(o31) _(o32) _(o33) _(o34) _(o35) _(o36) _(o37) /* COP0 encoding of rs field. */ #define mips_foreach_cop0_rs \ _(mfc0) _(dmfc0) _(o02) _(o03) _(mtc0) _(dmtc0) _(o06) _(o07) \ _(o10) _(o11) _(o12) _(o13) _(o14) _(o15) _(o16) _(o17) \ _(C0) _(o21) _(o22) _(o23) _(o24) _(o25) _(o26) _(o27) \ _(o30) _(o31) _(o32) _(o33) _(o34) _(o35) _(o36) _(o37) /* COP0 encoding of funct when rs == RS_CO */ #define mips_foreach_cop0_funct \ _(o00) _(tlbr) _(tlbwi) _(o03) _(o04) _(o05) _(tlbwr) _(o07) \ _(tlbp) _(o11) _(o12) _(o13) _(o14) _(o15) _(o16) _(o17) \ _(o20) _(o21) _(o22) _(o23) _(o24) _(o25) _(o26) _(o27) \ _(eret) _(o31) _(o32) _(o33) _(o34) _(o35) _(o36) _(deret) \ _(wait) _(o41) _(o42) _(o43) _(o44) _(o45) _(o46) _(o47) \ _(o50) _(o51) _(o52) _(o53) _(o54) _(o55) _(o56) _(o57) \ _(o60) _(o61) _(o62) _(o63) _(o64) _(o65) _(o66) _(o67) \ _(o70) _(o71) _(o72) _(o73) _(o74) _(o75) _(o76) _(o77) /* COP1 encoding of rs field. */ #define mips_foreach_cop1_rs \ _(mfc1) _(dmfc1) _(cfc1) _(o03) _(mtc1) _(dmtc1) _(ctc1) _(o07) \ _(BC1) _(o11) _(o12) _(o13) _(o14) _(o15) _(o16) _(o17) \ _(S) _(D) _(o22) _(o23) _(W) _(L) _(o26) _(o27) \ _(o30) _(o31) _(o32) _(o33) _(o34) _(o35) _(o36) _(o37) /* COP1 encoding of funct for S and D */ #define mips_foreach_cop1_funct \