📄 spe.md
字号:
;; e500 SPE description;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.;; Contributed by Aldy Hernandez (aldy@quesejoda.com);; This file is part of GCC.;; GCC is free software; you can redistribute it and/or modify it;; under the terms of the GNU General Public License as published;; by the Free Software Foundation; either version 2, or (at your;; option) any later version.;; GCC is distributed in the hope that it will be useful, but WITHOUT;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public;; License for more details.;; You should have received a copy of the GNU General Public License;; along with GCC; see the file COPYING. If not, write to the;; Free Software Foundation, 59 Temple Place - Suite 330, Boston,;; MA 02111-1307, USA.(define_constants [(SPE_ACC_REGNO 111) (SPEFSCR_REGNO 112) (CMPDFEQ_GPR 1006) (TSTDFEQ_GPR 1007) (CMPDFGT_GPR 1008) (TSTDFGT_GPR 1009) (CMPDFLT_GPR 1010) (TSTDFLT_GPR 1011) (E500_CR_IOR_COMPARE 1012) ])(define_insn "*negsf2_gpr" [(set (match_operand:SF 0 "gpc_reg_operand" "=r") (neg:SF (match_operand:SF 1 "gpc_reg_operand" "r")))] "TARGET_HARD_FLOAT && !TARGET_FPRS" "efsneg %0,%1" [(set_attr "type" "fpsimple")])(define_insn "*abssf2_gpr" [(set (match_operand:SF 0 "gpc_reg_operand" "=r") (abs:SF (match_operand:SF 1 "gpc_reg_operand" "r")))] "TARGET_HARD_FLOAT && !TARGET_FPRS" "efsabs %0,%1" [(set_attr "type" "fpsimple")])(define_insn "*nabssf2_gpr" [(set (match_operand:SF 0 "gpc_reg_operand" "=r") (neg:SF (abs:SF (match_operand:SF 1 "gpc_reg_operand" "r"))))] "TARGET_HARD_FLOAT && !TARGET_FPRS" "efsnabs %0,%1" [(set_attr "type" "fpsimple")])(define_insn "*addsf3_gpr" [(set (match_operand:SF 0 "gpc_reg_operand" "=r") (plus:SF (match_operand:SF 1 "gpc_reg_operand" "%r") (match_operand:SF 2 "gpc_reg_operand" "r")))] "TARGET_HARD_FLOAT && !TARGET_FPRS" "efsadd %0,%1,%2" [(set_attr "type" "fp")])(define_insn "*subsf3_gpr" [(set (match_operand:SF 0 "gpc_reg_operand" "=r") (minus:SF (match_operand:SF 1 "gpc_reg_operand" "r") (match_operand:SF 2 "gpc_reg_operand" "r")))] "TARGET_HARD_FLOAT && !TARGET_FPRS" "efssub %0,%1,%2" [(set_attr "type" "fp")])(define_insn "*mulsf3_gpr" [(set (match_operand:SF 0 "gpc_reg_operand" "=r") (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%r") (match_operand:SF 2 "gpc_reg_operand" "r")))] "TARGET_HARD_FLOAT && !TARGET_FPRS" "efsmul %0,%1,%2" [(set_attr "type" "fp")])(define_insn "*divsf3_gpr" [(set (match_operand:SF 0 "gpc_reg_operand" "=r") (div:SF (match_operand:SF 1 "gpc_reg_operand" "r") (match_operand:SF 2 "gpc_reg_operand" "r")))] "TARGET_HARD_FLOAT && !TARGET_FPRS" "efsdiv %0,%1,%2" [(set_attr "type" "vecfdiv")]);; Floating point conversion instructions.(define_insn "fixuns_truncdfsi2" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (unsigned_fix:SI (match_operand:DF 1 "gpc_reg_operand" "r")))] "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" "efdctuiz %0,%1" [(set_attr "type" "fp")])(define_insn "spe_extendsfdf2" [(set (match_operand:DF 0 "gpc_reg_operand" "=r") (float_extend:DF (match_operand:SF 1 "gpc_reg_operand" "r")))] "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" "efdcfs %0,%1" [(set_attr "type" "fp")])(define_insn "spe_fixuns_truncsfsi2" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (unsigned_fix:SI (match_operand:SF 1 "gpc_reg_operand" "r")))] "TARGET_HARD_FLOAT && !TARGET_FPRS" "efsctuiz %0,%1" [(set_attr "type" "fp")])(define_insn "spe_fix_truncsfsi2" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (fix:SI (match_operand:SF 1 "gpc_reg_operand" "r")))] "TARGET_HARD_FLOAT && !TARGET_FPRS" "efsctsiz %0,%1" [(set_attr "type" "fp")])(define_insn "spe_fix_truncdfsi2" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (fix:SI (match_operand:DF 1 "gpc_reg_operand" "r")))] "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" "efdctsiz %0,%1" [(set_attr "type" "fp")])(define_insn "spe_floatunssisf2" [(set (match_operand:SF 0 "gpc_reg_operand" "=r") (unsigned_float:SF (match_operand:SI 1 "gpc_reg_operand" "r")))] "TARGET_HARD_FLOAT && !TARGET_FPRS" "efscfui %0,%1" [(set_attr "type" "fp")])(define_insn "spe_floatunssidf2" [(set (match_operand:DF 0 "gpc_reg_operand" "=r") (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))] "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" "efdcfui %0,%1" [(set_attr "type" "fp")])(define_insn "spe_floatsisf2" [(set (match_operand:SF 0 "gpc_reg_operand" "=r") (float:SF (match_operand:SI 1 "gpc_reg_operand" "r")))] "TARGET_HARD_FLOAT && !TARGET_FPRS" "efscfsi %0,%1" [(set_attr "type" "fp")])(define_insn "spe_floatsidf2" [(set (match_operand:DF 0 "gpc_reg_operand" "=r") (float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))] "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" "efdcfsi %0,%1" [(set_attr "type" "fp")]);; SPE SIMD instructions(define_insn "spe_evabs" [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r") (abs:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")))] "TARGET_SPE" "evabs %0,%1" [(set_attr "type" "vecsimple") (set_attr "length" "4")])(define_insn "spe_evandc" [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r") (and:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r") (not:V2SI (match_operand:V2SI 2 "gpc_reg_operand" "r"))))] "TARGET_SPE" "evandc %0,%1,%2" [(set_attr "type" "vecsimple") (set_attr "length" "4")])(define_insn "spe_evand" [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r") (and:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r") (match_operand:V2SI 2 "gpc_reg_operand" "r")))] "TARGET_SPE" "evand %0,%1,%2" [(set_attr "type" "vecsimple") (set_attr "length" "4")]);; Vector compare instructions(define_insn "spe_evcmpeq" [(set (match_operand:CC 0 "cc_reg_operand" "=y") (unspec:CC [(match_operand:V2SI 1 "gpc_reg_operand" "r") (match_operand:V2SI 2 "gpc_reg_operand" "r")] 500))] "TARGET_SPE" "evcmpeq %0,%1,%2" [(set_attr "type" "veccmp") (set_attr "length" "4")])(define_insn "spe_evcmpgts" [(set (match_operand:CC 0 "cc_reg_operand" "=y") (unspec:CC [(match_operand:V2SI 1 "gpc_reg_operand" "r") (match_operand:V2SI 2 "gpc_reg_operand" "r")] 501))] "TARGET_SPE" "evcmpgts %0,%1,%2" [(set_attr "type" "veccmp") (set_attr "length" "4")])(define_insn "spe_evcmpgtu" [(set (match_operand:CC 0 "cc_reg_operand" "=y") (unspec:CC [(match_operand:V2SI 1 "gpc_reg_operand" "r") (match_operand:V2SI 2 "gpc_reg_operand" "r")] 502))] "TARGET_SPE" "evcmpgtu %0,%1,%2" [(set_attr "type" "veccmp") (set_attr "length" "4")])(define_insn "spe_evcmplts" [(set (match_operand:CC 0 "cc_reg_operand" "=y") (unspec:CC [(match_operand:V2SI 1 "gpc_reg_operand" "r") (match_operand:V2SI 2 "gpc_reg_operand" "r")] 503))] "TARGET_SPE" "evcmplts %0,%1,%2" [(set_attr "type" "veccmp") (set_attr "length" "4")])(define_insn "spe_evcmpltu" [(set (match_operand:CC 0 "cc_reg_operand" "=y") (unspec:CC [(match_operand:V2SI 1 "gpc_reg_operand" "r") (match_operand:V2SI 2 "gpc_reg_operand" "r")] 504))] "TARGET_SPE" "evcmpltu %0,%1,%2" [(set_attr "type" "veccmp") (set_attr "length" "4")]);; Floating point vector compare instructions(define_insn "spe_evfscmpeq" [(set (match_operand:CC 0 "cc_reg_operand" "=y") (unspec:CC [(match_operand:V2SF 1 "gpc_reg_operand" "r") (match_operand:V2SF 2 "gpc_reg_operand" "r")] 538)) (clobber (reg:SI SPEFSCR_REGNO))] "TARGET_SPE" "evfscmpeq %0,%1,%2" [(set_attr "type" "veccmp") (set_attr "length" "4")])(define_insn "spe_evfscmpgt" [(set (match_operand:CC 0 "cc_reg_operand" "=y") (unspec:CC [(match_operand:V2SF 1 "gpc_reg_operand" "r") (match_operand:V2SF 2 "gpc_reg_operand" "r")] 539)) (clobber (reg:SI SPEFSCR_REGNO))] "TARGET_SPE" "evfscmpgt %0,%1,%2" [(set_attr "type" "veccmp") (set_attr "length" "4")])(define_insn "spe_evfscmplt" [(set (match_operand:CC 0 "cc_reg_operand" "=y") (unspec:CC [(match_operand:V2SF 1 "gpc_reg_operand" "r") (match_operand:V2SF 2 "gpc_reg_operand" "r")] 540)) (clobber (reg:SI SPEFSCR_REGNO))] "TARGET_SPE" "evfscmplt %0,%1,%2" [(set_attr "type" "veccmp") (set_attr "length" "4")])(define_insn "spe_evfststeq" [(set (match_operand:CC 0 "cc_reg_operand" "=y") (unspec:CC [(match_operand:V2SF 1 "gpc_reg_operand" "r") (match_operand:V2SF 2 "gpc_reg_operand" "r")] 541))] "TARGET_SPE" "evfststeq %0,%1,%2" [(set_attr "type" "veccmp") (set_attr "length" "4")])(define_insn "spe_evfststgt" [(set (match_operand:CC 0 "cc_reg_operand" "=y") (unspec:CC [(match_operand:V2SF 1 "gpc_reg_operand" "r") (match_operand:V2SF 2 "gpc_reg_operand" "r")] 542))] "TARGET_SPE" "evfststgt %0,%1,%2" [(set_attr "type" "veccmp") (set_attr "length" "4")])(define_insn "spe_evfststlt" [(set (match_operand:CC 0 "cc_reg_operand" "=y") (unspec:CC [(match_operand:V2SF 1 "gpc_reg_operand" "r") (match_operand:V2SF 2 "gpc_reg_operand" "r")] 543))] "TARGET_SPE" "evfststlt %0,%1,%2" [(set_attr "type" "veccmp") (set_attr "length" "4")]);; End of vector compare instructions(define_insn "spe_evcntlsw" [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r") (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")] 505))] "TARGET_SPE" "evcntlsw %0,%1" [(set_attr "type" "vecsimple") (set_attr "length" "4")])(define_insn "spe_evcntlzw" [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r") (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")] 506))] "TARGET_SPE" "evcntlzw %0,%1" [(set_attr "type" "vecsimple") (set_attr "length" "4")])(define_insn "spe_eveqv" [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r") (not:V2SI (xor:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r") (match_operand:V2SI 2 "gpc_reg_operand" "r"))))] "TARGET_SPE" "eveqv %0,%1,%2" [(set_attr "type" "vecsimple") (set_attr "length" "4")])(define_insn "spe_evextsb" [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r") (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")] 507))] "TARGET_SPE" "evextsb %0,%1" [(set_attr "type" "vecsimple") (set_attr "length" "4")])(define_insn "spe_evextsh" [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r") (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")] 508))] "TARGET_SPE" "evextsh %0,%1" [(set_attr "type" "vecsimple") (set_attr "length" "4")])(define_insn "spe_evlhhesplat" [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r") (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b") (match_operand:QI 2 "immediate_operand" "i")))) (unspec [(const_int 0)] 509)] "TARGET_SPE && INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 31" "evlhhesplat %0,%2*2(%1)" [(set_attr "type" "vecload") (set_attr "length" "4")])(define_insn "spe_evlhhesplatx" [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r") (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b") (match_operand:SI 2 "gpc_reg_operand" "r")))) (unspec [(const_int 0)] 510)] "TARGET_SPE" "evlhhesplatx %0,%1,%2" [(set_attr "type" "vecload") (set_attr "length" "4")])(define_insn "spe_evlhhossplat" [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r") (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b") (match_operand:QI 2 "immediate_operand" "i")))) (unspec [(const_int 0)] 511)] "TARGET_SPE && INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 31" "evlhhossplat %0,%2*2(%1)" [(set_attr "type" "vecload") (set_attr "length" "4")])(define_insn "spe_evlhhossplatx" [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r") (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b") (match_operand:SI 2 "gpc_reg_operand" "r")))) (unspec [(const_int 0)] 512)] "TARGET_SPE"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -