Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined symbol: __lshrsi3 #35

Closed
chbessonova opened this issue Nov 6, 2018 · 0 comments
Closed

undefined symbol: __lshrsi3 #35

chbessonova opened this issue Nov 6, 2018 · 0 comments

Comments

@chbessonova
Copy link
Contributor

chbessonova commented Nov 6, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant