Skip to content

undefined symbol: __lshrsi3 #35

@chbessonova

Description

@chbessonova

Clang produces calls for functions like __lshrsi3, __lshrhi3 which is supposed to be a part of runtime library, but they are missed in libgcc for msp430 target.
Example,

  1 int i;
  2 unsigned long *x;
  3 
  4 void foo() {
  5   *x = *x >> i;    
  6 }

clang

foo:
	push	 r10
	mov	&x, r10
	mov	0(r10), r12
	mov	2(r10), r13
	mov.b	&i, r14
	call	#__lshrsi3
	mov	r13, 2(r10)
	mov	r12, 0(r10)
	pop	r10
	ret

gcc

foo:
	PUSH	R10
	MOV.W	&x, R10
	MOV.W	@R10, R12
	MOV.W	2(R10), R13
	MOV.W	&i, R14
	CALL	#__mspabi_srll
	MOV.W	R12, @R10
	MOV.W	R13, 2(R10)
	POP	R10
	RET

Added:
Need to add correct lib call lowering for RTLIB::SRL_I32 and other shifts to MSP430ISelLowering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions