← 输入框|github.com|刷新
Skip to content

WASM_X86: Support printing negative integers - #1311

Merged
ubaidsk merged 4 commits into
lcompilers:mainfrom
ubaidsk:wasm_x86_print_neg_ints
Nov 19, 2022
Merged

ubaidsk merged 4 commits into
lcompilers:mainfrom
ubaidsk:wasm_x86_print_neg_ints

Conversation

@ubaidsk

@ubaidsk ubaidsk commented Nov 17, 2022

Copy link
Copy Markdown
Collaborator

towards #1222

Example:

def main0():
    x: i32
    x = (2+3)* (-5)
    y: i32 = 100
    z: i32 = 2147483647
    w: i32 = -2147483648
    print(x)
    print(y)
    print(z)
    print(w)

main0()

Output:

(lp) ubaid@ubaid-Lenovo-ideapad-330-15ARR:~/OpenSource/lpython$ lpython examples/expr2.py --backend x86 -o test
(lp) ubaid@ubaid-Lenovo-ideapad-330-15ARR:~/OpenSource/lpython$ ./test
-25
100
2147483647
-2147483648
(lp) ubaid@ubaid-Lenovo-ideapad-330-15ARR:~/OpenSource/lpython$ lpython examples/expr2.py --backend wasm_x86 -o test
(lp) ubaid@ubaid-Lenovo-ideapad-330-15ARR:~/OpenSource/lpython$ ./test
-25
100
2147483647
-2147483648
(lp) ubaid@ubaid-Lenovo-ideapad-330-15ARR:~/OpenSource/lpython$ 

@ubaidsk
ubaidsk force-pushed the wasm_x86_print_neg_ints branch from 4a86a8b to 08617ae Compare November 17, 2022 21:20
@ubaidsk ubaidsk mentioned this pull request Nov 18, 2022
@ubaidsk ubaidsk added ready for review PRs that are ready for review wasm_x86 labels Nov 18, 2022

@certik certik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@ubaidsk
ubaidsk merged commit df11263 into lcompilers:main Nov 19, 2022
@ubaidsk
ubaidsk deleted the wasm_x86_print_neg_ints branch November 19, 2022 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review PRs that are ready for review wasm_x86

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants