User avatar
teh_orph
Posts: 346
Joined: Mon Jan 30, 2012 2:09 pm
Location: London
Contact: Website

Re: LLVM backend for QPU development

Fri Jun 13, 2014 9:47 pm

For those who are interested in following this I have now added,
- basic 32-bit fp arithmetic support - no conditional operations, they can't be used as function arguments (pointers are fine though) and no sqrt/divide etc
- 2/4/8/16-way vector 32-bit fp arithmetic support
- exposure of embedded C's address spaces to facilitate the use of VPM. So you can now mark up pointers and you'll be able to directly access the scratch pad.

eg

Code: Select all

#define VPM __attribute__((address_space(1)))
typedef float float16 __attribute__((ext_vector_type(16)));

bool entry(void)
{
	float16 VPM *A = (float16 VPM *)0x40;
	A[4] = A[0] + A[1] * A[2] - A[3];
	return false;
}
makes

Code: Select all

	.file	"test.cpp.ll"
	.text
	.globl	_Z5entryv
	.align	3
	.type	_Z5entryv,@function
	.set	reorder                 // @_Z5entryv
// BB#0:
	il	acc0, 192
	load_word	acc0, acc0, 0 vpm
	il	acc1, 128
	load_word	acc1, acc1, 0 vpm
	fmul	acc0, acc1, acc0
	il	acc1, 64
	load_word	acc1, acc1, 0 vpm
	fadd	acc0, acc1, acc0
	il	acc1, 256
	load_word	acc1, acc1, 0 vpm
	fsub	acc0, acc0, acc1
	il	acc1, 320
	store_word	acc0, acc1, 0 vpm, 16
	il	ra0, 0
	bla	wra_nop, wrb_nop, lr
	.set	noreorder
$tmp0:
	.size	_Z5entryv, ($tmp0)-_Z5entryv



andoma
Posts: 18
Joined: Thu Sep 22, 2011 7:30 am
Contact: Website

Re: LLVM backend for QPU development

Tue Nov 17, 2015 2:32 pm

Just checking in here, Has there been any progress on this LLVM backend?

User avatar
teh_orph
Posts: 346
Joined: Mon Jan 30, 2012 2:09 pm
Location: London
Contact: Website

Re: LLVM backend for QPU development

Thu Nov 19, 2015 2:51 pm

Yo. I completed on my house at about the same time as the last post I placed on here...I have had very little free time since then! The fun world of DIY.
I would like to pick up this project again, as I made very good success but it's really a full time job and tbh very few people were interested.

jetibest
Posts: 21
Joined: Wed Nov 09, 2016 7:44 pm

Re: LLVM backend for QPU development

Tue Jan 09, 2018 11:54 am

Would it be possible to use this to encode/decode JPEG using some existing GPU JPEG encoder/decoder algorithms?
It would be interesting to me, because simple things like resizing a 1080p JPEG to 720p takes almost a second on my RPI, even though it is in RAM (/tmp).

If I remember correctly, decoding takes about ~200ms, and encoding about ~500ms.
Reducing that could speed things up, which would be nice for me as I'm using an MJPEG stream, which is I think is actually quite common on RPI.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23393
Joined: Sat Jul 30, 2011 7:41 pm

Re: LLVM backend for QPU development

Tue Jan 09, 2018 1:28 pm

jetibest wrote:
Tue Jan 09, 2018 11:54 am
Would it be possible to use this to encode/decode JPEG using some existing GPU JPEG encoder/decoder algorithms?
It would be interesting to me, because simple things like resizing a 1080p JPEG to 720p takes almost a second on my RPI, even though it is in RAM (/tmp).

If I remember correctly, decoding takes about ~200ms, and encoding about ~500ms.
Reducing that could speed things up, which would be nice for me as I'm using an MJPEG stream, which is I think is actually quite common on RPI.
Why not use the OpenMAX JPEG component? That will use the HW jpeg codec.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Return to “Advanced users”