Skip to content

core:ppc Fix 2 interleave logic errors in vsx_utils.hpp - #10078

Merged
opencv-pushbot merged 1 commit into
opencv:masterfrom
justdoitqd:master
Nov 16, 2017
Merged

opencv-pushbot merged 1 commit into
opencv:masterfrom
justdoitqd:master

Conversation

@justdoitqd

@justdoitqd justdoitqd commented Nov 13, 2017 •

Copy link
Copy Markdown
Contributor

When elements are 64 bits, the vec_st_interleave()/vec_ld_deinterleave()
doesn't interleave 4 elements correctly.

For vec_st_interleave(), following is saved into mem:
a0 b0 a1 b1 c0 d0 c1 d1
-> we expected:
a0 b0 c0 d0 a1 b1 c1 d1

for vec_ld_deinterleave(), following is loaded into a b c d for memory
string { 1 2 3 4 5 6 7 8 }:
a: 1 3
b: 2 4
c: 5 7
d: 6 8
-> we expected:
a: 1 5
b: 2 6
c: 3 7
d: 4 8

This patch corrects this behavior.

Signed-off-by: Simon Guo [email protected]

docker_image:Custom=powerpc64le

When elements are 64 bits, the vec_st_interleave()/vec_ld_deinterleave()
doesn't interleave 4 elements correctly.

For vec_st_interleave(), following is saved into mem:
	a0 b0 a1 b1 c0 d0 c1 d1
     -> we expected:
	a0 b0 c0 d0 a1 b1 c1 d1

for vec_ld_deinterleave(), following is loaded into a b c d for memory
string { 1 2 3 4 5 6 7 8 }:
	a: 1 3
	b: 2 4
	c: 5 7
	d: 6 8
   -> we expected:
   	a: 1 5
	b: 2 6
	c: 3 7
	d: 4 8

This patch corrects this behavior.

Signed-off-by: Simon Guo <[email protected]>
@alalek

alalek commented Nov 13, 2017

Copy link
Copy Markdown
Member

/cc @seiko2plus

@seiko2plus

Copy link
Copy Markdown
Contributor

@justdoitqd What a mistake, I'm so embarrassed. can I combine your patch into #9907? since I already did many improvements on vsx_utils.hpp and also if I'm not mistaken this issue isn't going to be affected by the current implementation because universal intrinsics de&interleave supports all types except 64-bit so no need to immediate merge.

Thank you so much.

@justdoitqd

Copy link
Copy Markdown
Contributor Author

@seiko2plus
Sure. Please go ahead to merge my patch.
thxs

  • Simon

@mshabunin mshabunin self-assigned this Nov 16, 2017
@opencv-pushbot
opencv-pushbot merged commit 2610a47 into opencv:master Nov 16, 2017
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants