Error: illegal operands `andi a1,a1,4095' #1

Closed
rwmjones opened this Issue Nov 10, 2016 · 8 comments

Projects

None yet

2 participants

@rwmjones
Contributor
rwmjones commented Nov 10, 2016 edited

In the ocaml omake program, compilation fails with:

/tmp/camlasm85c0d6.s:1973: Error: illegal operands `andi a1,a1,4095'
/tmp/camlasm85c0d6.s:2031: Error: illegal operands `andi a1,a1,4095'
/tmp/camlasm85c0d6.s:2037: Error: illegal operands `andi a1,a4,4095'
/tmp/camlasm85c0d6.s:2044: Error: illegal operands `andi a1,a7,4095'
/tmp/camlasm85c0d6.s:2067: Error: illegal operands `andi a1,s2,4095'
/tmp/camlasm85c0d6.s:2074: Error: illegal operands `andi a1,s6,4095'
/tmp/camlasm85c0d6.s:2276: Error: illegal operands `andi a1,a1,4095'
/tmp/camlasm85c0d6.s:2431: Error: illegal operands `andi a1,a1,4095'
/tmp/camlasm85c0d6.s:2437: Error: illegal operands `andi a1,a4,4095'
/tmp/camlasm85c0d6.s:2444: Error: illegal operands `andi a1,a7,4095'
/tmp/camlasm85c0d6.s:2467: Error: illegal operands `andi a1,s2,4095'
/tmp/camlasm85c0d6.s:2474: Error: illegal operands `andi a1,s6,4095'
File "lm_hash.ml", line 1:
Error: Assembler error, input left in file /tmp/camlasm85c0d6.s
@rwmjones
Contributor

This is a copy of the generated assembler:
http://oirase.annexia.org/tmp/camlasm85c0d6.s

@rwmjones
Contributor

There's another error compiling ocaml pcre. It's very similar so I'll leave it under the same issue:

/tmp/camlasmc421b5.s: Assembler messages:
/tmp/camlasmc421b5.s:1840: Error: illegal operands `ori s2,t4,2049'
/tmp/camlasmc421b5.s:5557: Error: illegal operands `ori s6,s5,2081'
/tmp/camlasmc421b5.s:6539: Error: illegal operands `ori a1,a0,2081'
File "lib/pcre.ml", line 1:
Error: Assembler error, input left in file /tmp/camlasmc421b5.s
@nojb
Owner
nojb commented Nov 10, 2016

Thanks for the report. I think I know what is the problem. I will try to get a fix out ASAP.

@nojb
Owner
nojb commented Nov 10, 2016

I think somewhere along the way there has been a change in the range of immediate arguments for the andi, ori and xori instructions. I pushed a fix to trunk. I am running the OCaml testsuite to make sure there is no regression. If you could try it out with omake & co and report back that would be great.

@nojb
Owner
nojb commented Nov 10, 2016

Testsuite passes; I wait for your confirmation before closing this.

@rwmjones
Contributor

I'm building everything again at the moment (status is right at the bottom of this page: https://fedorapeople.org/groups/risc-v/logs/status.html). Currently looking good, but the build has not yet reached the previously problematic packages (omake, pcre), so let's wait and see how it goes.

camlp5 is expected to fail.

@rwmjones
Contributor

omake and pcre builds were successful with this patch.

@rwmjones rwmjones closed this Nov 12, 2016
@nojb
Owner
nojb commented Nov 12, 2016

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment