[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] How to add my implementation of the fmadds instruction to QEM
From: |
G 3 |
Subject: |
[Qemu-ppc] How to add my implementation of the fmadds instruction to QEMU |
Date: |
Mon, 26 Sep 2016 21:05:22 -0400 |
I made my own experimental implementation of the fmadds instruction
that I would like to add to QEMU. How would I do this?
My implementation would probably look like this:
void fmadds(float *frD, float frA, float frC, float frB)
{
*frD = frA * frC + frB;
}
I then want to see if this implementation will make things faster.
This code will test my implementation:
#include <stdio.h>
#include <time.h>
/*
fmadds basically does this frD = frA * frC + frB
*/
int main (int argc, const char * argv[]) {
const int iteration_count = 100000000;
double iter, frD, frA, frB, frC;
clock_t start_time, end_time;
frA = 10;
frB = 5;
frC = 2;
start_time = clock();
for(iter = 0; iter < iteration_count; iter++)
{
asm volatile("fmadds %0, %1, %2, %3" : "=f" (frD) :
"f" (frA), "f" (frC), "f" (frB));
}
end_time = clock();
printf("frD:%f frA:%f frB:%f frC:%f\n", frD, frA, frB, frC);
printf("Time elapsed: %0.2f seconds\n", (float)(end_time -
start_time) / CLOCKS_PER_SEC);
return 0;
}
- [Qemu-ppc] How to add my implementation of the fmadds instruction to QEMU,
G 3 <=
- Re: [Qemu-ppc] How to add my implementation of the fmadds instruction to QEMU, David Gibson, 2016/09/26
- Re: [Qemu-ppc] [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU, Peter Maydell, 2016/09/27
- Re: [Qemu-ppc] [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU, G 3, 2016/09/27
- Re: [Qemu-ppc] [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU, Peter Maydell, 2016/09/27
- Re: [Qemu-ppc] [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU, Eric Blake, 2016/09/27
- Re: [Qemu-ppc] [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU, G 3, 2016/09/27
- Re: [Qemu-ppc] [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU, Peter Maydell, 2016/09/27
- Re: [Qemu-ppc] [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU, David Gibson, 2016/09/29
- Re: [Qemu-ppc] [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU, Programmingkid, 2016/09/29
- Re: [Qemu-ppc] [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU, Alex Bennée, 2016/09/29