|
| 1 | +(define_mode_attr vectab [(V2HI "") (V4HI "d") (V2SI "d")]) |
| 2 | +(define_mode_attr vmvtab [(V2HI "add") (V4HI "vadd2") (V2SI "vadd2")]) |
| 3 | + |
| 4 | +;; ARCv3:32 specific instructions. |
| 5 | + |
| 6 | +(define_insn_and_split "*arc32_movdi" |
| 7 | + [(set (match_operand:DI 0 "arc64_dest_operand" "=r,r,Ustor") |
| 8 | + (match_operand:DI 1 "nonimmediate_operand" "r,m,r"))] |
| 9 | + "!TARGET_64BIT |
| 10 | + && (register_operand (operands[0], DImode) |
| 11 | + || register_operand (operands[1], DImode))" |
| 12 | + "@ |
| 13 | + vadd2\\t%0,%1,0 |
| 14 | + ldd%U1\\t%0,%1 |
| 15 | + std%U0\\t%1,%0" |
| 16 | + "&& reload_completed && arc64_split_double_move_p (operands, DImode)" |
| 17 | + [(const_int 0)] |
| 18 | + { |
| 19 | + arc64_split_double_move (operands, DImode); |
| 20 | + DONE; |
| 21 | + } |
| 22 | + [(set_attr "type" "vadd,ld,st") |
| 23 | + (set_attr "length" "4,*,*")]) |
| 24 | + |
| 25 | +(define_insn_and_split "*arc32_mov<mode>" |
| 26 | + [(set (match_operand:VALL 0 "arc64_dest_operand" "=r,r,Ustor") |
| 27 | + (match_operand:VALL 1 "nonimmediate_operand" "r,m,r"))] |
| 28 | + "!TARGET_64BIT && TARGET_SIMD |
| 29 | + && (register_operand (operands[0], <MODE>mode) |
| 30 | + || register_operand (operands[1], <MODE>mode))" |
| 31 | + "@ |
| 32 | + <vmvtab>\\t%0,%1,0 |
| 33 | + ld<vectab>%U1\\t%0,%1 |
| 34 | + st<vectab>%U0\\t%1,%0" |
| 35 | + "&& reload_completed && arc64_split_double_move_p (operands, <MODE>mode)" |
| 36 | + [(const_int 0)] |
| 37 | + { |
| 38 | + arc64_split_double_move (operands, <MODE>mode); |
| 39 | + DONE; |
| 40 | + } |
| 41 | + [(set_attr "type" "vadd,ld,st") |
| 42 | + (set_attr "length" "4,*,*")]) |
| 43 | + |
| 44 | +(define_insn "arc32_<su>vmach_hi" |
| 45 | + [(set (match_operand:V2SI 0 "register_operand" "=r") |
| 46 | + (plus:V2SI |
| 47 | + (mult:V2SI |
| 48 | + (ANY_EXTEND:V2SI |
| 49 | + (vec_select:V2HI (match_operand:V4HI 1 "register_operand" "r") |
| 50 | + (parallel [(const_int 2) (const_int 3)]))) |
| 51 | + (ANY_EXTEND:V2SI |
| 52 | + (vec_select:V2HI (match_operand:V4HI 2 "register_operand" "r") |
| 53 | + (parallel [(const_int 2) (const_int 3)])))) |
| 54 | + (reg:V2SI R58_REGNUM))) |
| 55 | + (clobber (reg:V2SI R58_REGNUM))] |
| 56 | + "TARGET_SIMD && !TARGET_64BIT" |
| 57 | + "vmac2h<su_optab>%?\\t%0,%H1,%H2" |
| 58 | + [(set_attr "length" "4") |
| 59 | + (set_attr "type" "vmac2h")]) |
| 60 | + |
| 61 | + (define_insn "arc32_<su>vmpy2h_hi" |
| 62 | + [(set (match_operand:V2SI 0 "register_operand" "=r") |
| 63 | + (mult:V2SI |
| 64 | + (ANY_EXTEND:V2SI |
| 65 | + (vec_select:V2HI |
| 66 | + (match_operand:V4HI 1 "register_operand" "r") |
| 67 | + (parallel [(const_int 2) (const_int 3)]))) |
| 68 | + (ANY_EXTEND:V2SI |
| 69 | + (vec_select:V2HI |
| 70 | + (match_operand:V4HI 2 "register_operand" "r") |
| 71 | + (parallel [(const_int 2) (const_int 3)]))))) |
| 72 | + (clobber (reg:V2SI R58_REGNUM))] |
| 73 | + "TARGET_SIMD && !TARGET_64BIT" |
| 74 | + "vmpy2h<su_optab>\\t%0,%H1,%H2" |
| 75 | + [(set_attr "length" "4") |
| 76 | + (set_attr "type" "vmpy2h")]) |
| 77 | + |
| 78 | +(define_insn_and_split "<optab>v2si3" |
| 79 | + [(set (match_operand:V2SI 0 "register_operand" "=r") |
| 80 | + (LSHIFT:V2SI (match_operand:V2SI 1 "register_operand" "r") |
| 81 | + (match_operand:SI 2 "nonmemory_operand" "ri")))] |
| 82 | + "!TARGET_64BIT" |
| 83 | + "#" |
| 84 | + "&& reload_completed" |
| 85 | + [(set (match_dup 3) (LSHIFT:SI (match_dup 4) (match_dup 2))) |
| 86 | + (set (match_dup 5) (LSHIFT:SI (match_dup 6) (match_dup 2)))] |
| 87 | + { |
| 88 | + operands[3] = gen_lowpart (SImode, operands[0]); |
| 89 | + operands[5] = gen_highpart (SImode, operands[0]); |
| 90 | + operands[4] = gen_lowpart (SImode, operands[1]); |
| 91 | + operands[6] = gen_highpart (SImode, operands[1]); |
| 92 | + if (REG_P (operands[2]) |
| 93 | + && REGNO (operands[2]) == REGNO (operands[3])) |
| 94 | + { |
| 95 | + std::swap (operands[3], operands[5]); |
| 96 | + std::swap (operands[4], operands[6]); |
| 97 | + } |
| 98 | + } |
| 99 | + [(set_attr "length" "8") |
| 100 | + (set_attr "type" "<mntab>")]) |
| 101 | + |
0 commit comments