[PATCH] Fix PR 18503, "sse2_movhpd" issues
Uros Bizjak
uros@kss-loka.si
Wed Nov 17 13:52:00 GMT 2004
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.
More information about the Gcc-patches
mailing list