This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR 18503, "sse2_movhpd" issues


Hello!

After fixing "sse2_movsd", it looks that an error with sse2 doubles, when source is compiled without optimization, happens because "sse2_movhpd" is interfering with sse2_movsd. After pattern was disabled, the result was OK and following code was produced:

_mm_move_sd:
       pushl   %ebp
       movl    %esp, %ebp
       subl    $40, %esp
       movapd  %xmm0, -24(%ebp)
       movapd  %xmm1, -40(%ebp)
       movapd  -24(%ebp), %xmm0
       movlpd  -40(%ebp), %xmm0
       leave
       ret

However, It looks that "sse2_movhpd" pattern is wrong. Could someone more experienced have a look at this (probably wrong) pattern:

(define_insn "sse2_movhpd"
[(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,m")
(vec_merge:V2DF
(match_operand:V2DF 1 "nonimmediate_operand" "0,0")
(match_operand:V2DF 2 "nonimmediate_operand" "m,x")
(const_int 2)))]
"TARGET_SSE2 && (GET_CODE (operands[1]) == MEM || GET_CODE (operands[2]) == MEM)"
"movhpd\t{%2, %0|%0, %2}"
[(set_attr "type" "ssecvt")
(set_attr "mode" "V2DF")])


Shouldn't there be some kind of vec_select, perhaps

(define_insn "sse2_movhpd"
 [(set (match_operand:DF "nonimmediate_operand" "=x,m")
   (vec_select:DF
    (match_operand:V2DF 1 "nonimmediate_operand" "m,x")
    (parallel [(const_int 1)])))]
 "TARGET_SSE2 && (GET_CODE (operands[1]) == MEM"
 "movhpd\t{%1, %0|%0, %1}"
 [(set_attr "type" "ssecvt")
  (set_attr "mode" "V2DF")])

Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]