Forum Discussion
Altera_Forum
Honored Contributor
10 years agohow to use the floating point hardware in nios II custom instructions
hi i want to compare the speed difference of floating point calc between custom instruction floating point and software. this is my code:# include <stdio.h># include <altera_avalon_pio_regs....
Altera_Forum
Honored Contributor
10 years agoi check the system.h
and i find this: /* * Custom instruction macros * */ # define ALT_CI_NIOS_CUSTOM_INSTR_FLOATING_POINT_0(n,A,B) __builtin_custom_inii(ALT_CI_NIOS_CUSTOM_INSTR_FLOATING_POINT_0_N+(n&ALT_CI_NIOS_CUSTOM_INSTR_FLOATING_POINT_0_N_MASK),(A),(B)) # define ALT_CI_NIOS_CUSTOM_INSTR_FLOATING_POINT_0_N 0xfc # define ALT_CI_NIOS_CUSTOM_INSTR_FLOATING_POINT_0_N_MASK ((1<<2)-1) i also tried c=ALT_CI_NIOS_CUSTOM_INSTR_FLOATING_POINT_0(3,a,b); c=ALT_CI_NIOS_CUSTOM_INSTR_FLOATING_POINT_0(1,a,b); c=ALT_CI_NIOS_CUSTOM_INSTR_FLOATING_POINT_0(2,b,a); c=ALT_CI_NIOS_CUSTOM_INSTR_FLOATING_POINT_0(0,b,a) but the result is 0.0