bagel99 / llvm-my66000

This is a fork of the LLVM project. The code in branch my66000 supports Mitch Alsup's MY66000. The code in branch mcore supports the Motorola MCore.
http://llvm.org
Other
2 stars 2 forks source link

Cannot select AtomicLoadAdd #21

Open tkoenig1 opened 1 year ago

tkoenig1 commented 1 year ago

This is 20061005-1.c :

/* PR target/28924 */

char c;

void
testc (void)
{
  (void) __sync_fetch_and_add (&c, -1);
}

short s;

void
tests (void)
{
  (void) __sync_fetch_and_add (&s, -1);
}

void
testc2 (void)
{
  (void) __sync_val_compare_and_swap (&c, -1, -3);
}

yields

LLVM ERROR: Cannot select: 0x564c7bfb8218: i64,ch = AtomicLoadAdd<(load store seq_cst (s8) on @c)> 0x564c7bf73d18, 0x564c7bfb80e0, Constant:i64<-1>
  0x564c7bfb80e0: i64 = My66000ISD::WRAPPER TargetGlobalAddress:i64<i8* @c> 0
    0x564c7bfb8010: i64 = TargetGlobalAddress<i8* @c> 0
  0x564c7bfb81b0: i64 = Constant<-1>
In function: testc
bagel99 commented 1 year ago

I don't plan to implement atomics until much later.