[llvm-commits] [PATCH 08/11] (patch) Mips specific inline asm: constraint 'O':
Jim Grosbach
grosbach at apple.com
Thu Apr 26 14:49:09 PDT 2012
On Apr 26, 2012, at 2:43 PM, Eric Christopher <echristo at apple.com> wrote:
>
> On Apr 12, 2012, at 1:51 PM, Jack Carter <jcarter at mips.com> wrote:
>
>> A signed 15 bit constant.
>>
>> Example:
>>
>> short s_input = 7;short s_result = 0;
>>
>> // Good: value is within range.
>> short s_val = 16383;
>> __asm__ __volatile__(
>> "addi %0,%1,%2" : "=r" (s_result) : "r" (s_input), "O" (s_val));
>> printf ("mips_addi(%d,%d) = %d\n", s_input, s_val, s_result);
>>
>> // Good: value is still within range.
>> short s_val = -16383;
>> __asm__ __volatile__(
>> "addi %0,%1,%2" : "=r" (s_result) : "r" (s_input), "O" (s_val));
>> printf ("mips_addi(%d,%d) = %d\n", s_input, s_val, s_result);
>>
>> // Bad: value is out of range. llc should produce an error
>> short s_val = 16384;
>> __asm__ __volatile__(
>> "addi %0,%1,%2" : "=r" (s_result) : "r" (s_input), "O" (s_val));
>> printf ("mips_addi(%d,%d) = %d\n", s_input, s_val, s_result);
>> ---
>> lib/Target/Mips/MipsISelLowering.cpp | 11 +++++++++++
>> test/CodeGen/Mips/inlineasm-cnstrnt-bad-O.ll | 13 +++++++++++++
>> test/CodeGen/Mips/inlineasm_constraint.ll | 6 ++++++
>> 3 files changed, 30 insertions(+), 0 deletions(-)
>
> Slight problem here. I don't like using XFAIL for "this should fail" type of tests. You'll need to come up with another way to test this one.
Expected failures where "correct" is to get a diagnostic?
Check test/MC/ARM/thumb-diagnostics.s for examples of that.
-Jim
More information about the llvm-commits
mailing list