On 3/14/2015 2:20 PM, Pallav singh wrote:
> We can have textual substitution inside ASM, but i am getting error only for first substitution. Please do let me know how to solve it.
>
> template.cc:109:27: error: expected string-literal before 'right_string'
> asm volatile ( right_string<T>::instr_str
> ^
'asm' is implementation- and platform-specific. First, youi have never
mentioned what your platform or implementation was. Second, it is
better to post to the newsgroup that actually deals with your platform
or your compiler.
Also, see FAQ 5.8.
>
> ////////////////////////////////////////////////////////////////////////////////////
> template < >
> struct right_string<signed char> {
> static constexpr const char * instr_str = "mov %2, %%bh \n\tinc %%bh \n\tmov %%bh, %0 \n\tpushf \n\tpop %1\n\t;";
> static constexpr const char * clobber_str = "%bh";
> }
>
>
> asm volatile ( right_string<T>::instr_str
> : "=r"(result), "=r"(post_eflags)
> : "r"(counter)
> : right_string<T>::clobber_str);
>
>
> ////////////////////////////////////////////////////////////////////////////////////
>
> Thanks
> Pallav Singh
>
V
--
I do not respond to top-posted replies, please don't ask